More strict check of AVX512 support in assembler.
[glibc.git] / math / test-float-vlen16.h
blob5c0a7a484fe2332f97391f1199b69dee6bdd35b7
1 /* Definitions for float vector tests with vector length 16.
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 #define FLOAT float
20 #define FUNC(function) function ## f
21 #define TEST_MSG "testing float vector math (without inline functions)\n"
22 #define MATHCONST(x) x
23 #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cfloat
24 #define PRINTF_EXPR "e"
25 #define PRINTF_XEXPR "a"
26 #define PRINTF_NEXPR "f"
27 #define TEST_FLOAT 1
28 #define TEST_MATHVEC 1
30 #ifndef __NO_MATH_INLINES
31 # define __NO_MATH_INLINES
32 #endif
34 #define EXCEPTION_TESTS_float 0
35 #define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST)
37 #define CNCT(x, y) x ## y
38 #define CONCAT(a, b) CNCT (a, b)
40 #define VEC_SUFF _vlen16
41 #define WRAPPER_NAME(function) CONCAT (function, VEC_SUFF)
43 #define FUNC_TEST(function) function ## f ## _VEC_SUFF
45 #define WRAPPER_DECL(func) extern FLOAT func (FLOAT x);
46 #define WRAPPER_DECL_ff(func) extern FLOAT func (FLOAT x, FLOAT y);
48 // Wrapper from scalar to vector function with vector length 16.
49 #define VECTOR_WRAPPER(scalar_func, vector_func) \
50 extern VEC_TYPE vector_func (VEC_TYPE); \
51 FLOAT scalar_func (FLOAT x) \
52 { \
53 int i; \
54 VEC_TYPE mx; \
55 INIT_VEC_LOOP (mx, x, 16); \
56 VEC_TYPE mr = vector_func (mx); \
57 TEST_VEC_LOOP (16); \
60 // Wrapper from scalar 2 argument function to vector one.
61 #define VECTOR_WRAPPER_ff(scalar_func, vector_func) \
62 extern VEC_TYPE vector_func (VEC_TYPE); \
63 FLOAT scalar_func (FLOAT x, FLOAT y) \
64 { \
65 int i; \
66 VEC_TYPE mx, my; \
67 INIT_VEC_LOOP (mx, x, 16); \
68 INIT_VEC_LOOP (my, y, 16); \
69 VEC_TYPE mr = vector_func (mx, my); \
70 TEST_VEC_LOOP (16); \