[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr66144-3.c
blob46bf2e3fc8dc1af3e0496fe1f96546cd69941ff0
1 /* { dg-do compile { target { powerpc64*-*-* } } } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2 -ftree-vectorize" } */
5 /* Verify that we can optimize a vector conditional move, where one of the arms
6 is all 1's into using the mask as one of the inputs to XXSEL. */
8 #include <altivec.h>
10 static int a[1024], b[1024], c[1024];
12 int *p_a = a, *p_b = b, *p_c = c;
14 void
15 test (void)
17 unsigned long i;
19 for (i = 0; i < 1024; i++)
20 a[i] = (b[i] == c[i]) ? -1 : a[i];
23 /* { dg-final { scan-assembler {\mvcmpequw\M} } } */
24 /* { dg-final { scan-assembler {\mxxsel\M} } } */
25 /* { dg-final { scan-assembler-not {\mvspltisw\M} } } */
26 /* { dg-final { scan-assembler-not {\mxxlorc\M} } } */