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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec" } */
/* Basic test for the new VMX intrinsics. */
#include <altivec.h>
int f(vector int a, int b)
{
return vec_extract (a, b);
}
short f1(vector short a, int b)
{
return vec_extract (a, b);
}
vector short f2(vector short a, int b)
{
return vec_insert (b, a, b);
}
vector float f3(vector float a, int b)
{
return vec_insert (b, a, b);
}
float g(void);
vector float f4(float b, int t)
{
return vec_promote (g(), t);
}
vector float f5(float b)
{
return vec_splats (g());
}
template <int>
int tf(vector int a, int b)
{
return vec_extract (a, b);
}
template <int>
short tf1(vector short a, int b)
{
return vec_extract (a, b);
}
template <int>
vector short tf2(vector short a, int b)
{
return vec_insert (b, a, b);
}
template <int>
vector float tf3(vector float a, int b)
{
return vec_insert (b, a, b);
}
template <int>
vector float tf4(float b, int t)
{
return vec_promote (g(), t);
}
template <int>
vector float tf5(float b)
{
return vec_splats (g());
}
int t(vector int a, int b)
{
return tf<1>(a, b);
}
short t1(vector short a, int b)
{
return tf1<1>(a, b);
}
vector short t2(vector short a, int b)
{
return tf2<1>(a, b);
}
vector float t3(vector float a, int b)
{
return tf3<1>(a, b);
}
vector float t4(float b, int t)
{
return tf4<1>(b, t);
}
vector float t5(float b)
{
return tf5<1>(b);
}
|