aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr86731-longlong.c
blob: c97cb49de8cfe42977a8be0602c8a2dce84150c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* PR86731.  Verify that the rs6000 gimple-folding code handles the
   left shift properly.  */

/* { dg-do compile } */
/* { dg-options "-maltivec -O3 -mvsx " } */
/* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
/* { dg-require-effective-target powerpc_vsx } */
/* { dg-require-effective-target lp64 } */

#include <altivec.h>

vector unsigned long long splatu4(void)
{
        vector unsigned long long mzero = {-1,-1};
        return (vector unsigned long long) vec_sl(mzero, mzero);
}
vector signed long long splats4(void)
{
        vector unsigned long long mzero = {-1,-1};
        return (vector signed long long) vec_sl(mzero, mzero);
}

/* Codegen will consist of splat and shift instructions for most types.
   Noted variations:  if gimple folding is disabled, or if -fwrapv is not
   specified, the long long tests will generate a vspltisw+vsld pair,
   versus generating a single lvx.  */
/* { dg-final { scan-assembler-times {\mvspltis[bhw]\M|\mxxspltib\M} 2 } } */
/* { dg-final { scan-assembler-times {\mvsl[bhwd]\M} 2 } } */
/* { dg-final { scan-assembler-times {\mlvx\M} 0 } } */