]>
Commit | Line | Data |
---|---|---|
21933112 | 1 | /* Platform-specific SIMD declarations of math functions. |
dff8da6b | 2 | Copyright (C) 2014-2024 Free Software Foundation, Inc. |
21933112 AS |
3 | This file is part of the GNU C Library. |
4 | ||
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. | |
9 | ||
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. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
16 | License along with the GNU C Library; if not, see | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
21933112 AS |
18 | |
19 | #ifndef _MATH_H | |
20 | # error "Never include <bits/math-vector.h> directly;\ | |
21 | include <math.h> instead." | |
22 | #endif | |
23 | ||
24 | /* Get default empty definitions for simd declarations. */ | |
25 | #include <bits/libm-simd-decl-stubs.h> | |
26 | ||
27 | #if defined __x86_64__ && defined __FAST_MATH__ | |
28 | # if defined _OPENMP && _OPENMP >= 201307 | |
29 | /* OpenMP case. */ | |
30 | # define __DECL_SIMD_x86_64 _Pragma ("omp declare simd notinbranch") | |
377ed004 AS |
31 | # elif __GNUC_PREREQ (6,0) |
32 | /* W/o OpenMP use GCC 6.* __attribute__ ((__simd__)). */ | |
33 | # define __DECL_SIMD_x86_64 __attribute__ ((__simd__ ("notinbranch"))) | |
34 | # endif | |
35 | ||
36 | # ifdef __DECL_SIMD_x86_64 | |
21933112 AS |
37 | # undef __DECL_SIMD_cos |
38 | # define __DECL_SIMD_cos __DECL_SIMD_x86_64 | |
04f496d6 AS |
39 | # undef __DECL_SIMD_cosf |
40 | # define __DECL_SIMD_cosf __DECL_SIMD_x86_64 | |
4b9c2b70 AS |
41 | # undef __DECL_SIMD_sin |
42 | # define __DECL_SIMD_sin __DECL_SIMD_x86_64 | |
2a8c2c7b AS |
43 | # undef __DECL_SIMD_sinf |
44 | # define __DECL_SIMD_sinf __DECL_SIMD_x86_64 | |
c9a8c526 AS |
45 | # undef __DECL_SIMD_sincos |
46 | # define __DECL_SIMD_sincos __DECL_SIMD_x86_64 | |
a6336cc4 AS |
47 | # undef __DECL_SIMD_sincosf |
48 | # define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 | |
6af25acc AS |
49 | # undef __DECL_SIMD_log |
50 | # define __DECL_SIMD_log __DECL_SIMD_x86_64 | |
774488f8 AS |
51 | # undef __DECL_SIMD_logf |
52 | # define __DECL_SIMD_logf __DECL_SIMD_x86_64 | |
9c02f663 AS |
53 | # undef __DECL_SIMD_exp |
54 | # define __DECL_SIMD_exp __DECL_SIMD_x86_64 | |
1663be05 AS |
55 | # undef __DECL_SIMD_expf |
56 | # define __DECL_SIMD_expf __DECL_SIMD_x86_64 | |
c10b9b13 AS |
57 | # undef __DECL_SIMD_pow |
58 | # define __DECL_SIMD_pow __DECL_SIMD_x86_64 | |
8aa92022 AS |
59 | # undef __DECL_SIMD_powf |
60 | # define __DECL_SIMD_powf __DECL_SIMD_x86_64 | |
f20f980c SP |
61 | # undef __DECL_SIMD_acos |
62 | # define __DECL_SIMD_acos __DECL_SIMD_x86_64 | |
63 | # undef __DECL_SIMD_acosf | |
64 | # define __DECL_SIMD_acosf __DECL_SIMD_x86_64 | |
14631017 SP |
65 | # undef __DECL_SIMD_atan |
66 | # define __DECL_SIMD_atan __DECL_SIMD_x86_64 | |
67 | # undef __DECL_SIMD_atanf | |
68 | # define __DECL_SIMD_atanf __DECL_SIMD_x86_64 | |
11c01de1 SP |
69 | # undef __DECL_SIMD_asin |
70 | # define __DECL_SIMD_asin __DECL_SIMD_x86_64 | |
71 | # undef __DECL_SIMD_asinf | |
72 | # define __DECL_SIMD_asinf __DECL_SIMD_x86_64 | |
37475ba8 SP |
73 | # undef __DECL_SIMD_hypot |
74 | # define __DECL_SIMD_hypot __DECL_SIMD_x86_64 | |
75 | # undef __DECL_SIMD_hypotf | |
76 | # define __DECL_SIMD_hypotf __DECL_SIMD_x86_64 | |
3fc9ccc2 SP |
77 | # undef __DECL_SIMD_exp2 |
78 | # define __DECL_SIMD_exp2 __DECL_SIMD_x86_64 | |
79 | # undef __DECL_SIMD_exp2f | |
80 | # define __DECL_SIMD_exp2f __DECL_SIMD_x86_64 | |
8b726453 SP |
81 | # undef __DECL_SIMD_exp10 |
82 | # define __DECL_SIMD_exp10 __DECL_SIMD_x86_64 | |
83 | # undef __DECL_SIMD_exp10f | |
84 | # define __DECL_SIMD_exp10f __DECL_SIMD_x86_64 | |
ef7ea9c1 SP |
85 | # undef __DECL_SIMD_cosh |
86 | # define __DECL_SIMD_cosh __DECL_SIMD_x86_64 | |
87 | # undef __DECL_SIMD_coshf | |
88 | # define __DECL_SIMD_coshf __DECL_SIMD_x86_64 | |
76ddc74e SP |
89 | # undef __DECL_SIMD_expm1 |
90 | # define __DECL_SIMD_expm1 __DECL_SIMD_x86_64 | |
91 | # undef __DECL_SIMD_expm1f | |
92 | # define __DECL_SIMD_expm1f __DECL_SIMD_x86_64 | |
aa1809a1 SP |
93 | # undef __DECL_SIMD_sinh |
94 | # define __DECL_SIMD_sinh __DECL_SIMD_x86_64 | |
95 | # undef __DECL_SIMD_sinhf | |
96 | # define __DECL_SIMD_sinhf __DECL_SIMD_x86_64 | |
2bf02c58 SP |
97 | # undef __DECL_SIMD_cbrt |
98 | # define __DECL_SIMD_cbrt __DECL_SIMD_x86_64 | |
99 | # undef __DECL_SIMD_cbrtf | |
100 | # define __DECL_SIMD_cbrtf __DECL_SIMD_x86_64 | |
2941a24f SP |
101 | # undef __DECL_SIMD_atan2 |
102 | # define __DECL_SIMD_atan2 __DECL_SIMD_x86_64 | |
103 | # undef __DECL_SIMD_atan2f | |
104 | # define __DECL_SIMD_atan2f __DECL_SIMD_x86_64 | |
8f856602 SP |
105 | # undef __DECL_SIMD_log10 |
106 | # define __DECL_SIMD_log10 __DECL_SIMD_x86_64 | |
107 | # undef __DECL_SIMD_log10f | |
108 | # define __DECL_SIMD_log10f __DECL_SIMD_x86_64 | |
7e1722fe SP |
109 | # undef __DECL_SIMD_log2 |
110 | # define __DECL_SIMD_log2 __DECL_SIMD_x86_64 | |
111 | # undef __DECL_SIMD_log2f | |
112 | # define __DECL_SIMD_log2f __DECL_SIMD_x86_64 | |
74265c16 SP |
113 | # undef __DECL_SIMD_log1p |
114 | # define __DECL_SIMD_log1p __DECL_SIMD_x86_64 | |
115 | # undef __DECL_SIMD_log1pf | |
116 | # define __DECL_SIMD_log1pf __DECL_SIMD_x86_64 | |
6dea4dd3 SP |
117 | # undef __DECL_SIMD_atanh |
118 | # define __DECL_SIMD_atanh __DECL_SIMD_x86_64 | |
119 | # undef __DECL_SIMD_atanhf | |
120 | # define __DECL_SIMD_atanhf __DECL_SIMD_x86_64 | |
0625489c SP |
121 | # undef __DECL_SIMD_acosh |
122 | # define __DECL_SIMD_acosh __DECL_SIMD_x86_64 | |
123 | # undef __DECL_SIMD_acoshf | |
124 | # define __DECL_SIMD_acoshf __DECL_SIMD_x86_64 | |
f9ce13fd SP |
125 | # undef __DECL_SIMD_erf |
126 | # define __DECL_SIMD_erf __DECL_SIMD_x86_64 | |
127 | # undef __DECL_SIMD_erff | |
128 | # define __DECL_SIMD_erff __DECL_SIMD_x86_64 | |
c0f36fc3 SP |
129 | # undef __DECL_SIMD_tanh |
130 | # define __DECL_SIMD_tanh __DECL_SIMD_x86_64 | |
131 | # undef __DECL_SIMD_tanhf | |
132 | # define __DECL_SIMD_tanhf __DECL_SIMD_x86_64 | |
e682d015 SP |
133 | # undef __DECL_SIMD_asinh |
134 | # define __DECL_SIMD_asinh __DECL_SIMD_x86_64 | |
135 | # undef __DECL_SIMD_asinhf | |
136 | # define __DECL_SIMD_asinhf __DECL_SIMD_x86_64 | |
8881cca8 SP |
137 | # undef __DECL_SIMD_erfc |
138 | # define __DECL_SIMD_erfc __DECL_SIMD_x86_64 | |
139 | # undef __DECL_SIMD_erfcf | |
140 | # define __DECL_SIMD_erfcf __DECL_SIMD_x86_64 | |
c21c7bc2 SP |
141 | # undef __DECL_SIMD_tan |
142 | # define __DECL_SIMD_tan __DECL_SIMD_x86_64 | |
143 | # undef __DECL_SIMD_tanf | |
144 | # define __DECL_SIMD_tanf __DECL_SIMD_x86_64 | |
6af25acc | 145 | |
21933112 AS |
146 | # endif |
147 | #endif |