annotate libgcc/soft-fp/trunctfdf2.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Software floating-point emulation.
kono
parents:
diff changeset
2 Truncate IEEE quad into IEEE double
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
3 Copyright (C) 1997-2019 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
4 This file is part of the GNU C Library.
kono
parents:
diff changeset
5 Contributed by Richard Henderson (rth@cygnus.com) and
kono
parents:
diff changeset
6 Jakub Jelinek (jj@ultra.linux.cz).
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 The GNU C Library is free software; you can redistribute it and/or
kono
parents:
diff changeset
9 modify it under the terms of the GNU Lesser General Public
kono
parents:
diff changeset
10 License as published by the Free Software Foundation; either
kono
parents:
diff changeset
11 version 2.1 of the License, or (at your option) any later version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 In addition to the permissions in the GNU Lesser General Public
kono
parents:
diff changeset
14 License, the Free Software Foundation gives you unlimited
kono
parents:
diff changeset
15 permission to link the compiled version of this file into
kono
parents:
diff changeset
16 combinations with other programs, and to distribute those
kono
parents:
diff changeset
17 combinations without any restriction coming from the use of this
kono
parents:
diff changeset
18 file. (The Lesser General Public License restrictions do apply in
kono
parents:
diff changeset
19 other respects; for example, they cover modification of the file,
kono
parents:
diff changeset
20 and distribution when not linked into a combine executable.)
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 The GNU C Library is distributed in the hope that it will be useful,
kono
parents:
diff changeset
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
kono
parents:
diff changeset
25 Lesser General Public License for more details.
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 You should have received a copy of the GNU Lesser General Public
kono
parents:
diff changeset
28 License along with the GNU C Library; if not, see
kono
parents:
diff changeset
29 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 #include "soft-fp.h"
kono
parents:
diff changeset
32 #include "double.h"
kono
parents:
diff changeset
33 #include "quad.h"
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 DFtype
kono
parents:
diff changeset
36 __trunctfdf2 (TFtype a)
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 FP_DECL_EX;
kono
parents:
diff changeset
39 FP_DECL_Q (A);
kono
parents:
diff changeset
40 FP_DECL_D (R);
kono
parents:
diff changeset
41 DFtype r;
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 FP_INIT_ROUNDMODE;
kono
parents:
diff changeset
44 FP_UNPACK_SEMIRAW_Q (A, a);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 111
diff changeset
45 #if _FP_W_TYPE_SIZE < 64
111
kono
parents:
diff changeset
46 FP_TRUNC (D, Q, 2, 4, R, A);
kono
parents:
diff changeset
47 #else
kono
parents:
diff changeset
48 FP_TRUNC (D, Q, 1, 2, R, A);
kono
parents:
diff changeset
49 #endif
kono
parents:
diff changeset
50 FP_PACK_SEMIRAW_D (r, R);
kono
parents:
diff changeset
51 FP_HANDLE_EXCEPTIONS;
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 return r;
kono
parents:
diff changeset
54 }