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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
/* { dg-do compile } */
/* { dg-options "-maltivec" } */
/* { dg-require-effective-target powerpc_altivec } */
#include <altivec.h>
vector bool char
test_eq_char (vector bool char x, vector bool char y)
{
return vec_cmpeq (x, y);
}
vector bool short
test_eq_short (vector bool short x, vector bool short y)
{
return vec_cmpeq (x, y);
}
vector bool int
test_eq_int (vector bool int x, vector bool int y)
{
return vec_cmpeq (x, y);
}
vector signed char
test_nabs_char (vector signed char x)
{
return vec_nabs (x);
}
vector short
test_nabs_short (vector short x)
{
return vec_nabs (x);
}
vector int
test_nabs_int (vector int x)
{
return vec_nabs (x);
}
vector signed char
test_sll_vsc_vsc_vsuc (vector signed char x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector unsigned char
test_sll_vuc_vuc_vuc (vector unsigned char x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector signed int
test_sll_vsi_vsi_vuc (vector signed int x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector unsigned int
test_sll_vui_vui_vuc (vector unsigned int x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector pixel
test_sll_vp_vp_vuc (vector pixel x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector signed short int
test_sll_vssi_vssi_vuc (vector signed short x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector unsigned short int
test_sll_vusi_vusi_vuc (vector unsigned short x, vector unsigned char y)
{
return vec_sll (x, y);
}
vector signed char
test_slo_vsc_vsc_vsc (vector signed char x, vector signed char y)
{
return vec_slo (x, y);
}
vector signed char
test_slo_vsc_vsc_vuc (vector signed char x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector unsigned char
test_slo_vuc_vuc_vsc (vector unsigned char x, vector signed char y)
{
return vec_slo (x, y);
}
vector unsigned char
test_slo_vuc_vuc_vuc (vector unsigned char x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector signed int
test_slo_vsi_vsi_vsc (vector signed int x, vector signed char y)
{
return vec_slo (x, y);
}
vector signed int
test_slo_vsi_vsi_vuc (vector signed int x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector unsigned int
test_slo_vui_vui_vsc (vector unsigned int x, vector signed char y)
{
return vec_slo (x, y);
}
vector unsigned int
test_slo_vui_vui_vuc (vector unsigned int x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector pixel
test_slo_vp_vp_vsc (vector pixel int x, vector signed char y)
{
return vec_slo (x, y);
}
vector pixel
test_slo_vp_vp_vuc (vector pixel int x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector signed short int
test_slo_vssi_vssi_vsc (vector signed short int x, vector signed char y)
{
return vec_slo (x, y);
}
vector signed short int
test_slo_vssi_vssi_vuc (vector signed short int x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector unsigned short int
test_slo_vusi_vusi_vsc (vector unsigned short int x, vector signed char y)
{
return vec_slo (x, y);
}
vector unsigned short int
test_slo_vusi_vusi_vuc (vector unsigned short int x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector float
test_slo_vf_vf_vsc (vector float x, vector signed char y)
{
return vec_slo (x, y);
}
vector float
test_slo_vf_vf_vuc (vector float x, vector unsigned char y)
{
return vec_slo (x, y);
}
vector int
test_cmpb_float (vector float x, vector float y)
{
return vec_cmpb (x, y);
}
/* Expected test results:
test_eq_char 1 vcmpequb inst
test_eq_short 1 vcmpequh inst
test_eq_int 1 vcmpequw inst
test_nabs_char 1 vsububm, 1 vminsb
test_nabs_short 1 vsubuhm, 1 vminsh
test_nabs_int 1 vsubuwm, 1 vminsw
test_sll_vsc_vsc_vsuc 1 vsl
test_sll_vuc_vuc_vuc 1 vsl
test_sll_vsi_vsi_vuc 1 vsl
test_sll_vui_vui_vuc 1 vsl
test_sll_vp_vp_vuc 1 vsl
test_sll_vssi_vssi_vuc 1 vsl
test_sll_vusi_vusi_vuc 1 vsl
test_slo_vsc_vsc_vsc 1 vslo
test_slo_vsc_vsc_vuc 1 vslo
test_slo_vuc_vuc_vsc 1 vslo
test_slo_vuc_vuc_vuc 1 vslo
test_slo_vsi_vsi_vsc 1 vslo
test_slo_vsi_vsi_vuc 1 vslo
test_slo_vui_vui_vsc 1 vslo
test_slo_vui_vui_vuc 1 vslo
test_slo_vp_vp_vsc 1 vslo
test_slo_vp_vp_vuc 1 vslo
test_slo_vssi_vssi_vsc 1 vslo
test_slo_vssi_vssi_vuc 1 vslo
test_slo_vusi_vusi_vsc 1 vslo
test_slo_vusi_vusi_vuc 1 vslo
test_slo_vf_vf_vsc 1 vslo
test_slo_vf_vf_vuc 1 vslo
test_cmpb_float 1 vcmpbfp */
/* { dg-final { scan-assembler-times "vcmpequb" 1 } } */
/* { dg-final { scan-assembler-times "vcmpequh" 1 } } */
/* { dg-final { scan-assembler-times "vcmpequw" 1 } } */
/* { dg-final { scan-assembler-times "vsububm" 1 } } */
/* { dg-final { scan-assembler-times "vsubuhm" 1 } } */
/* { dg-final { scan-assembler-times "vsubuwm" 1 } } */
/* { dg-final { scan-assembler-times "vminsb" 1 } } */
/* { dg-final { scan-assembler-times "vminsh" 1 } } */
/* { dg-final { scan-assembler-times "vminsw" 1 } } */
/* { dg-final { scan-assembler-times "vslo" 16 } } */
/* { dg-final { scan-assembler-times "vcmpbfp" 1 } } */
/* { dg-final { scan-assembler-times "vsl" 23 } } */
|