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

/* { dg-do compile } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-options "-mpower8-vector -O2" } */

#include <altivec.h>

vector bool long long
testbi_l (vector bool int vbi2)
{
  return vec_unpackl (vbi2);
}

vector signed long long
testsi_l (vector signed int vsi2)
{
  return vec_unpackl (vsi2);
}

vector bool long long
testbi_h (vector bool int vbi2)
{
  return vec_unpackh (vbi2);
}

vector signed long long
testsi_h (vector signed int vsi2)
{
  return vec_unpackh (vsi2);
}

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