1 |
691 |
jeremybenn |
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
|
2 |
|
|
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
|
3 |
|
|
/* { dg-require-effective-target powerpc_vsx_ok } */
|
4 |
|
|
/* { dg-options "-O2 -mcpu=power7" } */
|
5 |
|
|
/* { dg-final { scan-assembler "xxsel" } } */
|
6 |
|
|
/* { dg-final { scan-assembler "vperm" } } */
|
7 |
|
|
/* { dg-final { scan-assembler "xvrdpi" } } */
|
8 |
|
|
/* { dg-final { scan-assembler "xvrdpic" } } */
|
9 |
|
|
/* { dg-final { scan-assembler "xvrdpim" } } */
|
10 |
|
|
/* { dg-final { scan-assembler "xvrdpip" } } */
|
11 |
|
|
/* { dg-final { scan-assembler "xvrdpiz" } } */
|
12 |
|
|
/* { dg-final { scan-assembler "xvrspi" } } */
|
13 |
|
|
/* { dg-final { scan-assembler "xvrspic" } } */
|
14 |
|
|
/* { dg-final { scan-assembler "xvrspim" } } */
|
15 |
|
|
/* { dg-final { scan-assembler "xvrspip" } } */
|
16 |
|
|
/* { dg-final { scan-assembler "xvrspiz" } } */
|
17 |
|
|
/* { dg-final { scan-assembler "xsrdpi" } } */
|
18 |
|
|
/* { dg-final { scan-assembler "xsrdpic" } } */
|
19 |
|
|
/* { dg-final { scan-assembler "xsrdpim" } } */
|
20 |
|
|
/* { dg-final { scan-assembler "xsrdpip" } } */
|
21 |
|
|
/* { dg-final { scan-assembler "xsrdpiz" } } */
|
22 |
|
|
/* { dg-final { scan-assembler "xsmaxdp" } } */
|
23 |
|
|
/* { dg-final { scan-assembler "xsmindp" } } */
|
24 |
|
|
/* { dg-final { scan-assembler "xxland" } } */
|
25 |
|
|
/* { dg-final { scan-assembler "xxlandc" } } */
|
26 |
|
|
/* { dg-final { scan-assembler "xxlnor" } } */
|
27 |
|
|
/* { dg-final { scan-assembler "xxlor" } } */
|
28 |
|
|
/* { dg-final { scan-assembler "xxlxor" } } */
|
29 |
|
|
/* { dg-final { scan-assembler "xvcmpeqdp" } } */
|
30 |
|
|
/* { dg-final { scan-assembler "xvcmpgtdp" } } */
|
31 |
|
|
/* { dg-final { scan-assembler "xvcmpgedp" } } */
|
32 |
|
|
/* { dg-final { scan-assembler "xvcmpeqsp" } } */
|
33 |
|
|
/* { dg-final { scan-assembler "xvcmpgtsp" } } */
|
34 |
|
|
/* { dg-final { scan-assembler "xvcmpgesp" } } */
|
35 |
|
|
/* { dg-final { scan-assembler "xxsldwi" } } */
|
36 |
|
|
/* { dg-final { scan-assembler-not "call" } } */
|
37 |
|
|
|
38 |
|
|
extern __vector int si[][4];
|
39 |
|
|
extern __vector short ss[][4];
|
40 |
|
|
extern __vector signed char sc[][4];
|
41 |
|
|
extern __vector float f[][4];
|
42 |
|
|
extern __vector unsigned int ui[][4];
|
43 |
|
|
extern __vector unsigned short us[][4];
|
44 |
|
|
extern __vector unsigned char uc[][4];
|
45 |
|
|
extern __vector __bool int bi[][4];
|
46 |
|
|
extern __vector __bool short bs[][4];
|
47 |
|
|
extern __vector __bool char bc[][4];
|
48 |
|
|
extern __vector __pixel p[][4];
|
49 |
|
|
#ifdef __VSX__
|
50 |
|
|
extern __vector double d[][4];
|
51 |
|
|
extern __vector long sl[][4];
|
52 |
|
|
extern __vector unsigned long ul[][4];
|
53 |
|
|
extern __vector __bool long bl[][4];
|
54 |
|
|
#endif
|
55 |
|
|
|
56 |
|
|
int do_sel(void)
|
57 |
|
|
{
|
58 |
|
|
int i = 0;
|
59 |
|
|
|
60 |
|
|
si[i][0] = __builtin_vsx_xxsel_4si (si[i][1], si[i][2], si[i][3]); i++;
|
61 |
|
|
ss[i][0] = __builtin_vsx_xxsel_8hi (ss[i][1], ss[i][2], ss[i][3]); i++;
|
62 |
|
|
sc[i][0] = __builtin_vsx_xxsel_16qi (sc[i][1], sc[i][2], sc[i][3]); i++;
|
63 |
|
|
f[i][0] = __builtin_vsx_xxsel_4sf (f[i][1], f[i][2], f[i][3]); i++;
|
64 |
|
|
d[i][0] = __builtin_vsx_xxsel_2df (d[i][1], d[i][2], d[i][3]); i++;
|
65 |
|
|
|
66 |
|
|
si[i][0] = __builtin_vsx_xxsel (si[i][1], si[i][2], bi[i][3]); i++;
|
67 |
|
|
ss[i][0] = __builtin_vsx_xxsel (ss[i][1], ss[i][2], bs[i][3]); i++;
|
68 |
|
|
sc[i][0] = __builtin_vsx_xxsel (sc[i][1], sc[i][2], bc[i][3]); i++;
|
69 |
|
|
f[i][0] = __builtin_vsx_xxsel (f[i][1], f[i][2], bi[i][3]); i++;
|
70 |
|
|
d[i][0] = __builtin_vsx_xxsel (d[i][1], d[i][2], bl[i][3]); i++;
|
71 |
|
|
|
72 |
|
|
si[i][0] = __builtin_vsx_xxsel (si[i][1], si[i][2], ui[i][3]); i++;
|
73 |
|
|
ss[i][0] = __builtin_vsx_xxsel (ss[i][1], ss[i][2], us[i][3]); i++;
|
74 |
|
|
sc[i][0] = __builtin_vsx_xxsel (sc[i][1], sc[i][2], uc[i][3]); i++;
|
75 |
|
|
f[i][0] = __builtin_vsx_xxsel (f[i][1], f[i][2], ui[i][3]); i++;
|
76 |
|
|
d[i][0] = __builtin_vsx_xxsel (d[i][1], d[i][2], ul[i][3]); i++;
|
77 |
|
|
|
78 |
|
|
return i;
|
79 |
|
|
}
|
80 |
|
|
|
81 |
|
|
int do_perm(void)
|
82 |
|
|
{
|
83 |
|
|
int i = 0;
|
84 |
|
|
|
85 |
|
|
si[i][0] = __builtin_vsx_vperm_4si (si[i][1], si[i][2], uc[i][3]); i++;
|
86 |
|
|
ss[i][0] = __builtin_vsx_vperm_8hi (ss[i][1], ss[i][2], uc[i][3]); i++;
|
87 |
|
|
sc[i][0] = __builtin_vsx_vperm_16qi (sc[i][1], sc[i][2], uc[i][3]); i++;
|
88 |
|
|
f[i][0] = __builtin_vsx_vperm_4sf (f[i][1], f[i][2], uc[i][3]); i++;
|
89 |
|
|
d[i][0] = __builtin_vsx_vperm_2df (d[i][1], d[i][2], uc[i][3]); i++;
|
90 |
|
|
|
91 |
|
|
si[i][0] = __builtin_vsx_vperm (si[i][1], si[i][2], uc[i][3]); i++;
|
92 |
|
|
ss[i][0] = __builtin_vsx_vperm (ss[i][1], ss[i][2], uc[i][3]); i++;
|
93 |
|
|
sc[i][0] = __builtin_vsx_vperm (sc[i][1], sc[i][2], uc[i][3]); i++;
|
94 |
|
|
f[i][0] = __builtin_vsx_vperm (f[i][1], f[i][2], uc[i][3]); i++;
|
95 |
|
|
d[i][0] = __builtin_vsx_vperm (d[i][1], d[i][2], uc[i][3]); i++;
|
96 |
|
|
|
97 |
|
|
return i;
|
98 |
|
|
}
|
99 |
|
|
|
100 |
|
|
int do_xxperm (void)
|
101 |
|
|
{
|
102 |
|
|
int i = 0;
|
103 |
|
|
|
104 |
|
|
d[i][0] = __builtin_vsx_xxpermdi_2df (d[i][1], d[i][2], 0); i++;
|
105 |
|
|
d[i][0] = __builtin_vsx_xxpermdi (d[i][1], d[i][2], 1); i++;
|
106 |
|
|
return i;
|
107 |
|
|
}
|
108 |
|
|
|
109 |
|
|
double x, y;
|
110 |
|
|
void do_concat (void)
|
111 |
|
|
{
|
112 |
|
|
d[0][0] = __builtin_vsx_concat_2df (x, y);
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
void do_set (void)
|
116 |
|
|
{
|
117 |
|
|
d[0][0] = __builtin_vsx_set_2df (d[0][1], x, 0);
|
118 |
|
|
d[1][0] = __builtin_vsx_set_2df (d[1][1], y, 1);
|
119 |
|
|
}
|
120 |
|
|
|
121 |
|
|
extern double z[][4];
|
122 |
|
|
|
123 |
|
|
int do_math (void)
|
124 |
|
|
{
|
125 |
|
|
int i = 0;
|
126 |
|
|
|
127 |
|
|
d[i][0] = __builtin_vsx_xvrdpi (d[i][1]); i++;
|
128 |
|
|
d[i][0] = __builtin_vsx_xvrdpic (d[i][1]); i++;
|
129 |
|
|
d[i][0] = __builtin_vsx_xvrdpim (d[i][1]); i++;
|
130 |
|
|
d[i][0] = __builtin_vsx_xvrdpip (d[i][1]); i++;
|
131 |
|
|
d[i][0] = __builtin_vsx_xvrdpiz (d[i][1]); i++;
|
132 |
|
|
|
133 |
|
|
f[i][0] = __builtin_vsx_xvrspi (f[i][1]); i++;
|
134 |
|
|
f[i][0] = __builtin_vsx_xvrspic (f[i][1]); i++;
|
135 |
|
|
f[i][0] = __builtin_vsx_xvrspim (f[i][1]); i++;
|
136 |
|
|
f[i][0] = __builtin_vsx_xvrspip (f[i][1]); i++;
|
137 |
|
|
f[i][0] = __builtin_vsx_xvrspiz (f[i][1]); i++;
|
138 |
|
|
|
139 |
|
|
z[i][0] = __builtin_vsx_xsrdpi (z[i][1]); i++;
|
140 |
|
|
z[i][0] = __builtin_vsx_xsrdpic (z[i][1]); i++;
|
141 |
|
|
z[i][0] = __builtin_vsx_xsrdpim (z[i][1]); i++;
|
142 |
|
|
z[i][0] = __builtin_vsx_xsrdpip (z[i][1]); i++;
|
143 |
|
|
z[i][0] = __builtin_vsx_xsrdpiz (z[i][1]); i++;
|
144 |
|
|
z[i][0] = __builtin_vsx_xsmaxdp (z[i][1], z[i][0]); i++;
|
145 |
|
|
z[i][0] = __builtin_vsx_xsmindp (z[i][1], z[i][0]); i++;
|
146 |
|
|
return i;
|
147 |
|
|
}
|
148 |
|
|
|
149 |
|
|
int do_cmp (void)
|
150 |
|
|
{
|
151 |
|
|
int i = 0;
|
152 |
|
|
|
153 |
|
|
d[i][0] = __builtin_vsx_xvcmpeqdp (d[i][1], d[i][2]); i++;
|
154 |
|
|
d[i][0] = __builtin_vsx_xvcmpgtdp (d[i][1], d[i][2]); i++;
|
155 |
|
|
d[i][0] = __builtin_vsx_xvcmpgedp (d[i][1], d[i][2]); i++;
|
156 |
|
|
|
157 |
|
|
f[i][0] = __builtin_vsx_xvcmpeqsp (f[i][1], f[i][2]); i++;
|
158 |
|
|
f[i][0] = __builtin_vsx_xvcmpgtsp (f[i][1], f[i][2]); i++;
|
159 |
|
|
f[i][0] = __builtin_vsx_xvcmpgesp (f[i][1], f[i][2]); i++;
|
160 |
|
|
return i;
|
161 |
|
|
}
|
162 |
|
|
|
163 |
|
|
int do_logical (void)
|
164 |
|
|
{
|
165 |
|
|
int i = 0;
|
166 |
|
|
|
167 |
|
|
si[i][0] = __builtin_vsx_xxland (si[i][1], si[i][2]); i++;
|
168 |
|
|
si[i][0] = __builtin_vsx_xxlandc (si[i][1], si[i][2]); i++;
|
169 |
|
|
si[i][0] = __builtin_vsx_xxlnor (si[i][1], si[i][2]); i++;
|
170 |
|
|
si[i][0] = __builtin_vsx_xxlor (si[i][1], si[i][2]); i++;
|
171 |
|
|
si[i][0] = __builtin_vsx_xxlxor (si[i][1], si[i][2]); i++;
|
172 |
|
|
|
173 |
|
|
ss[i][0] = __builtin_vsx_xxland (ss[i][1], ss[i][2]); i++;
|
174 |
|
|
ss[i][0] = __builtin_vsx_xxlandc (ss[i][1], ss[i][2]); i++;
|
175 |
|
|
ss[i][0] = __builtin_vsx_xxlnor (ss[i][1], ss[i][2]); i++;
|
176 |
|
|
ss[i][0] = __builtin_vsx_xxlor (ss[i][1], ss[i][2]); i++;
|
177 |
|
|
ss[i][0] = __builtin_vsx_xxlxor (ss[i][1], ss[i][2]); i++;
|
178 |
|
|
|
179 |
|
|
sc[i][0] = __builtin_vsx_xxland (sc[i][1], sc[i][2]); i++;
|
180 |
|
|
sc[i][0] = __builtin_vsx_xxlandc (sc[i][1], sc[i][2]); i++;
|
181 |
|
|
sc[i][0] = __builtin_vsx_xxlnor (sc[i][1], sc[i][2]); i++;
|
182 |
|
|
sc[i][0] = __builtin_vsx_xxlor (sc[i][1], sc[i][2]); i++;
|
183 |
|
|
sc[i][0] = __builtin_vsx_xxlxor (sc[i][1], sc[i][2]); i++;
|
184 |
|
|
|
185 |
|
|
d[i][0] = __builtin_vsx_xxland (d[i][1], d[i][2]); i++;
|
186 |
|
|
d[i][0] = __builtin_vsx_xxlandc (d[i][1], d[i][2]); i++;
|
187 |
|
|
d[i][0] = __builtin_vsx_xxlnor (d[i][1], d[i][2]); i++;
|
188 |
|
|
d[i][0] = __builtin_vsx_xxlor (d[i][1], d[i][2]); i++;
|
189 |
|
|
d[i][0] = __builtin_vsx_xxlxor (d[i][1], d[i][2]); i++;
|
190 |
|
|
|
191 |
|
|
f[i][0] = __builtin_vsx_xxland (f[i][1], f[i][2]); i++;
|
192 |
|
|
f[i][0] = __builtin_vsx_xxlandc (f[i][1], f[i][2]); i++;
|
193 |
|
|
f[i][0] = __builtin_vsx_xxlnor (f[i][1], f[i][2]); i++;
|
194 |
|
|
f[i][0] = __builtin_vsx_xxlor (f[i][1], f[i][2]); i++;
|
195 |
|
|
f[i][0] = __builtin_vsx_xxlxor (f[i][1], f[i][2]); i++;
|
196 |
|
|
return i;
|
197 |
|
|
}
|
198 |
|
|
|
199 |
|
|
int do_xxsldwi (void)
|
200 |
|
|
{
|
201 |
|
|
int i = 0;
|
202 |
|
|
|
203 |
|
|
si[i][0] = __builtin_vsx_xxsldwi (si[i][1], si[i][2], 0); i++;
|
204 |
|
|
ss[i][0] = __builtin_vsx_xxsldwi (ss[i][1], ss[i][2], 1); i++;
|
205 |
|
|
sc[i][0] = __builtin_vsx_xxsldwi (sc[i][1], sc[i][2], 2); i++;
|
206 |
|
|
ui[i][0] = __builtin_vsx_xxsldwi (ui[i][1], ui[i][2], 3); i++;
|
207 |
|
|
us[i][0] = __builtin_vsx_xxsldwi (us[i][1], us[i][2], 0); i++;
|
208 |
|
|
uc[i][0] = __builtin_vsx_xxsldwi (uc[i][1], uc[i][2], 1); i++;
|
209 |
|
|
f[i][0] = __builtin_vsx_xxsldwi (f[i][1], f[i][2], 2); i++;
|
210 |
|
|
d[i][0] = __builtin_vsx_xxsldwi (d[i][1], d[i][2], 3); i++;
|
211 |
|
|
return i;
|
212 |
|
|
}
|