aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-splat-16.c
blob: 345e96caaf1c016521a64162148c9c30e30c90dc (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* Verify that overloaded built-ins for vec_splat with int
   inputs produce the right code.  */

/* { dg-do compile } */
/* { dg-options "-mvsx -O2" } */
/* { dg-require-effective-target powerpc_vsx } */

#include <altivec.h>

vector signed short
testss_1 ()
{
  return vec_splat_s16 (5);
}

vector signed short
testss_2 ()
{
  return vec_splat_s16 (-5);
}

vector signed short
testss_3 ()
{
  return vec_splat_s16 (15);
}

vector unsigned short
testus_1 ()
{
  return vec_splat_u16 (5);
}

vector unsigned short
testus_2 ()
{
  return vec_splat_u16 (-5);
}

vector unsigned short
testus_3 ()
{
  return vec_splat_u16 (15);
}

/* { dg-final { scan-assembler-times "vspltish" 6 } } */