[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vsx-vector-6-func-3op.h
blob66965aeef55715af615bab04e0f7fcabbfd56010
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-3op.c and
4 vsx-vector-6-func-3op-run.c. The vsx-vector-6-func-3op.c 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. */
9 #include <altivec.h>
10 #include <stdio.h>
11 #include <stdlib.h>
13 void abort (void);
15 /* Macro to create call to builtin. */
16 #define FLOAT_TEST(NAME) \
17 vector float __attribute__ ((noipa)) \
18 float_##NAME(vector float f_src_a, vector float f_src_b, \
19 vector float f_src_c) \
20 { \
21 return vec_##NAME (f_src_a, f_src_b, f_src_c); \
24 FLOAT_TEST (madd)
25 FLOAT_TEST (msub)
27 #define DOUBLE_TEST(NAME) \
28 vector double __attribute__ ((noipa)) \
29 double_##NAME(vector double d_src_a, vector double d_src_b, \
30 vector double d_src_c) \
31 { \
32 return vec_##NAME (d_src_a, d_src_b, d_src_c); \
35 DOUBLE_TEST (madd)
36 DOUBLE_TEST (msub)
38 vector unsigned int __attribute__ ((noipa))
39 short_msums_unsigned (vector unsigned short us_src_a,
40 vector unsigned short us_src_b,
41 vector unsigned int ui_src_c)
43 return vec_msums (us_src_a, us_src_b, ui_src_c);
46 vector int __attribute__ ((noipa))
47 short_msums_signed (vector short ss_src_a, vector short ss_src_b,
48 vector int si_src_c)
50 return vec_msums (ss_src_a, ss_src_b, si_src_c);
53 vector double __attribute__ ((noipa))
54 double_sel_test (vector double d_src_a, vector double d_src_b,
55 vector unsigned long long ull_src_c)
57 return vec_sel (d_src_a, d_src_b, ull_src_c);
60 vector double __attribute__ ((noipa))
61 bool_sel_test (vector double d_src_a, vector double d_src_b,
62 vector bool long long bll_src_c)
64 return vec_sel (d_src_a, d_src_b, bll_src_c);
67 vector double __attribute__ ((noipa))
68 double_permute_test (vector double d_src_a, vector double d_src_b,
69 vector unsigned char uc_src_c)
71 return vec_perm (d_src_a, d_src_b, uc_src_c);