1 /* Wrappers definitions for tests of ABI of vector sincos/sincosf having
2 vector declaration "#pragma omp declare simd notinbranch".
3 Copyright (C) 2016-2019 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
20 #define INIT_VEC_PTRS_LOOP(vec, val, len) \
23 union { VEC_INT_TYPE v; __typeof__ ((val)[0]) *a[(len)]; } u; \
24 for (i = 0; i < len; i++) \
30 /* Wrapper for vector sincos/sincosf compatible with x86_64 and x32 variants
31 of _ZGVbN2vvv_sincos, _ZGVdN4vvv_sincos, _ZGVeN8vvv_sincos;
32 x32 variants of _ZGVbN4vvv_sincosf, _ZGVcN4vvv_sincos, _ZGVdN8vvv_sincosf,
33 _ZGVeN16vvv_sincosf. */
34 #define VECTOR_WRAPPER_fFF_2(scalar_func, vector_func) \
35 extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE); \
36 void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
39 FLOAT r_loc[VEC_LEN], r1_loc[VEC_LEN]; \
41 VEC_INT_TYPE mr, mr1; \
42 INIT_VEC_LOOP (mx, x, VEC_LEN); \
43 INIT_VEC_PTRS_LOOP (mr, r_loc, VEC_LEN); \
44 INIT_VEC_PTRS_LOOP (mr1, r1_loc, VEC_LEN); \
45 vector_func (mx, mr, mr1); \
46 TEST_VEC_LOOP (r_loc, VEC_LEN); \
47 TEST_VEC_LOOP (r1_loc, VEC_LEN); \
53 /* Wrapper for vector sincos/sincosf compatible with x86_64 variants of
54 _ZGVcN4vvv_sincos, _ZGVeN16vvv_sincosf, _ZGVbN4vvv_sincosf,
55 _ZGVdN8vvv_sincosf, _ZGVcN8vvv_sincosf. */
56 #define VECTOR_WRAPPER_fFF_3(scalar_func, vector_func) \
57 extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE, \
58 VEC_INT_TYPE, VEC_INT_TYPE); \
59 void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
62 FLOAT r_loc[VEC_LEN/2], r1_loc[VEC_LEN/2]; \
64 VEC_INT_TYPE mr, mr1; \
65 INIT_VEC_LOOP (mx, x, VEC_LEN); \
66 INIT_VEC_PTRS_LOOP (mr, r_loc, VEC_LEN/2); \
67 INIT_VEC_PTRS_LOOP (mr1, r1_loc, VEC_LEN/2); \
68 vector_func (mx, mr, mr, mr1, mr1); \
69 TEST_VEC_LOOP (r_loc, VEC_LEN/2); \
70 TEST_VEC_LOOP (r1_loc, VEC_LEN/2); \
76 /* Wrapper for vector sincosf compatible with x86_64 variant of
77 _ZGVcN8vvv_sincosf. */
78 #define VECTOR_WRAPPER_fFF_4(scalar_func, vector_func) \
79 extern void vector_func (VEC_TYPE, VEC_INT_TYPE, VEC_INT_TYPE, \
80 VEC_INT_TYPE, VEC_INT_TYPE, \
81 VEC_INT_TYPE, VEC_INT_TYPE, \
82 VEC_INT_TYPE, VEC_INT_TYPE); \
83 void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \
86 FLOAT r_loc[VEC_LEN/4], r1_loc[VEC_LEN/4]; \
88 VEC_INT_TYPE mr, mr1; \
89 INIT_VEC_LOOP (mx, x, VEC_LEN); \
90 INIT_VEC_PTRS_LOOP (mr, r_loc, VEC_LEN/4); \
91 INIT_VEC_PTRS_LOOP (mr1, r1_loc, VEC_LEN/4); \
92 vector_func (mx, mr, mr, mr, mr, mr1, mr1, mr1, mr1); \
93 TEST_VEC_LOOP (r_loc, VEC_LEN/4); \
94 TEST_VEC_LOOP (r1_loc, VEC_LEN/4); \