[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-splat-longlong.c
blob3fa1f05d6f582f5dc8cb965ed1d536af7d2293fd
1 /* Verify that overloaded built-ins for vec_splat with long long
2 inputs produce the right code. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_vsx_ok } */
6 /* { dg-options "-mvsx -O2" } */
8 #include <altivec.h>
10 vector bool long long testb_00 (vector bool long long x) { return vec_splat (x, 0b00000); }
11 vector bool long long testb_01 (vector bool long long x) { return vec_splat (x, 0b00001); }
13 vector signed long long tests_00 (vector signed long long x) { return vec_splat (x, 0b00000); }
14 vector signed long long tests_01 (vector signed long long x) { return vec_splat (x, 0b00001); }
16 vector unsigned long long testu_00 (vector unsigned long long x) { return vec_splat (x, 0b00000); }
17 vector unsigned long long testu_01 (vector unsigned long long x) { return vec_splat (x, 0b00001); }
19 /* Similar test as above, but the source vector is a known constant. */
20 vector bool long long test_bll () { const vector bool long long y = {12, 23}; return vec_splat (y, 0b00001); }
21 vector signed long long test_sll () { const vector signed long long y = {34, 45}; return vec_splat (y, 0b00001); }
23 /* Assorted load instructions for the initialization with known constants. */
24 /* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxv\M|\mplxv\M|\mxxspltib\M} 2 } } */
26 /* xxpermdi for vec_splat of long long vectors.
27 At the time of this writing, the number of xxpermdi instructions
28 generated will vary depending on the target processor (p5/p6/p7/p8/...)
29 and whether or not folding is enabled.
30 So, ensure we have at least one hit. */
31 /* { dg-final { scan-assembler "xxpermdi" } } */