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. */
10 static int a
[1024], b
[1024], c
[1024];
12 int *p_a
= a
, *p_b
= b
, *p_c
= c
;
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} } } */