[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / vec-cmp-sel.c
blobef000c1cf10ffc4e5687c57d6b82f18100473fc5
1 /* { dg-do compile { target powerpc64*-*-* } } */
2 /* { dg-require-effective-target powerpc_vsx_ok } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-maltivec -O2 -mvsx" } */
5 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
6 /* { dg-final { scan-assembler "vcmpgtsd" } } */
7 /* { dg-final { scan-assembler-not "xxlnor" } } */
9 /* Test code in simplify-rtx.c that converts
10 (!c) != {0,...,0} ? a : b
11 into
12 c != {0,...,0} ? b : a */
14 #include <altivec.h>
16 volatile vector signed long long x = { 25399, -12900 };
17 volatile vector signed long long y = { 12178, -9987 };
19 vector signed long long foo () {
20 vector bool long long b = vec_cmpge (x, y);
21 vector signed long long z = vec_sel (y, x, b);
22 return z;