aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-sub-short.c
blob: 6768ffc1822c4930d739d87c833f0091c2b12958 (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
47
/* Verify that overloaded built-ins for vec_sub with short
   inputs produce the right results.  */

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

#include <altivec.h>

vector signed short
test1 (vector bool short x, vector signed short y)
{
  return vec_sub (x, y);
}

vector signed short
test2 (vector signed short x, vector bool short y)
{
  return vec_sub (x, y);
}

vector signed short
test3 (vector signed short x, vector signed short y)
{
  return vec_sub (x, y);
}

vector unsigned short
test4 (vector bool short x, vector unsigned short y)
{
  return vec_sub (x, y);
}

vector unsigned short
test5 (vector unsigned short x, vector bool short y)
{
  return vec_sub (x, y);
}

vector unsigned short
test6 (vector unsigned short x, vector unsigned short y)
{
  return vec_sub (x, y);
}

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