1 # frv testcase for maveh $FRi,$FRj,$FRj on fr400 machines
4 .include "../testutils.inc"
10 ; Test Rounding toward positive infinity via RDAV
11 or_spr_immed 0x20000000,msr0
12 and_spr_immed 0xefffffff,msr0
14 set_fr_iimmed 0x0000,0x0000,fr10
15 set_fr_iimmed 0x0000,0x0000,fr11
17 test_fr_limmed 0x0000,0x0000,fr12
19 set_fr_iimmed 0x0001,0x0000,fr10
20 set_fr_iimmed 0x0002,0x0001,fr11
22 test_fr_limmed 0x0002,0x0001,fr12
24 set_fr_iimmed 0x0000,0xffff,fr10
25 set_fr_iimmed 0xffff,0xfffe,fr11
27 test_fr_limmed 0x0000,0xffff,fr12
29 set_fr_iimmed 0xdead,0x0000,fr10
30 set_fr_iimmed 0x0000,0xbeef,fr11
32 test_fr_limmed 0xef57,0xdf78,fr12
34 set_fr_iimmed 0x0000,0xdead,fr10
35 set_fr_iimmed 0xbeef,0x0000,fr11
37 test_fr_limmed 0xdf78,0xef57,fr12
39 set_fr_iimmed 0x1234,0x5678,fr10
40 set_fr_iimmed 0x1111,0x1111,fr11
42 test_fr_limmed 0x11a3,0x33c5,fr12
44 set_fr_iimmed 0x1234,0x5678,fr10
45 set_fr_iimmed 0xffff,0xffff,fr11
47 test_fr_limmed 0x091a,0x2b3c,fr12
49 set_fr_iimmed 0x7ffe,0x7ffe,fr10
50 set_fr_iimmed 0x0002,0x0001,fr11
52 test_fr_limmed 0x4000,0x4000,fr12
54 set_fr_iimmed 0x8001,0x8001,fr10
55 set_fr_iimmed 0xffff,0xfffe,fr11
57 test_fr_limmed 0xc000,0xc000,fr12
59 set_fr_iimmed 0x8001,0x8001,fr10
60 set_fr_iimmed 0xfffe,0xfffe,fr11
62 test_fr_limmed 0xc000,0xc000,fr12
64 set_fr_iimmed 0x8000,0x8000,fr10
65 set_fr_iimmed 0x7fff,0x7fff,fr11
66 maveh.p fr10,fr10,fr12
68 test_fr_limmed 0x8000,0x8000,fr12
69 test_fr_limmed 0x7fff,0x7fff,fr13
71 ; Test Rounding toward nearest via RD
72 or_spr_immed 0x10000000,msr0
73 and_spr_immed 0x3fffffff,msr0
75 set_fr_iimmed 0x0000,0x0000,fr10
76 set_fr_iimmed 0x0000,0x0000,fr11
78 test_fr_limmed 0x0000,0x0000,fr12
80 set_fr_iimmed 0x0001,0x0000,fr10
81 set_fr_iimmed 0x0002,0x0001,fr11
83 test_fr_limmed 0x0002,0x0001,fr12
85 set_fr_iimmed 0x0000,0xffff,fr10
86 set_fr_iimmed 0xffff,0xfffe,fr11
88 test_fr_limmed 0xffff,0xfffe,fr12
90 set_fr_iimmed 0xdead,0x0000,fr10
91 set_fr_iimmed 0x0000,0xbeef,fr11
93 test_fr_limmed 0xef56,0xdf77,fr12
95 set_fr_iimmed 0x0000,0xdead,fr10
96 set_fr_iimmed 0xbeef,0x0000,fr11
98 test_fr_limmed 0xdf77,0xef56,fr12
100 set_fr_iimmed 0x1234,0x5678,fr10
101 set_fr_iimmed 0x1111,0x1111,fr11
103 test_fr_limmed 0x11a3,0x33c5,fr12
105 set_fr_iimmed 0x1234,0x5678,fr10
106 set_fr_iimmed 0xffff,0xffff,fr11
108 test_fr_limmed 0x091a,0x2b3c,fr12
110 set_fr_iimmed 0x7ffe,0x7ffe,fr10
111 set_fr_iimmed 0x0002,0x0001,fr11
113 test_fr_limmed 0x4000,0x4000,fr12
115 set_fr_iimmed 0x8001,0x8001,fr10
116 set_fr_iimmed 0xffff,0xfffe,fr11
118 test_fr_limmed 0xc000,0xbfff,fr12
120 set_fr_iimmed 0x8001,0x8001,fr10
121 set_fr_iimmed 0xfffe,0xfffe,fr11
123 test_fr_limmed 0xbfff,0xbfff,fr12
125 set_fr_iimmed 0x8000,0x8000,fr10
126 set_fr_iimmed 0x7fff,0x7fff,fr11
127 maveh.p fr10,fr10,fr12
129 test_fr_limmed 0x8000,0x8000,fr12
130 test_fr_limmed 0x7fff,0x7fff,fr13
132 ; Test Rounding toward zero via RD
133 or_spr_immed 0x50000000,msr0
134 and_spr_immed 0x7fffffff,msr0
136 set_fr_iimmed 0x0000,0x0000,fr10
137 set_fr_iimmed 0x0000,0x0000,fr11
139 test_fr_limmed 0x0000,0x0000,fr12
141 set_fr_iimmed 0x0001,0x0000,fr10
142 set_fr_iimmed 0x0002,0x0001,fr11
144 test_fr_limmed 0x0001,0x0000,fr12
146 set_fr_iimmed 0x0000,0xffff,fr10
147 set_fr_iimmed 0xffff,0xfffe,fr11
149 test_fr_limmed 0x0000,0xffff,fr12
151 set_fr_iimmed 0xdead,0x0000,fr10
152 set_fr_iimmed 0x0000,0xbeef,fr11
154 test_fr_limmed 0xef57,0xdf78,fr12
156 set_fr_iimmed 0x0000,0xdead,fr10
157 set_fr_iimmed 0xbeef,0x0000,fr11
159 test_fr_limmed 0xdf78,0xef57,fr12
161 set_fr_iimmed 0x1234,0x5678,fr10
162 set_fr_iimmed 0x1111,0x1111,fr11
164 test_fr_limmed 0x11a2,0x33c4,fr12
166 set_fr_iimmed 0x1234,0x5678,fr10
167 set_fr_iimmed 0xffff,0xffff,fr11
169 test_fr_limmed 0x0919,0x2b3b,fr12
171 set_fr_iimmed 0x7ffe,0x7ffe,fr10
172 set_fr_iimmed 0x0002,0x0001,fr11
174 test_fr_limmed 0x4000,0x3fff,fr12
176 set_fr_iimmed 0x8001,0x8001,fr10
177 set_fr_iimmed 0xffff,0xfffe,fr11
179 test_fr_limmed 0xc000,0xc000,fr12
181 set_fr_iimmed 0x8001,0x8001,fr10
182 set_fr_iimmed 0xfffe,0xfffe,fr11
184 test_fr_limmed 0xc000,0xc000,fr12
186 set_fr_iimmed 0x8000,0x8000,fr10
187 set_fr_iimmed 0x7fff,0x7fff,fr11
188 maveh.p fr10,fr10,fr12
190 test_fr_limmed 0x8000,0x8000,fr12
191 test_fr_limmed 0x7fff,0x7fff,fr13
193 ; Test Rounding toward positive infinity via RD
194 or_spr_immed 0x90000000,msr0
195 and_spr_immed 0xbfffffff,msr0
197 set_fr_iimmed 0x0000,0x0000,fr10
198 set_fr_iimmed 0x0000,0x0000,fr11
200 test_fr_limmed 0x0000,0x0000,fr12
202 set_fr_iimmed 0x0001,0x0000,fr10
203 set_fr_iimmed 0x0002,0x0001,fr11
205 test_fr_limmed 0x0002,0x0001,fr12
207 set_fr_iimmed 0x0000,0xffff,fr10
208 set_fr_iimmed 0xffff,0xfffe,fr11
210 test_fr_limmed 0x0000,0xffff,fr12
212 set_fr_iimmed 0xdead,0x0000,fr10
213 set_fr_iimmed 0x0000,0xbeef,fr11
215 test_fr_limmed 0xef57,0xdf78,fr12
217 set_fr_iimmed 0x0000,0xdead,fr10
218 set_fr_iimmed 0xbeef,0x0000,fr11
220 test_fr_limmed 0xdf78,0xef57,fr12
222 set_fr_iimmed 0x1234,0x5678,fr10
223 set_fr_iimmed 0x1111,0x1111,fr11
225 test_fr_limmed 0x11a3,0x33c5,fr12
227 set_fr_iimmed 0x1234,0x5678,fr10
228 set_fr_iimmed 0xffff,0xffff,fr11
230 test_fr_limmed 0x091a,0x2b3c,fr12
232 set_fr_iimmed 0x7ffe,0x7ffe,fr10
233 set_fr_iimmed 0x0002,0x0001,fr11
235 test_fr_limmed 0x4000,0x4000,fr12
237 set_fr_iimmed 0x8001,0x8001,fr10
238 set_fr_iimmed 0xffff,0xfffe,fr11
240 test_fr_limmed 0xc000,0xc000,fr12
242 set_fr_iimmed 0x8001,0x8001,fr10
243 set_fr_iimmed 0xfffe,0xfffe,fr11
245 test_fr_limmed 0xc000,0xc000,fr12
247 set_fr_iimmed 0x8000,0x8000,fr10
248 set_fr_iimmed 0x7fff,0x7fff,fr11
249 maveh.p fr10,fr10,fr12
251 test_fr_limmed 0x8000,0x8000,fr12
252 test_fr_limmed 0x7fff,0x7fff,fr13
254 ; Test Rounding toward negative infinity via RD
255 or_spr_immed 0xd0000000,msr0
257 set_fr_iimmed 0x0000,0x0000,fr10
258 set_fr_iimmed 0x0000,0x0000,fr11
260 test_fr_limmed 0x0000,0x0000,fr12
262 set_fr_iimmed 0x0001,0x0000,fr10
263 set_fr_iimmed 0x0002,0x0001,fr11
265 test_fr_limmed 0x0001,0x0000,fr12
267 set_fr_iimmed 0x0000,0xffff,fr10
268 set_fr_iimmed 0xffff,0xfffe,fr11
270 test_fr_limmed 0xffff,0xfffe,fr12
272 set_fr_iimmed 0xdead,0x0000,fr10
273 set_fr_iimmed 0x0000,0xbeef,fr11
275 test_fr_limmed 0xef56,0xdf77,fr12
277 set_fr_iimmed 0x0000,0xdead,fr10
278 set_fr_iimmed 0xbeef,0x0000,fr11
280 test_fr_limmed 0xdf77,0xef56,fr12
282 set_fr_iimmed 0x1234,0x5678,fr10
283 set_fr_iimmed 0x1111,0x1111,fr11
285 test_fr_limmed 0x11a2,0x33c4,fr12
287 set_fr_iimmed 0x1234,0x5678,fr10
288 set_fr_iimmed 0xffff,0xffff,fr11
290 test_fr_limmed 0x0919,0x2b3b,fr12
293 set_fr_iimmed 0x7ffe,0x7ffe,fr10
294 set_fr_iimmed 0x0002,0x0001,fr11
296 test_fr_limmed 0x4000,0x3fff,fr12
299 set_fr_iimmed 0x8001,0x8001,fr10
300 set_fr_iimmed 0xffff,0xfffe,fr11
302 test_fr_limmed 0xc000,0xbfff,fr12
305 set_fr_iimmed 0x8001,0x8001,fr10
306 set_fr_iimmed 0xfffe,0xfffe,fr11
308 test_fr_limmed 0xbfff,0xbfff,fr12
312 set_fr_iimmed 0x8000,0x8000,fr10
313 set_fr_iimmed 0x7fff,0x7fff,fr11
314 maveh.p fr10,fr10,fr12
316 test_fr_limmed 0x8000,0x8000,fr12
317 test_fr_limmed 0x7fff,0x7fff,fr13