Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/vec-cmp-sel.c

raw
1 /* { dg-do compile { target powerpc64*-*-* } } */
2 /* { dg-options "-maltivec -O2 -mvsx" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target powerpc_vsx } */
5 /* { dg-require-effective-target powerpc_vsx } */
6 /* { dg-final { scan-assembler "vcmpgtsd" } } */
7 /* { dg-final { scan-assembler-not "xxlnor" } } */
8
9 /* Test code in simplify-rtx.c that converts
10 (!c) != {0,...,0} ? a : b
11 into
12 c != {0,...,0} ? b : a */
13
14 #include <altivec.h>
15
16 volatile vector signed long long x = { 25399, -12900 };
17 volatile vector signed long long y = { 12178, -9987 };
18
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;
23 }