aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-mule-char.c
blob: 1aaf2e77b726b62ec04afada68f19aaacc04be35 (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
/* Verify that overloaded built-ins for vec_mule,vec_mulo with char
   inputs produce the right results.  */

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

#include <altivec.h>

vector signed short
test_even (vector signed char x, vector signed char y)
{
  return vec_mule (x, y);
}

vector unsigned short
test_uns_even (vector unsigned char x, vector unsigned char y)
{
  return vec_mule (x, y);
}

vector signed short
test_odd (vector signed char x, vector signed char y)
{
  return vec_mulo (x, y);
}

vector unsigned short
test_uns_odd (vector unsigned char x, vector unsigned char y)
{
  return vec_mulo (x, y);
}

/* { dg-final { scan-assembler-times "vmuleub" 1 } } */
/* { dg-final { scan-assembler-times "vmulesb" 1 } } */
/* { dg-final { scan-assembler-times "vmuloub" 1 } } */
/* { dg-final { scan-assembler-times "vmulosb" 1 } } */