aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/fold-vec-ld-short.c
blob: d99375736c67b13df68acf40f9f62792342bb7c6 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* Verify that overloaded built-ins for vec_ld* with short
   inputs produce the right code.  */

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

#include <altivec.h>

vector signed short
testld_vss_vss (long long ll1, vector signed short vss2)
{
  return vec_ld (ll1, &vss2);
}

vector signed short
testld_vss_ss (long long ll1, signed short ss)
{
  return vec_ld (ll1, &ss);
}

vector unsigned short
testld_vus_vus (long long ll1, vector unsigned short vus2)
{
  return vec_ld (ll1, &vus2);
}

vector unsigned short
testld_vus_us (long long ll1, unsigned short us)
{
  return vec_ld (ll1, &us);
}

vector bool short
testld_vbs_vbs (long long ll1, vector bool short vbs2)
{
  return vec_ld (ll1, &vbs2);
}

vector signed short
testld_cst_vss (vector signed short vss2)
{
  return vec_ld (16, &vss2);
}

vector signed short
testld_cst_ss (signed short ss)
{
  return vec_ld (32, &ss);
}

vector unsigned short
testld_cst_vus (vector unsigned short vus2)
{
  return vec_ld (48, &vus2);
}

vector unsigned short
testld_cst_us (unsigned short us)
{
  return vec_ld (64, &us);
}

vector bool short
testld_cst_vbs (vector bool short vbs2)
{
  return vec_ld (80, &vbs2);
}

/* { dg-final { scan-assembler-times {\mlvx\M|\mlxvd2x\M|\mlxvw4x\M|\mlxv\M} 10 } } */