summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c
blob: 940faf36755d89a966f03f5056cc77cab54c60a5 (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
/* Verify that overloaded built-ins for vec_pack with int
   inputs produce the right results.  */

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

#include <altivec.h>

vector bool short
testbi_h (vector bool int vbi2, vector bool int vbi3)
{
  return vec_pack (vbi2, vbi3);
}

vector signed short
testsi_h (vector signed int vsi2, vector signed int vsi3)
{
  return vec_pack (vsi2, vsi3);
}

vector unsigned short
testui_h (vector unsigned int vui2, vector unsigned int vui3)
{
  return vec_pack (vui2, vui3);
}

/* { dg-final { scan-assembler-times "vpkuwum" 3 } } */