1 /* PR86731.  Verify that the rs6000 gimple-folding code handles the
2    left shift operation properly.  This is a testcase variation that
3    explicitly disables gimple folding.  */
4 
5 /* { dg-do compile } */
6 /* { dg-require-effective-target powerpc_p8vector_ok } */
7 /* { dg-require-effective-target lp64 } */
8 /* { dg-options "-maltivec -O3 -fwrapv -mno-fold-gimple -mpower8-vector " } */
9 /* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */
10 
11 
12 #include <altivec.h>
13 
splatu4(void)14 vector unsigned long long splatu4(void)
15 {
16         vector unsigned long long mzero = {-1,-1};
17         return (vector unsigned long long) vec_sl(mzero, mzero);
18 }
19 
splats4(void)20 vector signed long long splats4(void)
21 {
22         vector unsigned long long mzero = {-1,-1};
23         return (vector signed long long) vec_sl(mzero, mzero);
24 }
25 
26 /* Codegen will consist of splat and shift instructions for most types.
27    Noted variations:  if gimple folding is disabled, or if -fwrapv is not specified, the
28    long long tests will generate a vspltisw+vsld pair, versus generating a lvx.  */
29 /* { dg-final { scan-assembler-times {\mvspltis[bhw]\M|\mxxspltib\M} 2 } } */
30 /* { dg-final { scan-assembler-times {\mvsl[bhwd]\M} 2 } } */
31 /* { dg-final { scan-assembler-times {\mlvx\M} 0 } } */
32 
33