[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-logical-ors-short.c
blob8352a7f4dc59e6ffe7872dd9af45f63eff95b7ac
1 /* Verify that overloaded built-ins for vec_or, vec_xor, vec_nor with short
2 inputs produce the right results. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_vsx_ok } */
6 /* { dg-options "-mvsx -O1" } */
8 #include <altivec.h>
10 vector signed short
11 test1_or (vector bool short x, vector signed short y)
13 vector signed short *foo;
14 *foo += vec_or (x, y);
15 return *foo;
18 vector signed short
19 test1_xor (vector bool short x, vector signed short y)
21 vector signed short *foo;
22 *foo += vec_xor (x, y);
23 return *foo;
26 vector signed short
27 test2_or (vector signed short x, vector bool short y)
29 vector signed short *foo;
30 *foo += vec_or (x, y);
31 return *foo;
34 vector signed short
35 test2_xor (vector signed short x, vector bool short y)
37 vector signed short *foo;
38 *foo += vec_xor (x, y);
39 return *foo;
42 vector signed short
43 test3_or (vector signed short x, vector signed short y)
45 vector signed short *foo;
46 *foo += vec_or (x, y);
47 return *foo;
50 vector signed short
51 test3_xor (vector signed short x, vector signed short y)
53 vector signed short *foo;
54 *foo += vec_xor (x, y);
55 return *foo;
58 vector signed short
59 test3_nor (vector signed short x, vector signed short y)
61 vector signed short *foo;
62 *foo += vec_nor (x, y);
63 return *foo;
66 vector unsigned short
67 test4_or (vector bool short x, vector unsigned short y)
69 vector unsigned short *foo;
70 *foo += vec_or (x, y);
71 return *foo;
74 vector unsigned short
75 test4_xor (vector bool short x, vector unsigned short y)
77 vector unsigned short *foo;
78 *foo += vec_xor (x, y);
79 return *foo;
82 vector unsigned short
83 test5_or (vector unsigned short x, vector bool short y)
85 vector unsigned short *foo;
86 *foo += vec_or (x, y);
87 return *foo;
90 vector unsigned short
91 test5_xor (vector unsigned short x, vector bool short y)
93 vector unsigned short *foo;
94 *foo += vec_xor (x, y);
95 return *foo;
98 vector unsigned short
99 test6_or (vector unsigned short x, vector unsigned short y)
101 vector unsigned short *foo;
102 *foo += vec_or (x, y);
103 return *foo;
106 vector unsigned short
107 test6_xor (vector unsigned short x, vector unsigned short y)
109 vector unsigned short *foo;
110 *foo += vec_xor (x, y);
111 return *foo;
114 vector unsigned short
115 test6_nor (vector unsigned short x, vector unsigned short y)
117 vector unsigned short *foo;
118 *foo += vec_nor (x, y);
119 return *foo;
122 /* { dg-final { scan-assembler-times {\mxxlor\M} 6 } } */
123 /* { dg-final { scan-assembler-times {\mxxlxor\M} 6 } } */
124 /* { dg-final { scan-assembler-times {\mxxlnor\M} 2 } } */