]>
Commit | Line | Data |
---|---|---|
ff473280 L |
1 | /* Copyright (C) 2008 Free Software Foundation, Inc. |
2 | ||
3 | This file is part of GCC. | |
4 | ||
5 | GCC is free software; you can redistribute it and/or modify it under | |
6 | the terms of the GNU General Public License as published by the Free | |
7 | Software Foundation; either version 2, or (at your option) any later | |
8 | version. | |
9 | ||
10 | In addition to the permissions in the GNU General Public License, the | |
11 | Free Software Foundation gives you unlimited permission to link the | |
12 | compiled version of this file into combinations with other programs, | |
13 | and to distribute those combinations without any restriction coming | |
14 | from the use of this file. (The General Public License restrictions | |
15 | do apply in other respects; for example, they cover modification of | |
16 | the file, and distribution when not linked into a combine | |
17 | executable.) | |
18 | ||
19 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
20 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
21 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
22 | for more details. | |
23 | ||
24 | You should have received a copy of the GNU General Public License | |
25 | along with GCC; see the file COPYING. If not, write to the Free | |
26 | Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA | |
27 | 02110-1301, USA. */ | |
28 | ||
29 | union _FP_UNION_Q | |
30 | { | |
31 | __float128 flt; | |
32 | struct | |
33 | { | |
34 | unsigned long frac0 : 32; | |
35 | unsigned long frac1 : 32; | |
36 | unsigned long frac2 : 32; | |
37 | unsigned long frac3 : 16; | |
38 | unsigned exp : 15; | |
39 | unsigned sign : 1; | |
40 | } bits __attribute__((packed)); | |
41 | }; | |
42 | ||
c60535f9 BE |
43 | __float128 __copysigntf3 (__float128, __float128); |
44 | __float128 __fabstf2 (__float128); | |
45 | ||
ff473280 L |
46 | __float128 |
47 | __copysigntf3 (__float128 a, __float128 b) | |
48 | { | |
49 | union _FP_UNION_Q A, B; | |
50 | ||
51 | A.flt = a; | |
52 | B.flt = b; | |
53 | A.bits.sign = B.bits.sign; | |
54 | ||
55 | return A.flt; | |
56 | } | |
57 | ||
58 | __float128 | |
59 | __fabstf2 (__float128 a) | |
60 | { | |
61 | union _FP_UNION_Q A; | |
62 | ||
63 | A.flt = a; | |
64 | A.bits.sign = 0; | |
65 | ||
66 | return A.flt; | |
67 | } |