[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vsx-vector-6-func-2op.h
blobd9658090ee81e1411ce0b3369a65aa2d720f8113
1 /* The goal is to have both compile tests which verify the desired instruction
2 generation and to functionally test the builtins for correctness. This is
3 done in separate test files, vsx-vector-6-func-2op.c and
4 vsx-vector-6-func-2op-run.c. The vsx-vector-6-func-2opc test file only
5 generates the calls so the instruction counts do not include the counts of
6 the instructions generated as part of the result testing. The result
7 checking code differs for BE/LE. */
10 #include <altivec.h>
11 #include <stdio.h>
12 #include <stdlib.h>
14 void abort (void);
16 #define FLOAT_TEST(NAME) \
17 vector float __attribute__ ((noipa)) \
18 float_##NAME(vector float f_src_a, vector float f_src_b) \
19 { \
20 return vec_##NAME (f_src_a, f_src_b); \
23 FLOAT_TEST (add)
24 FLOAT_TEST (div)
25 FLOAT_TEST (max)
26 FLOAT_TEST (min)
27 FLOAT_TEST (mul)
28 FLOAT_TEST (sub)
30 #define DOUBLE_TEST(NAME) \
31 vector double __attribute__ ((noipa)) \
32 double_##NAME(vector double d_src_a, vector double d_src_b) \
33 { \
34 return vec_##NAME (d_src_a, d_src_b); \
37 DOUBLE_TEST (add)
38 DOUBLE_TEST (div)
39 DOUBLE_TEST (max)
40 DOUBLE_TEST (min)
41 DOUBLE_TEST (mul)
42 DOUBLE_TEST (sub)