]>
Commit | Line | Data |
---|---|---|
24a2718f AS |
1 | /* Definitions for double vector tests with vector length 8. |
2 | Copyright (C) 2014-2015 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 | <http://www.gnu.org/licenses/>. */ | |
18 | ||
19 | #define FLOAT double | |
20 | #define FUNC(function) function | |
21 | #define TEST_MSG "testing double vector math (without inline functions)\n" | |
22 | #define MATHCONST(x) x | |
23 | #define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cdouble | |
24 | #define PRINTF_EXPR "e" | |
25 | #define PRINTF_XEXPR "a" | |
26 | #define PRINTF_NEXPR "f" | |
27 | #define TEST_DOUBLE 1 | |
28 | #define TEST_MATHVEC 1 | |
29 | ||
30 | #ifndef __NO_MATH_INLINES | |
31 | # define __NO_MATH_INLINES | |
32 | #endif | |
33 | ||
34 | #define EXCEPTION_TESTS_double 0 | |
35 | #define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST) | |
36 | ||
37 | #define CNCT(x, y) x ## y | |
38 | #define CONCAT(a, b) CNCT (a, b) | |
39 | ||
40 | #define VEC_SUFF _vlen8 | |
41 | #define WRAPPER_NAME(function) CONCAT (function, VEC_SUFF) | |
42 | ||
43 | #define FUNC_TEST(function) function ## _VEC_SUFF | |
44 | ||
45 | #define WRAPPER_DECL(function) extern FLOAT function (FLOAT); | |
46 | #define WRAPPER_DECL_ff(function) extern FLOAT function (FLOAT, FLOAT); | |
c9a8c526 | 47 | #define WRAPPER_DECL_fFF(function) extern void function (FLOAT, FLOAT *, FLOAT *); |
24a2718f AS |
48 | |
49 | // Wrapper from scalar to vector function with vector length 8. | |
50 | #define VECTOR_WRAPPER(scalar_func, vector_func) \ | |
51 | extern VEC_TYPE vector_func (VEC_TYPE); \ | |
52 | FLOAT scalar_func (FLOAT x) \ | |
53 | { \ | |
54 | int i; \ | |
55 | VEC_TYPE mx; \ | |
56 | INIT_VEC_LOOP (mx, x, 8); \ | |
57 | VEC_TYPE mr = vector_func (mx); \ | |
c9a8c526 AS |
58 | TEST_VEC_LOOP (mr, 8); \ |
59 | return ((FLOAT) mr[0]); \ | |
24a2718f AS |
60 | } |
61 | ||
62 | // Wrapper from scalar 2 argument function to vector one. | |
63 | #define VECTOR_WRAPPER_ff(scalar_func, vector_func) \ | |
64 | extern VEC_TYPE vector_func (VEC_TYPE, VEC_TYPE); \ | |
65 | FLOAT scalar_func (FLOAT x, FLOAT y) \ | |
66 | { \ | |
67 | int i; \ | |
68 | VEC_TYPE mx, my; \ | |
69 | INIT_VEC_LOOP (mx, x, 8); \ | |
70 | INIT_VEC_LOOP (my, y, 8); \ | |
71 | VEC_TYPE mr = vector_func (mx, my); \ | |
c9a8c526 AS |
72 | TEST_VEC_LOOP (mr, 8); \ |
73 | return ((FLOAT) mr[0]); \ | |
74 | } | |
75 | ||
76 | // Wrapper from scalar 3 argument function to vector one. | |
77 | #define VECTOR_WRAPPER_fFF(scalar_func, vector_func) \ | |
78 | extern void vector_func (VEC_TYPE, VEC_TYPE *, VEC_TYPE *); \ | |
79 | void scalar_func (FLOAT x, FLOAT * r, FLOAT * r1) \ | |
80 | { \ | |
81 | int i; \ | |
82 | VEC_TYPE mx, mr, mr1; \ | |
83 | INIT_VEC_LOOP (mx, x, 8); \ | |
84 | vector_func (mx, &mr, &mr1); \ | |
85 | TEST_VEC_LOOP (mr, 8); \ | |
86 | TEST_VEC_LOOP (mr1, 8); \ | |
87 | *r = (FLOAT) mr[0]; \ | |
88 | *r1 = (FLOAT) mr1[0]; \ | |
89 | return; \ | |
24a2718f | 90 | } |