2 /* { dg-options "-O2 -mips3d" } */
4 /* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */
8 typedef float v2sf
__attribute__ ((vector_size(8)));
10 NOMIPS16
int test0 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
11 NOMIPS16
int test1 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
12 NOMIPS16
int test2 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
13 NOMIPS16
int test3 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
14 NOMIPS16
int test4 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
15 NOMIPS16
int test5 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
16 NOMIPS16
int test6 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
17 NOMIPS16
int test7 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
18 NOMIPS16
int test8 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
19 NOMIPS16
int test9 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
20 NOMIPS16
int test10 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
21 NOMIPS16
int test11 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
22 NOMIPS16
int test12 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
23 NOMIPS16
int test13 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
24 NOMIPS16
int test14 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
25 NOMIPS16
int test15 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
26 NOMIPS16
int test16 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
27 NOMIPS16
int test17 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
28 NOMIPS16
int test18 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
29 NOMIPS16
int test19 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
30 NOMIPS16
int test20 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
31 NOMIPS16
int test21 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
32 NOMIPS16
int test22 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
33 NOMIPS16
int test23 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
34 NOMIPS16
int test24 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
35 NOMIPS16
int test25 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
36 NOMIPS16
int test26 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
37 NOMIPS16
int test27 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
38 NOMIPS16
int test28 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
39 NOMIPS16
int test29 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
40 NOMIPS16
int test30 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
41 NOMIPS16
int test31 (v2sf a
, v2sf b
, v2sf c
, v2sf d
);
43 float qnan
= 1.0f
/0.0f
- 1.0f
/0.0f
;
52 b
= (v2sf
) {-33, -44};
54 d
= (v2sf
) {-77, -88};
57 if (__builtin_mips_any_cabs_eq_4s(a
, b
, c
, d
) != i
)
59 if (__builtin_mips_all_cabs_eq_4s(a
, b
, c
, d
) != j
)
64 b
= (v2sf
) {-11, -44};
66 d
= (v2sf
) {-77, -88};
69 if (__builtin_mips_any_cabs_eq_4s(a
, b
, c
, d
) != i
)
71 if (__builtin_mips_all_cabs_eq_4s(a
, b
, c
, d
) != j
)
76 b
= (v2sf
) {-33, -22};
78 d
= (v2sf
) {-77, -88};
81 if (__builtin_mips_any_cabs_eq_4s(a
, b
, c
, d
) != i
)
83 if (__builtin_mips_all_cabs_eq_4s(a
, b
, c
, d
) != j
)
88 b
= (v2sf
) {-33, -44};
90 d
= (v2sf
) {-55, -88};
93 if (__builtin_mips_any_cabs_eq_4s(a
, b
, c
, d
) != i
)
95 if (__builtin_mips_all_cabs_eq_4s(a
, b
, c
, d
) != j
)
100 b
= (v2sf
) {-33, -44};
102 d
= (v2sf
) {-77, -66};
105 if (__builtin_mips_any_cabs_eq_4s(a
, b
, c
, d
) != i
)
107 if (__builtin_mips_all_cabs_eq_4s(a
, b
, c
, d
) != j
)
112 b
= (v2sf
) {-11, -22};
114 d
= (v2sf
) {-55, -66};
117 if (__builtin_mips_any_cabs_eq_4s(a
, b
, c
, d
) != i
)
119 if (__builtin_mips_all_cabs_eq_4s(a
, b
, c
, d
) != j
)
122 /* Test all comparisons */
124 b
= (v2sf
) {-33, -11};
126 d
= (v2sf
) {-55, -88};
128 i
= test0 (a
, b
, c
, d
);
131 i
= test1 (a
, b
, c
, d
);
134 i
= test2 (a
, b
, c
, d
);
137 i
= test3 (a
, b
, c
, d
);
140 i
= test4 (a
, b
, c
, d
);
143 i
= test5 (a
, b
, c
, d
);
146 i
= test6 (a
, b
, c
, d
);
149 i
= test7 (a
, b
, c
, d
);
152 i
= test8 (a
, b
, c
, d
);
155 i
= test9 (a
, b
, c
, d
);
158 i
= test10 (a
, b
, c
, d
);
161 i
= test11 (a
, b
, c
, d
);
164 i
= test12 (a
, b
, c
, d
);
167 i
= test13 (a
, b
, c
, d
);
170 i
= test14 (a
, b
, c
, d
);
173 i
= test15 (a
, b
, c
, d
);
176 i
= test16 (a
, b
, c
, d
);
179 i
= test17 (a
, b
, c
, d
);
182 i
= test18 (a
, b
, c
, d
);
185 i
= test19 (a
, b
, c
, d
);
188 i
= test20 (a
, b
, c
, d
);
191 i
= test21 (a
, b
, c
, d
);
194 i
= test22 (a
, b
, c
, d
);
197 i
= test23 (a
, b
, c
, d
);
200 i
= test24 (a
, b
, c
, d
);
203 i
= test25 (a
, b
, c
, d
);
206 i
= test26 (a
, b
, c
, d
);
209 i
= test27 (a
, b
, c
, d
);
212 i
= test28 (a
, b
, c
, d
);
215 i
= test29 (a
, b
, c
, d
);
218 i
= test30 (a
, b
, c
, d
);
221 i
= test31 (a
, b
, c
, d
);
225 /* Reversed arguments */
226 i
= test0 (b
, a
, d
, c
);
229 i
= test1 (b
, a
, d
, c
);
232 i
= test2 (b
, a
, d
, c
);
235 i
= test3 (b
, a
, d
, c
);
238 i
= test4 (b
, a
, d
, c
);
241 i
= test5 (b
, a
, d
, c
);
244 i
= test6 (b
, a
, d
, c
);
247 i
= test7 (b
, a
, d
, c
);
250 i
= test8 (b
, a
, d
, c
);
253 i
= test9 (b
, a
, d
, c
);
256 i
= test10 (b
, a
, d
, c
);
259 i
= test11 (b
, a
, d
, c
);
262 i
= test12 (b
, a
, d
, c
);
265 i
= test13 (b
, a
, d
, c
);
268 i
= test14 (b
, a
, d
, c
);
271 i
= test15 (b
, a
, d
, c
);
274 i
= test16 (b
, a
, d
, c
);
277 i
= test17 (b
, a
, d
, c
);
280 i
= test18 (b
, a
, d
, c
);
283 i
= test19 (b
, a
, d
, c
);
286 i
= test20 (b
, a
, d
, c
);
289 i
= test21 (b
, a
, d
, c
);
292 i
= test22 (b
, a
, d
, c
);
295 i
= test23 (b
, a
, d
, c
);
298 i
= test24 (b
, a
, d
, c
);
301 i
= test25 (b
, a
, d
, c
);
304 i
= test26 (b
, a
, d
, c
);
307 i
= test27 (b
, a
, d
, c
);
310 i
= test28 (b
, a
, d
, c
);
313 i
= test29 (b
, a
, d
, c
);
316 i
= test30 (b
, a
, d
, c
);
319 i
= test31 (b
, a
, d
, c
);
323 #ifndef __FAST_MATH__
324 /* Test all comparisons */
325 a
= (v2sf
) {qnan
, qnan
};
326 b
= (v2sf
) {-33, -11};
327 c
= (v2sf
) {qnan
, qnan
};
328 d
= (v2sf
) {-55, -88};
330 i
= test0 (a
, b
, c
, d
);
333 i
= test1 (a
, b
, c
, d
);
336 i
= test2 (a
, b
, c
, d
);
339 i
= test3 (a
, b
, c
, d
);
342 i
= test4 (a
, b
, c
, d
);
345 i
= test5 (a
, b
, c
, d
);
348 i
= test6 (a
, b
, c
, d
);
351 i
= test7 (a
, b
, c
, d
);
354 i
= test8 (a
, b
, c
, d
);
357 i
= test9 (a
, b
, c
, d
);
360 i
= test10 (a
, b
, c
, d
);
363 i
= test11 (a
, b
, c
, d
);
366 i
= test12 (a
, b
, c
, d
);
369 i
= test13 (a
, b
, c
, d
);
372 i
= test14 (a
, b
, c
, d
);
375 i
= test15 (a
, b
, c
, d
);
378 i
= test16 (a
, b
, c
, d
);
381 i
= test17 (a
, b
, c
, d
);
384 i
= test18 (a
, b
, c
, d
);
387 i
= test19 (a
, b
, c
, d
);
390 i
= test20 (a
, b
, c
, d
);
393 i
= test21 (a
, b
, c
, d
);
396 i
= test22 (a
, b
, c
, d
);
399 i
= test23 (a
, b
, c
, d
);
402 i
= test24 (a
, b
, c
, d
);
405 i
= test25 (a
, b
, c
, d
);
408 i
= test26 (a
, b
, c
, d
);
411 i
= test27 (a
, b
, c
, d
);
414 i
= test28 (a
, b
, c
, d
);
417 i
= test29 (a
, b
, c
, d
);
420 i
= test30 (a
, b
, c
, d
);
423 i
= test31 (a
, b
, c
, d
);
428 printf ("Test Passes\n");
432 NOMIPS16
int test0 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
434 return __builtin_mips_any_cabs_f_4s (a
, b
, c
, d
);
437 NOMIPS16
int test1 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
439 return __builtin_mips_all_cabs_f_4s (a
, b
, c
, d
);
442 NOMIPS16
int test2 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
444 return __builtin_mips_any_cabs_un_4s (a
, b
, c
, d
);
447 NOMIPS16
int test3 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
449 return __builtin_mips_all_cabs_un_4s (a
, b
, c
, d
);
452 NOMIPS16
int test4 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
454 return __builtin_mips_any_cabs_eq_4s (a
, b
, c
, d
);
457 NOMIPS16
int test5 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
459 return __builtin_mips_all_cabs_eq_4s (a
, b
, c
, d
);
462 NOMIPS16
int test6 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
464 return __builtin_mips_any_cabs_ueq_4s (a
, b
, c
, d
);
467 NOMIPS16
int test7 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
469 return __builtin_mips_all_cabs_ueq_4s (a
, b
, c
, d
);
472 NOMIPS16
int test8 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
474 return __builtin_mips_any_cabs_olt_4s (a
, b
, c
, d
);
477 NOMIPS16
int test9 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
479 return __builtin_mips_all_cabs_olt_4s (a
, b
, c
, d
);
482 NOMIPS16
int test10 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
484 return __builtin_mips_any_cabs_ult_4s (a
, b
, c
, d
);
487 NOMIPS16
int test11 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
489 return __builtin_mips_all_cabs_ult_4s (a
, b
, c
, d
);
492 NOMIPS16
int test12 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
494 return __builtin_mips_any_cabs_ole_4s (a
, b
, c
, d
);
497 NOMIPS16
int test13 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
499 return __builtin_mips_all_cabs_ole_4s (a
, b
, c
, d
);
502 NOMIPS16
int test14 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
504 return __builtin_mips_any_cabs_ule_4s (a
, b
, c
, d
);
507 NOMIPS16
int test15 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
509 return __builtin_mips_all_cabs_ule_4s (a
, b
, c
, d
);
512 NOMIPS16
int test16 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
514 return __builtin_mips_any_cabs_sf_4s (a
, b
, c
, d
);
517 NOMIPS16
int test17 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
519 return __builtin_mips_all_cabs_sf_4s (a
, b
, c
, d
);
522 NOMIPS16
int test18 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
524 return __builtin_mips_any_cabs_ngle_4s (a
, b
, c
, d
);
527 NOMIPS16
int test19 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
529 return __builtin_mips_all_cabs_ngle_4s (a
, b
, c
, d
);
532 NOMIPS16
int test20 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
534 return __builtin_mips_any_cabs_seq_4s (a
, b
, c
, d
);
537 NOMIPS16
int test21 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
539 return __builtin_mips_all_cabs_seq_4s (a
, b
, c
, d
);
542 NOMIPS16
int test22 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
544 return __builtin_mips_any_cabs_ngl_4s (a
, b
, c
, d
);
547 NOMIPS16
int test23 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
549 return __builtin_mips_all_cabs_ngl_4s (a
, b
, c
, d
);
552 NOMIPS16
int test24 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
554 return __builtin_mips_any_cabs_lt_4s (a
, b
, c
, d
);
557 NOMIPS16
int test25 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
559 return __builtin_mips_all_cabs_lt_4s (a
, b
, c
, d
);
562 NOMIPS16
int test26 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
564 return __builtin_mips_any_cabs_nge_4s (a
, b
, c
, d
);
567 NOMIPS16
int test27 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
569 return __builtin_mips_all_cabs_nge_4s (a
, b
, c
, d
);
572 NOMIPS16
int test28 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
574 return __builtin_mips_any_cabs_le_4s (a
, b
, c
, d
);
577 NOMIPS16
int test29 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
579 return __builtin_mips_all_cabs_le_4s (a
, b
, c
, d
);
582 NOMIPS16
int test30 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
584 return __builtin_mips_any_cabs_ngt_4s (a
, b
, c
, d
);
587 NOMIPS16
int test31 (v2sf a
, v2sf b
, v2sf c
, v2sf d
)
589 return __builtin_mips_all_cabs_ngt_4s (a
, b
, c
, d
);