Vector expf for x86_64 and tests.
[glibc.git] / sysdeps / x86 / fpu / bits / math-vector.h
blob3b7158952cf19aa0a779a55b14393243264ed99f
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.
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 _MATH_H
20 # error "Never include <bits/math-vector.h> directly;\
21 include <math.h> instead."
22 #endif
24 /* Get default empty definitions for simd declarations. */
25 #include <bits/libm-simd-decl-stubs.h>
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
33 # undef __DECL_SIMD_cosf
34 # define __DECL_SIMD_cosf __DECL_SIMD_x86_64
35 # undef __DECL_SIMD_sin
36 # define __DECL_SIMD_sin __DECL_SIMD_x86_64
37 # undef __DECL_SIMD_sinf
38 # define __DECL_SIMD_sinf __DECL_SIMD_x86_64
39 # undef __DECL_SIMD_log
40 # define __DECL_SIMD_log __DECL_SIMD_x86_64
41 # undef __DECL_SIMD_logf
42 # define __DECL_SIMD_logf __DECL_SIMD_x86_64
43 # undef __DECL_SIMD_exp
44 # define __DECL_SIMD_exp __DECL_SIMD_x86_64
45 # undef __DECL_SIMD_expf
46 # define __DECL_SIMD_expf __DECL_SIMD_x86_64
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");
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");
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");
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");
69 # endif
70 #endif