1 /* { dg-do run { target mipsisa64*-*-* } } */
2 /* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
4 /* Test MIPS paired-single comparisons */
8 typedef float v2sf
__attribute__((vector_size(8)));
10 int test0 (v2sf a
, v2sf b
);
11 int test1 (v2sf a
, v2sf b
);
12 int test2 (v2sf a
, v2sf b
);
13 int test3 (v2sf a
, v2sf b
);
14 int test4 (v2sf a
, v2sf b
);
15 int test5 (v2sf a
, v2sf b
);
16 int test6 (v2sf a
, v2sf b
);
17 int test7 (v2sf a
, v2sf b
);
18 int test8 (v2sf a
, v2sf b
);
19 int test9 (v2sf a
, v2sf b
);
20 int test10 (v2sf a
, v2sf b
);
21 int test11 (v2sf a
, v2sf b
);
22 int test12 (v2sf a
, v2sf b
);
23 int test13 (v2sf a
, v2sf b
);
24 int test14 (v2sf a
, v2sf b
);
25 int test15 (v2sf a
, v2sf b
);
26 int test16 (v2sf a
, v2sf b
);
27 int test17 (v2sf a
, v2sf b
);
28 int test18 (v2sf a
, v2sf b
);
29 int test19 (v2sf a
, v2sf b
);
30 int test20 (v2sf a
, v2sf b
);
31 int test21 (v2sf a
, v2sf b
);
32 int test22 (v2sf a
, v2sf b
);
33 int test23 (v2sf a
, v2sf b
);
34 int test24 (v2sf a
, v2sf b
);
35 int test25 (v2sf a
, v2sf b
);
36 int test26 (v2sf a
, v2sf b
);
37 int test27 (v2sf a
, v2sf b
);
38 int test28 (v2sf a
, v2sf b
);
39 int test29 (v2sf a
, v2sf b
);
40 int test30 (v2sf a
, v2sf b
);
41 int test31 (v2sf a
, v2sf b
);
43 float qnan
= 1.0f
/0.0f
- 1.0f
/0.0f
;
47 union { long long ll
; int i
[2]; } endianness_test
;
52 endianness_test
.ll
= 1;
53 little_endian
= endianness_test
.i
[0];
55 /* Case 1 {diff, diff} */
58 i
= __builtin_mips_upper_c_eq_ps (a
, b
);
59 j
= __builtin_mips_lower_c_eq_ps (a
, b
);
63 /* Case 2 {same, diff} */
64 a
= (v2sf
) {1.0, 2.0};
65 b
= (v2sf
) {1.0, 4.0};
66 i
= __builtin_mips_upper_c_eq_ps (a
, b
);
67 j
= __builtin_mips_lower_c_eq_ps (a
, b
);
79 /* Case 3 {diff, same} */
82 i
= __builtin_mips_upper_c_eq_ps (a
, b
);
83 j
= __builtin_mips_lower_c_eq_ps (a
, b
);
95 /* Case 4 {same, same} */
98 i
= __builtin_mips_upper_c_eq_ps (a
, b
);
99 j
= __builtin_mips_lower_c_eq_ps (a
, b
);
100 if (i
!= 1 || j
!= 1)
103 /* Test upper/lower with 16 operators */
106 a
= (v2sf
) {1984.0, 10.58};
107 b
= (v2sf
) {1984.0, 567.345};
111 a
= (v2sf
) {10.58, 1984.0};
112 b
= (v2sf
) {567.345, 1984.0};
212 /* Reverse arguments */
310 #ifndef __FAST_MATH__
311 /* Test upper/lower with 16 operators */
314 a
= (v2sf
) {qnan
, qnan
};
315 b
= (v2sf
) {1984.0, 567.345};
319 a
= (v2sf
) {qnan
, qnan
};
320 b
= (v2sf
) {567.345, 1984.0};
421 printf ("Test Passes\n");
425 int test0 (v2sf a
, v2sf b
)
427 return __builtin_mips_upper_c_f_ps (a
, b
);
430 int test1 (v2sf a
, v2sf b
)
432 return __builtin_mips_lower_c_f_ps (a
, b
);
435 int test2 (v2sf a
, v2sf b
)
437 return __builtin_mips_upper_c_un_ps (a
, b
);
440 int test3 (v2sf a
, v2sf b
)
442 return __builtin_mips_lower_c_un_ps (a
, b
);
445 int test4 (v2sf a
, v2sf b
)
447 return __builtin_mips_upper_c_eq_ps (a
, b
);
450 int test5 (v2sf a
, v2sf b
)
452 return __builtin_mips_lower_c_eq_ps (a
, b
);
455 int test6 (v2sf a
, v2sf b
)
457 return __builtin_mips_upper_c_ueq_ps (a
, b
);
460 int test7 (v2sf a
, v2sf b
)
462 return __builtin_mips_lower_c_ueq_ps (a
, b
);
465 int test8 (v2sf a
, v2sf b
)
467 return __builtin_mips_upper_c_olt_ps (a
, b
);
470 int test9 (v2sf a
, v2sf b
)
472 return __builtin_mips_lower_c_olt_ps (a
, b
);
475 int test10 (v2sf a
, v2sf b
)
477 return __builtin_mips_upper_c_ult_ps (a
, b
);
480 int test11 (v2sf a
, v2sf b
)
482 return __builtin_mips_lower_c_ult_ps (a
, b
);
485 int test12 (v2sf a
, v2sf b
)
487 return __builtin_mips_upper_c_ole_ps (a
, b
);
490 int test13 (v2sf a
, v2sf b
)
492 return __builtin_mips_lower_c_ole_ps (a
, b
);
495 int test14 (v2sf a
, v2sf b
)
497 return __builtin_mips_upper_c_ule_ps (a
, b
);
500 int test15 (v2sf a
, v2sf b
)
502 return __builtin_mips_lower_c_ule_ps (a
, b
);
505 int test16 (v2sf a
, v2sf b
)
507 return __builtin_mips_upper_c_sf_ps (a
, b
);
510 int test17 (v2sf a
, v2sf b
)
512 return __builtin_mips_lower_c_sf_ps (a
, b
);
515 int test18 (v2sf a
, v2sf b
)
517 return __builtin_mips_upper_c_ngle_ps (a
, b
);
520 int test19 (v2sf a
, v2sf b
)
522 return __builtin_mips_lower_c_ngle_ps (a
, b
);
525 int test20 (v2sf a
, v2sf b
)
527 return __builtin_mips_upper_c_seq_ps (a
, b
);
530 int test21 (v2sf a
, v2sf b
)
532 return __builtin_mips_lower_c_seq_ps (a
, b
);
535 int test22 (v2sf a
, v2sf b
)
537 return __builtin_mips_upper_c_ngl_ps (a
, b
);
540 int test23 (v2sf a
, v2sf b
)
542 return __builtin_mips_lower_c_ngl_ps (a
, b
);
545 int test24 (v2sf a
, v2sf b
)
547 return __builtin_mips_upper_c_lt_ps (a
, b
);
550 int test25 (v2sf a
, v2sf b
)
552 return __builtin_mips_lower_c_lt_ps (a
, b
);
555 int test26 (v2sf a
, v2sf b
)
557 return __builtin_mips_upper_c_nge_ps (a
, b
);
560 int test27 (v2sf a
, v2sf b
)
562 return __builtin_mips_lower_c_nge_ps (a
, b
);
565 int test28 (v2sf a
, v2sf b
)
567 return __builtin_mips_upper_c_le_ps (a
, b
);
570 int test29 (v2sf a
, v2sf b
)
572 return __builtin_mips_lower_c_le_ps (a
, b
);
575 int test30 (v2sf a
, v2sf b
)
577 return __builtin_mips_upper_c_ngt_ps (a
, b
);
580 int test31 (v2sf a
, v2sf b
)
582 return __builtin_mips_lower_c_ngt_ps (a
, b
);