1 /* { dg-do run { target mipsisa64*-*-* } } */
2 /* { dg-mips-options "-mips64 -O2 -mpaired-single -mhard-float -mgp64" } */
4 /* Test MIPS paired-single builtin functions */
8 typedef float v2sf
__attribute__ ((vector_size(8)));
17 union { long long ll
; int i
[2]; } endianness_test
;
18 endianness_test
.ll
= 1;
19 little_endian
= endianness_test
.i
[0];
24 c
= __builtin_mips_pll_ps (a
, b
);
25 if (little_endian
) // little endian
30 if (!__builtin_mips_upper_c_eq_ps (c
, d
) ||
31 !__builtin_mips_lower_c_eq_ps (c
, d
))
37 c
= __builtin_mips_pul_ps (a
, b
);
38 if (little_endian
) // little endian
42 if (!__builtin_mips_upper_c_eq_ps (c
, d
) ||
43 !__builtin_mips_lower_c_eq_ps (c
, d
))
49 c
= __builtin_mips_plu_ps (a
, b
);
50 if (little_endian
) // little endian
54 if (!__builtin_mips_upper_c_eq_ps (c
, d
) ||
55 !__builtin_mips_lower_c_eq_ps (c
, d
))
61 c
= __builtin_mips_puu_ps (a
, b
);
62 if (little_endian
) // little endian
66 if (!__builtin_mips_upper_c_eq_ps (c
, d
) ||
67 !__builtin_mips_lower_c_eq_ps (c
, d
))
73 a
= __builtin_mips_cvt_ps_s (e
, f
);
74 if (little_endian
) // little endian
75 b
= (v2sf
) {4.5, 3.4};
77 b
= (v2sf
) {3.4, 4.5};
78 if (!__builtin_mips_upper_c_eq_ps (a
, b
) ||
79 !__builtin_mips_lower_c_eq_ps (a
, b
))
83 a
= (v2sf
) {35.1, 120.2};
84 e
= __builtin_mips_cvt_s_pl (a
);
85 if (little_endian
) // little endian
93 a
= (v2sf
) {30.0, 100.0};
94 e
= __builtin_mips_cvt_s_pu (a
);
95 if (little_endian
) // little endian
103 a
= (v2sf
) {-3.4, -5.8};
104 b
= __builtin_mips_abs_ps (a
);
105 c
= (v2sf
) {3.4, 5.8};
106 if (!__builtin_mips_upper_c_eq_ps (b
, c
) ||
107 !__builtin_mips_lower_c_eq_ps (b
, c
))
110 /* alnv.ps with rs = 4*/
114 c
= __builtin_mips_alnv_ps (a
, b
, i
);
117 if (!__builtin_mips_upper_c_eq_ps (c
, d
) ||
118 !__builtin_mips_lower_c_eq_ps (c
, d
))
121 /* alnv.ps with rs = 0 */
125 c
= __builtin_mips_alnv_ps (a
, b
, i
);
128 if (!__builtin_mips_upper_c_eq_ps (c
, d
) ||
129 !__builtin_mips_lower_c_eq_ps (c
, d
))
132 printf ("Test Passes\n");