aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-select-char.c
blob: 17e28914aae4489c03d3e9cd4b1b268f6b342ff0 (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
/* Verify that overloaded built-ins for vec_sel with char
   inputs produce the right code.  */

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

#include <altivec.h>

vector bool char
test1_0 (vector bool char x, vector bool char y, vector bool char z)
{
  return vec_sel (x, y, z);
}

vector bool char
test1_1 (vector bool char x,vector bool char y, vector unsigned char z)
{
  return vec_sel (x, y, z);
}

vector signed char
test3_0 (vector signed char x,vector signed char y, vector bool char  z)
{
  return vec_sel (x, y, z);
}

vector signed char
test3_1 (vector signed char x,vector signed char  y, vector unsigned char z)
{
  return vec_sel (x, y, z);
}

vector unsigned char
test6_0 (vector unsigned char x,vector unsigned char  y,vector bool char  z)
{
  return vec_sel (x, y, z);
}

vector unsigned char
test6_1 (vector unsigned char x,vector unsigned char  y, vector unsigned char z)
{
  return vec_sel (x, y, z);
}

/* { dg-final { scan-assembler-times {\mxxsel\M|\mvsel\M} 6 } } */