12 .macro test_ftoi_ex op, r0, fr0, v, c, r
24 .macro test_ftoi op, r0, fr0, v, c, r
27 test_ftoi_ex \op, \r0, \fr0, \v, \c, \r
30 test_ftoi_ex \op, \r0, \fr0, \v, \c, \r
34 .macro test_itof_ex op, fr0, ar0, v, c, r
48 .macro test_itof_rm op, fr0, ar0, v, c, rm, r
51 test_itof_ex \op, \fr0, \ar0, \v, \c, \r
54 test_itof_ex \op, \fr0, \ar0, \v, \c, \r
57 .macro test_itof op, fr0, ar0, v, c, r0, r1, r2, r3
58 test_itof_rm \op, \fr0, \ar0, \v, \c, 0, \r0
59 test_itof_rm \op, \fr0, \ar0, \v, \c, 1, \r1
60 test_itof_rm \op, \fr0, \ar0, \v, \c, 2, \r2
61 test_itof_rm \op, \fr0, \ar0, \v, \c, 3, \r3
69 test_ftoi round.s, a2, f0, 0xffc00001, 0, 0x7fffffff
70 test_ftoi round.s, a2, f0, 0xff800001, 0, 0x7fffffff
73 test_ftoi round.s, a2, f0, 0xff800000, 0, 0x80000000
75 /* negative overflow */
76 test_ftoi round.s, a2, f0, 0xceffffff, 1, 0x80000000
77 test_ftoi round.s, a2, f0, 0xcf000000, 0, 0x80000000
78 test_ftoi round.s, a2, f0, 0xceffffff, 0, 0x80000080
81 test_ftoi round.s, a2, f0, 0xbfa00000, 1, -2 /* -1.25 * 2 */
82 test_ftoi round.s, a2, f0, 0xbfc00000, 0, -2 /* -1.5 */
83 test_ftoi round.s, a2, f0, 0xbf800000, 1, -2 /* -1 * 2 */
84 test_ftoi round.s, a2, f0, 0xbf800000, 0, -1 /* -1 */
85 test_ftoi round.s, a2, f0, 0xbf400000, 0, -1 /* -0.75 */
86 test_ftoi round.s, a2, f0, 0xbf000000, 0, 0 /* -0.5 */
89 test_ftoi round.s, a2, f0, 0x3f000000, 0, 0 /* 0.5 */
90 test_ftoi round.s, a2, f0, 0x3f400000, 0, 1 /* 0.75 */
91 test_ftoi round.s, a2, f0, 0x3f800000, 0, 1 /* 1 */
92 test_ftoi round.s, a2, f0, 0x3f800000, 1, 2 /* 1 * 2 */
93 test_ftoi round.s, a2, f0, 0x3fc00000, 0, 2 /* 1.5 */
94 test_ftoi round.s, a2, f0, 0x3fa00000, 1, 2 /* 1.25 * 2 */
96 /* positive overflow */
97 test_ftoi round.s, a2, f0, 0x4effffff, 0, 0x7fffff80
98 test_ftoi round.s, a2, f0, 0x4f000000, 0, 0x7fffffff
99 test_ftoi round.s, a2, f0, 0x4effffff, 1, 0x7fffffff
102 test_ftoi round.s, a2, f0, 0x7f800000, 0, 0x7fffffff
105 test_ftoi round.s, a2, f0, 0x7f800001, 0, 0x7fffffff
106 test_ftoi round.s, a2, f0, 0x7fc00000, 0, 0x7fffffff
111 test_ftoi trunc.s, a2, f0, 0xffc00001, 0, 0x7fffffff
112 test_ftoi trunc.s, a2, f0, 0xff800001, 0, 0x7fffffff
115 test_ftoi trunc.s, a2, f0, 0xff800000, 0, 0x80000000
117 /* negative overflow */
118 test_ftoi trunc.s, a2, f0, 0xceffffff, 1, 0x80000000
119 test_ftoi trunc.s, a2, f0, 0xcf000000, 0, 0x80000000
120 test_ftoi trunc.s, a2, f0, 0xceffffff, 0, 0x80000080
123 test_ftoi trunc.s, a2, f0, 0xbfa00000, 1, -2 /* -1.25 * 2 */
124 test_ftoi trunc.s, a2, f0, 0xbfc00000, 0, -1 /* -1.5 */
125 test_ftoi trunc.s, a2, f0, 0xbf800000, 1, -2 /* -1 * 2 */
126 test_ftoi trunc.s, a2, f0, 0xbf800000, 0, -1 /* -1 */
127 test_ftoi trunc.s, a2, f0, 0xbf400000, 0, 0 /* -0.75 */
128 test_ftoi trunc.s, a2, f0, 0xbf000000, 0, 0 /* -0.5 */
131 test_ftoi trunc.s, a2, f0, 0x3f000000, 0, 0 /* 0.5 */
132 test_ftoi trunc.s, a2, f0, 0x3f400000, 0, 0 /* 0.75 */
133 test_ftoi trunc.s, a2, f0, 0x3f800000, 0, 1 /* 1 */
134 test_ftoi trunc.s, a2, f0, 0x3f800000, 1, 2 /* 1 * 2 */
135 test_ftoi trunc.s, a2, f0, 0x3fc00000, 0, 1 /* 1.5 */
136 test_ftoi trunc.s, a2, f0, 0x3fa00000, 1, 2 /* 1.25 * 2 */
138 /* positive overflow */
139 test_ftoi trunc.s, a2, f0, 0x4effffff, 0, 0x7fffff80
140 test_ftoi trunc.s, a2, f0, 0x4f000000, 0, 0x7fffffff
141 test_ftoi trunc.s, a2, f0, 0x4effffff, 1, 0x7fffffff
144 test_ftoi trunc.s, a2, f0, 0x7f800000, 0, 0x7fffffff
147 test_ftoi trunc.s, a2, f0, 0x7f800001, 0, 0x7fffffff
148 test_ftoi trunc.s, a2, f0, 0x7fc00000, 0, 0x7fffffff
153 test_ftoi floor.s, a2, f0, 0xffc00001, 0, 0x7fffffff
154 test_ftoi floor.s, a2, f0, 0xff800001, 0, 0x7fffffff
157 test_ftoi floor.s, a2, f0, 0xff800000, 0, 0x80000000
159 /* negative overflow */
160 test_ftoi floor.s, a2, f0, 0xceffffff, 1, 0x80000000
161 test_ftoi floor.s, a2, f0, 0xcf000000, 0, 0x80000000
162 test_ftoi floor.s, a2, f0, 0xceffffff, 0, 0x80000080
165 test_ftoi floor.s, a2, f0, 0xbfa00000, 1, -3 /* -1.25 * 2 */
166 test_ftoi floor.s, a2, f0, 0xbfc00000, 0, -2 /* -1.5 */
167 test_ftoi floor.s, a2, f0, 0xbf800000, 1, -2 /* -1 * 2 */
168 test_ftoi floor.s, a2, f0, 0xbf800000, 0, -1 /* -1 */
169 test_ftoi floor.s, a2, f0, 0xbf400000, 0, -1 /* -0.75 */
170 test_ftoi floor.s, a2, f0, 0xbf000000, 0, -1 /* -0.5 */
173 test_ftoi floor.s, a2, f0, 0x3f000000, 0, 0 /* 0.5 */
174 test_ftoi floor.s, a2, f0, 0x3f400000, 0, 0 /* 0.75 */
175 test_ftoi floor.s, a2, f0, 0x3f800000, 0, 1 /* 1 */
176 test_ftoi floor.s, a2, f0, 0x3f800000, 1, 2 /* 1 * 2 */
177 test_ftoi floor.s, a2, f0, 0x3fc00000, 0, 1 /* 1.5 */
178 test_ftoi floor.s, a2, f0, 0x3fa00000, 1, 2 /* 1.25 * 2 */
180 /* positive overflow */
181 test_ftoi floor.s, a2, f0, 0x4effffff, 0, 0x7fffff80
182 test_ftoi floor.s, a2, f0, 0x4f000000, 0, 0x7fffffff
183 test_ftoi floor.s, a2, f0, 0x4effffff, 1, 0x7fffffff
186 test_ftoi floor.s, a2, f0, 0x7f800000, 0, 0x7fffffff
189 test_ftoi floor.s, a2, f0, 0x7f800001, 0, 0x7fffffff
190 test_ftoi floor.s, a2, f0, 0x7fc00000, 0, 0x7fffffff
195 test_ftoi ceil.s, a2, f0, 0xffc00001, 0, 0x7fffffff
196 test_ftoi ceil.s, a2, f0, 0xff800001, 0, 0x7fffffff
199 test_ftoi ceil.s, a2, f0, 0xff800000, 0, 0x80000000
201 /* negative overflow */
202 test_ftoi ceil.s, a2, f0, 0xceffffff, 1, 0x80000000
203 test_ftoi ceil.s, a2, f0, 0xcf000000, 0, 0x80000000
204 test_ftoi ceil.s, a2, f0, 0xceffffff, 0, 0x80000080
207 test_ftoi ceil.s, a2, f0, 0xbfa00000, 1, -2 /* -1.25 * 2 */
208 test_ftoi ceil.s, a2, f0, 0xbfc00000, 0, -1 /* -1.5 */
209 test_ftoi ceil.s, a2, f0, 0xbf800000, 1, -2 /* -1 * 2 */
210 test_ftoi ceil.s, a2, f0, 0xbf800000, 0, -1 /* -1 */
211 test_ftoi ceil.s, a2, f0, 0xbf400000, 0, 0 /* -0.75 */
212 test_ftoi ceil.s, a2, f0, 0xbf000000, 0, 0 /* -0.5 */
215 test_ftoi ceil.s, a2, f0, 0x3f000000, 0, 1 /* 0.5 */
216 test_ftoi ceil.s, a2, f0, 0x3f400000, 0, 1 /* 0.75 */
217 test_ftoi ceil.s, a2, f0, 0x3f800000, 0, 1 /* 1 */
218 test_ftoi ceil.s, a2, f0, 0x3f800000, 1, 2 /* 1 * 2 */
219 test_ftoi ceil.s, a2, f0, 0x3fc00000, 0, 2 /* 1.5 */
220 test_ftoi ceil.s, a2, f0, 0x3fa00000, 1, 3 /* 1.25 * 2 */
222 /* positive overflow */
223 test_ftoi ceil.s, a2, f0, 0x4effffff, 0, 0x7fffff80
224 test_ftoi ceil.s, a2, f0, 0x4f000000, 0, 0x7fffffff
225 test_ftoi ceil.s, a2, f0, 0x4effffff, 1, 0x7fffffff
228 test_ftoi ceil.s, a2, f0, 0x7f800000, 0, 0x7fffffff
231 test_ftoi ceil.s, a2, f0, 0x7f800001, 0, 0x7fffffff
232 test_ftoi ceil.s, a2, f0, 0x7fc00000, 0, 0x7fffffff
237 test_ftoi utrunc.s, a2, f0, 0xffc00001, 0, 0xffffffff
238 test_ftoi utrunc.s, a2, f0, 0xff800001, 0, 0xffffffff
241 test_ftoi utrunc.s, a2, f0, 0xff800000, 0, 0x80000000
243 /* negative overflow */
244 test_ftoi utrunc.s, a2, f0, 0xceffffff, 1, 0x80000000
245 test_ftoi utrunc.s, a2, f0, 0xcf000000, 0, 0x80000000
246 test_ftoi utrunc.s, a2, f0, 0xceffffff, 0, 0x80000080
249 test_ftoi utrunc.s, a2, f0, 0xbfa00000, 1, -2 /* -1.25 * 2 */
250 test_ftoi utrunc.s, a2, f0, 0xbfc00000, 0, -1 /* -1.5 */
251 test_ftoi utrunc.s, a2, f0, 0xbf800000, 1, -2 /* -1 * 2 */
252 test_ftoi utrunc.s, a2, f0, 0xbf800000, 0, -1 /* -1 */
253 test_ftoi utrunc.s, a2, f0, 0xbf400000, 0, 0 /* -0.75 */
254 test_ftoi utrunc.s, a2, f0, 0xbf000000, 0, 0 /* -0.5 */
257 test_ftoi utrunc.s, a2, f0, 0x3f000000, 0, 0 /* 0.5 */
258 test_ftoi utrunc.s, a2, f0, 0x3f400000, 0, 0 /* 0.75 */
259 test_ftoi utrunc.s, a2, f0, 0x3f800000, 0, 1 /* 1 */
260 test_ftoi utrunc.s, a2, f0, 0x3f800000, 1, 2 /* 1 * 2 */
261 test_ftoi utrunc.s, a2, f0, 0x3fc00000, 0, 1 /* 1.5 */
262 test_ftoi utrunc.s, a2, f0, 0x3fa00000, 1, 2 /* 1.25 * 2 */
264 /* positive overflow */
265 test_ftoi utrunc.s, a2, f0, 0x4effffff, 0, 0x7fffff80
266 test_ftoi utrunc.s, a2, f0, 0x4f000000, 0, 0x80000000
267 test_ftoi utrunc.s, a2, f0, 0x4effffff, 1, 0xffffff00
268 test_ftoi utrunc.s, a2, f0, 0x4f800000, 1, 0xffffffff
271 test_ftoi utrunc.s, a2, f0, 0x7f800000, 0, 0xffffffff
274 test_ftoi utrunc.s, a2, f0, 0x7f800001, 0, 0xffffffff
275 test_ftoi utrunc.s, a2, f0, 0x7fc00000, 0, 0xffffffff
279 test_itof float.s, f0, a2, -1, 0, \
280 0xbf800000, 0xbf800000, 0xbf800000, 0xbf800000
281 test_itof float.s, f0, a2, 0, 0, 0, 0, 0, 0
282 test_itof float.s, f0, a2, 1, 1, \
283 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000
284 test_itof float.s, f0, a2, 1, 0, \
285 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000
286 test_itof float.s, f0, a2, 0x7fffffff, 0, \
287 0x4f000000, 0x4effffff, 0x4f000000, 0x4effffff
291 test_itof ufloat.s, f0, a2, 0, 0, 0, 0, 0, 0
292 test_itof ufloat.s, f0, a2, 1, 1, \
293 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000
294 test_itof ufloat.s, f0, a2, 1, 0, \
295 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000
296 test_itof ufloat.s, f0, a2, 0x7fffffff, 0, \
297 0x4f000000, 0x4effffff, 0x4f000000, 0x4effffff
298 test_itof ufloat.s, f0, a2, 0xffffffff, 0, \
299 0x4f800000, 0x4f7fffff, 0x4f800000, 0x4f7fffff