1 1.1.1.12 mrg /* Copyright (C) 2008-2024 Free Software Foundation, Inc. 2 1.1 mrg 3 1.1 mrg This file is part of GCC. 4 1.1 mrg 5 1.1 mrg GCC is free software; you can redistribute it and/or modify it under 6 1.1 mrg the terms of the GNU General Public License as published by the Free 7 1.1 mrg Software Foundation; either version 3, or (at your option) any later 8 1.1 mrg version. 9 1.1 mrg 10 1.1 mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY 11 1.1 mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 1.1 mrg FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 1.1 mrg for more details. 14 1.1 mrg 15 1.1 mrg Under Section 7 of GPL version 3, you are granted additional 16 1.1 mrg permissions described in the GCC Runtime Library Exception, version 17 1.1 mrg 3.1, as published by the Free Software Foundation. 18 1.1 mrg 19 1.1 mrg You should have received a copy of the GNU General Public License and 20 1.1 mrg a copy of the GCC Runtime Library Exception along with this program; 21 1.1 mrg see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 22 1.1 mrg <http://www.gnu.org/licenses/>. */ 23 1.1 mrg 24 1.1 mrg union _FP_UNION_Q 25 1.1 mrg { 26 1.1 mrg __float128 flt; 27 1.1 mrg struct 28 1.1 mrg { 29 1.1.1.5 mrg unsigned long frac0 : 64; 30 1.1.1.5 mrg unsigned long frac1 : 48; 31 1.1 mrg unsigned exp : 15; 32 1.1 mrg unsigned sign : 1; 33 1.1 mrg } bits __attribute__((packed)); 34 1.1 mrg }; 35 1.1 mrg 36 1.1 mrg __float128 __copysigntf3 (__float128, __float128); 37 1.1 mrg __float128 __fabstf2 (__float128); 38 1.1.1.5 mrg int __signbittf2 (__float128); 39 1.1 mrg 40 1.1 mrg __float128 41 1.1 mrg __copysigntf3 (__float128 a, __float128 b) 42 1.1 mrg { 43 1.1 mrg union _FP_UNION_Q A, B; 44 1.1 mrg 45 1.1 mrg A.flt = a; 46 1.1 mrg B.flt = b; 47 1.1 mrg A.bits.sign = B.bits.sign; 48 1.1 mrg 49 1.1 mrg return A.flt; 50 1.1 mrg } 51 1.1 mrg 52 1.1 mrg __float128 53 1.1 mrg __fabstf2 (__float128 a) 54 1.1 mrg { 55 1.1 mrg union _FP_UNION_Q A; 56 1.1 mrg 57 1.1 mrg A.flt = a; 58 1.1 mrg A.bits.sign = 0; 59 1.1 mrg 60 1.1 mrg return A.flt; 61 1.1 mrg } 62 1.1.1.5 mrg 63 1.1.1.5 mrg int 64 1.1.1.5 mrg __signbittf2 (__float128 a) 65 1.1.1.5 mrg { 66 1.1.1.5 mrg union _FP_UNION_Q A; 67 1.1.1.5 mrg 68 1.1.1.5 mrg A.flt = a; 69 1.1.1.5 mrg 70 1.1.1.5 mrg return A.bits.sign; 71 1.1.1.5 mrg } 72