]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/x86/fpu/bits/math-vector.h
x86-64: Add vector cosh/coshf implementation to libmvec
[thirdparty/glibc.git] / sysdeps / x86 / fpu / bits / math-vector.h
1 /* Platform-specific SIMD declarations of math functions.
2 Copyright (C) 2014-2021 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
90 # endif
91 #endif