aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c
blob: 6772cad0300e8cb482bf7dc1194dbdeb513fd639 (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
/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int
   inputs produce the right code.  */

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

#include <altivec.h>

vector bool int
testbi_el (vector bool short vbs2)
{
  return vec_unpackl (vbs2);
}

vector signed int
testsi_el (vector signed short vss2)
{
  return vec_unpackl (vss2);
}

vector bool int
testbi_eh (vector bool short vbs2)
{
  return vec_unpackh (vbs2);
}

vector signed int
testsi_eh (vector signed short vss2)
{
  return vec_unpackh (vss2);
}

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