Use libc_hidden_* for fputs (bug 15105).
[glibc.git] / sysdeps / powerpc / bits / floatn.h
blobc3834096e37803205b79e9616c6ef9857f0c4c15
1 /* Macros to control TS 18661-3 glibc features on powerpc.
2 Copyright (C) 2017-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _BITS_FLOATN_H
20 #define _BITS_FLOATN_H
22 #include <features.h>
23 #include <bits/long-double.h>
25 /* Defined to 1 if the current compiler invocation provides a
26 floating-point type with the IEEE 754 binary128 format, and this glibc
27 includes corresponding *f128 interfaces for it. */
28 #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
29 && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH
30 # define __HAVE_FLOAT128 1
31 #else
32 # define __HAVE_FLOAT128 0
33 #endif
35 /* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
36 from the default float, double and long double types in this glibc. */
37 #if __HAVE_FLOAT128
38 # define __HAVE_DISTINCT_FLOAT128 1
39 #else
40 # define __HAVE_DISTINCT_FLOAT128 0
41 #endif
43 /* Defined to 1 if the current compiler invocation provides a
44 floating-point type with the right format for _Float64x, and this
45 glibc includes corresponding *f64x interfaces for it. */
46 #define __HAVE_FLOAT64X __HAVE_FLOAT128
48 /* Defined to 1 if __HAVE_FLOAT64X is 1 and _Float64x has the format
49 of long double. Otherwise, if __HAVE_FLOAT64X is 1, _Float64x has
50 the format of _Float128, which must be different from that of long
51 double. */
52 #define __HAVE_FLOAT64X_LONG_DOUBLE 0
54 #ifndef __ASSEMBLER__
56 /* Defined to concatenate the literal suffix to be used with _Float128
57 types, if __HAVE_FLOAT128 is 1. */
58 # if __HAVE_FLOAT128
59 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus
60 /* The literal suffix (f128) exist for powerpc only since GCC 7.0. */
61 # define __f128(x) x##q
62 # else
63 # define __f128(x) x##f128
64 # endif
65 # endif
67 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
68 # if __HAVE_FLOAT128
69 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus
70 /* Add a typedef for older GCC compilers which don't natively support
71 _Complex _Float128. */
72 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
73 # define __CFLOAT128 __cfloat128
74 # else
75 # define __CFLOAT128 _Complex _Float128
76 # endif
77 # endif
79 /* The remaining of this file provides support for older compilers. */
80 # if __HAVE_FLOAT128
82 /* The type _Float128 exist for powerpc only since GCC 7.0. */
83 # if !__GNUC_PREREQ (7, 0) || defined __cplusplus
84 typedef __float128 _Float128;
85 # endif
87 /* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0. */
88 # if !__GNUC_PREREQ (7, 0)
89 # define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())
90 # endif
92 /* The following builtins (suffixed with 'q') are available in GCC >= 6.2,
93 which is the minimum version required for float128 support on powerpc64le.
94 Since GCC 7.0 the builtins suffixed with f128 are also available, then
95 there is no need to redefined them. */
96 # if !__GNUC_PREREQ (7, 0)
97 # define __builtin_copysignf128 __builtin_copysignq
98 # define __builtin_fabsf128 __builtin_fabsq
99 # define __builtin_inff128 __builtin_infq
100 # define __builtin_nanf128 __builtin_nanq
101 # define __builtin_nansf128 __builtin_nansq
102 # endif
104 /* In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*,
105 e.g.: __builtin_signbitf128, before GCC 6. However, there has never
106 been a __builtin_signbitf128 in GCC and the type-generic builtin is
107 only available since GCC 6. */
108 # if !__GNUC_PREREQ (6, 0)
109 # define __builtin_signbitf128 __signbitf128
110 # endif
112 # endif
114 #endif /* !__ASSEMBLER__. */
116 #include <bits/floatn-common.h>
118 #endif /* _BITS_FLOATN_H */