]>
Commit | Line | Data |
---|---|---|
21933112 AS |
1 | /* Platform-specific SIMD declarations of math functions. |
2 | Copyright (C) 2014-2015 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 | <http://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 | # undef __DECL_SIMD_cos | |
32 | # define __DECL_SIMD_cos __DECL_SIMD_x86_64 | |
04f496d6 AS |
33 | # undef __DECL_SIMD_cosf |
34 | # define __DECL_SIMD_cosf __DECL_SIMD_x86_64 | |
4b9c2b70 AS |
35 | # undef __DECL_SIMD_sin |
36 | # define __DECL_SIMD_sin __DECL_SIMD_x86_64 | |
2a8c2c7b AS |
37 | # undef __DECL_SIMD_sinf |
38 | # define __DECL_SIMD_sinf __DECL_SIMD_x86_64 | |
6af25acc AS |
39 | # undef __DECL_SIMD_log |
40 | # define __DECL_SIMD_log __DECL_SIMD_x86_64 | |
774488f8 AS |
41 | # undef __DECL_SIMD_logf |
42 | # define __DECL_SIMD_logf __DECL_SIMD_x86_64 | |
9c02f663 AS |
43 | # undef __DECL_SIMD_exp |
44 | # define __DECL_SIMD_exp __DECL_SIMD_x86_64 | |
1663be05 AS |
45 | # undef __DECL_SIMD_expf |
46 | # define __DECL_SIMD_expf __DECL_SIMD_x86_64 | |
6af25acc AS |
47 | |
48 | /* Workaround to exclude unnecessary symbol aliases in libmvec | |
49 | while GCC creates the vector names based on scalar asm name. | |
50 | Corresponding discussion started at | |
51 | <https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>. */ | |
52 | __asm__ ("_ZGVbN2v___log_finite = _ZGVbN2v_log"); | |
53 | __asm__ ("_ZGVcN4v___log_finite = _ZGVcN4v_log"); | |
54 | __asm__ ("_ZGVdN4v___log_finite = _ZGVdN4v_log"); | |
55 | __asm__ ("_ZGVeN8v___log_finite = _ZGVeN8v_log"); | |
774488f8 AS |
56 | __asm__ ("_ZGVbN4v___logf_finite = _ZGVbN4v_logf"); |
57 | __asm__ ("_ZGVcN8v___logf_finite = _ZGVcN8v_logf"); | |
58 | __asm__ ("_ZGVdN8v___logf_finite = _ZGVdN8v_logf"); | |
59 | __asm__ ("_ZGVeN16v___logf_finite = _ZGVeN16v_logf"); | |
9c02f663 AS |
60 | __asm__ ("_ZGVbN2v___exp_finite = _ZGVbN2v_exp"); |
61 | __asm__ ("_ZGVcN4v___exp_finite = _ZGVcN4v_exp"); | |
62 | __asm__ ("_ZGVdN4v___exp_finite = _ZGVdN4v_exp"); | |
63 | __asm__ ("_ZGVeN8v___exp_finite = _ZGVeN8v_exp"); | |
1663be05 AS |
64 | __asm__ ("_ZGVbN4v___expf_finite = _ZGVbN4v_expf"); |
65 | __asm__ ("_ZGVcN8v___expf_finite = _ZGVcN8v_expf"); | |
66 | __asm__ ("_ZGVdN8v___expf_finite = _ZGVdN8v_expf"); | |
67 | __asm__ ("_ZGVeN16v___expf_finite = _ZGVeN16v_expf"); | |
6af25acc | 68 | |
21933112 AS |
69 | # endif |
70 | #endif |