1 | /* Platform-specific SIMD declarations of math functions. |
2 | Copyright (C) 2014-2022 Free Software Foundation, Inc. |
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 |
17 | <https://www.gnu.org/licenses/>. */ |
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") |
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 |
37 | # undef __DECL_SIMD_cos |
38 | # define __DECL_SIMD_cos __DECL_SIMD_x86_64 |
39 | # undef __DECL_SIMD_cosf |
40 | # define __DECL_SIMD_cosf __DECL_SIMD_x86_64 |
41 | # undef __DECL_SIMD_sin |
42 | # define __DECL_SIMD_sin __DECL_SIMD_x86_64 |
43 | # undef __DECL_SIMD_sinf |
44 | # define __DECL_SIMD_sinf __DECL_SIMD_x86_64 |
45 | # undef __DECL_SIMD_sincos |
46 | # define __DECL_SIMD_sincos __DECL_SIMD_x86_64 |
47 | # undef __DECL_SIMD_sincosf |
48 | # define __DECL_SIMD_sincosf __DECL_SIMD_x86_64 |
49 | # undef __DECL_SIMD_log |
50 | # define __DECL_SIMD_log __DECL_SIMD_x86_64 |
51 | # undef __DECL_SIMD_logf |
52 | # define __DECL_SIMD_logf __DECL_SIMD_x86_64 |
53 | # undef __DECL_SIMD_exp |
54 | # define __DECL_SIMD_exp __DECL_SIMD_x86_64 |
55 | # undef __DECL_SIMD_expf |
56 | # define __DECL_SIMD_expf __DECL_SIMD_x86_64 |
57 | # undef __DECL_SIMD_pow |
58 | # define __DECL_SIMD_pow __DECL_SIMD_x86_64 |
59 | # undef __DECL_SIMD_powf |
60 | # define __DECL_SIMD_powf __DECL_SIMD_x86_64 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
145 | |
146 | # endif |
147 | #endif |
148 | |