aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-splats-short.c
blob: 2ffc80a6b8799790b120aa80a1951727e96a14d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Verify that overloaded built-ins for vec_splat with short
   inputs produce the right code.  */

/* { dg-do compile } */
/* { dg-options "-maltivec -O2" } */
/* { dg-require-effective-target powerpc_altivec } */

#include <altivec.h>

vector signed short
test3s (signed short x)
{
  return vec_splats (x);
}

vector unsigned short
test3u (unsigned short x)
{
  return vec_splats (x);
}

/* { dg-final { scan-assembler-times "vsplth" 2 } } */