Vector logf for x86_64 and tests.
[glibc.git] / sysdeps / x86 / fpu / bits / math-vector.h
blob5c3e492ef94071f51cdd5cbb0e0ff4470e93781b
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
44 /* Workaround to exclude unnecessary symbol aliases in libmvec
45 while GCC creates the vector names based on scalar asm name.
46 Corresponding discussion started at
47 <https://gcc.gnu.org/ml/gcc/2015-06/msg00173.html>. */
48 __asm__ ("_ZGVbN2v___log_finite = _ZGVbN2v_log");
49 __asm__ ("_ZGVcN4v___log_finite = _ZGVcN4v_log");
50 __asm__ ("_ZGVdN4v___log_finite = _ZGVdN4v_log");
51 __asm__ ("_ZGVeN8v___log_finite = _ZGVeN8v_log");
52 __asm__ ("_ZGVbN4v___logf_finite = _ZGVbN4v_logf");
53 __asm__ ("_ZGVcN8v___logf_finite = _ZGVcN8v_logf");
54 __asm__ ("_ZGVdN8v___logf_finite = _ZGVdN8v_logf");
55 __asm__ ("_ZGVeN16v___logf_finite = _ZGVeN16v_logf");
57 # endif
58 #endif