1 # frv testcase for smsss $GRi,$GRj
4 .include "../testutils.inc"
11 set_gr_immed 3,gr7 ; multiply small numbers
13 set_spr_immed 0,iacc0h
14 set_spr_immed 7,iacc0l
18 test_spr_immed 1,iacc0l ; result 7-3*2
19 test_spr_immed 0,iacc0h
21 set_gr_immed 1,gr7 ; multiply by 1
23 set_spr_immed 0,iacc0h
24 set_spr_immed 3,iacc0l
28 test_spr_immed 1,iacc0l ; result 3-1*2
29 test_spr_immed 0,iacc0h
31 set_gr_immed 2,gr7 ; multiply by 1
33 set_spr_immed 0,iacc0h
34 set_spr_immed 3,iacc0l
38 test_spr_immed 1,iacc0l ; result 3-2*1
39 test_spr_immed 0,iacc0h
41 set_gr_immed 0,gr7 ; multiply by 0
43 set_spr_immed 0,iacc0h
44 set_spr_immed 1,iacc0l
48 test_spr_immed 1,iacc0l ; result 1-0*2
49 test_spr_immed 0,iacc0h
51 set_gr_immed 2,gr7 ; multiply by 0
53 set_spr_immed 0,iacc0h
54 set_spr_immed 1,iacc0l
58 test_spr_immed 1,iacc0l ; result 1-2*0
59 test_spr_immed 0,iacc0h
61 set_gr_limmed 0x3fff,0xffff,gr7 ; 31 bit result
63 set_spr_immed -1,iacc0h
64 set_spr_immed -1,iacc0l
67 test_gr_limmed 0x3fff,0xffff,gr7
68 test_spr_limmed 0x8000,0x0001,iacc0l ; -1-3fffffff*2
69 test_spr_immed -1,iacc0h
71 set_gr_limmed 0x4000,0x0000,gr7 ; 32 bit result
73 set_spr_immed -1,iacc0h
74 set_spr_limmed 0x8000,0x0001,iacc0l
77 test_gr_limmed 0x4000,0x0000,gr7
78 test_spr_immed 1,iacc0l ; ffffffff80000001-40000000*2
79 test_spr_immed -1,iacc0h
81 set_gr_limmed 0x4000,0x0000,gr7 ; 33 bit result
83 set_spr_immed -1,iacc0h
84 set_spr_immed 1,iacc0l
87 test_gr_limmed 0x4000,0x0000,gr7
88 test_spr_immed 1,iacc0l ; ffffffff00000001-40000000*4
89 test_spr_immed -2,iacc0h
91 set_gr_limmed 0x7fff,0xffff,gr7 ; max positive result
92 set_gr_limmed 0x7fff,0xffff,gr8
93 set_spr_limmed 0x7fff,0xffff,iacc0h
94 set_spr_immed -1,iacc0l
96 test_gr_limmed 0x7fff,0xffff,gr8
97 test_gr_limmed 0x7fff,0xffff,gr7
98 test_spr_limmed 0xffff,0xfffe,iacc0l ; 7fffffffffffffff-7fffffff*7fffffff
99 test_spr_limmed 0x4000,0x0000,iacc0h
102 set_gr_immed -3,gr7 ; multiply small numbers
104 set_spr_immed -1,iacc0h
105 set_spr_immed -5,iacc0l
109 test_spr_immed 1,iacc0l ; -5-(-3*2)
110 test_spr_immed 0,iacc0h
112 set_gr_immed 3,gr7 ; multiply small numbers
114 set_spr_immed -1,iacc0h
115 set_spr_immed -5,iacc0l
119 test_spr_immed 1,iacc0l ; -5-(3*-2)
120 test_spr_immed 0,iacc0h
122 set_gr_immed 1,gr7 ; multiply by 1
124 set_spr_immed -1,iacc0h
125 set_spr_immed -1,iacc0l
129 test_spr_immed 1,iacc0l ; -1-(1*-2)
130 test_spr_immed 0,iacc0h
132 set_gr_immed -2,gr7 ; multiply by 1
134 set_spr_immed -1,iacc0h
135 set_spr_immed -1,iacc0l
139 test_spr_immed 1,iacc0l ; -1-(-2*1)
140 test_spr_immed 0,iacc0h
142 set_gr_immed 0,gr7 ; multiply by 0
144 set_spr_immed 0,iacc0h
145 set_spr_immed 1,iacc0l
149 test_spr_immed 1,iacc0l ; 1-(0*-2)
150 test_spr_immed 0,iacc0h
152 set_gr_immed -2,gr7 ; multiply by 0
154 set_spr_immed 0,iacc0h
155 set_spr_immed 1,iacc0l
159 test_spr_immed 1,iacc0l ; 1-(-2*0)
160 test_spr_immed 0,iacc0h
162 set_gr_limmed 0x2000,0x0000,gr7 ; 31 bit result
164 set_spr_immed 0,iacc0h
165 set_spr_limmed 0x3fff,0xffff,iacc0l
168 test_gr_limmed 0x2000,0x0000,gr7
169 test_spr_limmed 0x7fff,0xffff,iacc0l
170 test_spr_immed 0,iacc0h ; 3fffffff-20000001*-2
172 set_gr_limmed 0x4000,0x0000,gr7 ; 32 bit result
174 set_spr_immed 0,iacc0h
175 set_spr_immed 1,iacc0l
178 test_gr_limmed 0x4000,0x0000,gr7
179 test_spr_limmed 0x8000,0x0001,iacc0l ; 1-40000000*-2
180 test_spr_immed 0,iacc0h
182 set_gr_limmed 0x4000,0x0000,gr7 ; 32 bit result
184 set_spr_immed -1,iacc0h
185 set_spr_immed -1,iacc0l
188 test_gr_limmed 0x4000,0x0000,gr7
189 test_spr_limmed 0x7fff,0xffff,iacc0l
190 test_spr_immed 0,iacc0h ; -1-40000000*-2
192 set_gr_limmed 0x4000,0x0000,gr7 ; 33 bit result
194 set_spr_immed 0,iacc0h
195 set_spr_immed 1,iacc0l
198 test_gr_limmed 0x4000,0x0000,gr7
199 test_spr_immed 1,iacc0l ; 200000001-(40000000*-4)
200 test_spr_immed 1,iacc0h
202 set_gr_limmed 0x7fff,0xffff,gr7 ; max negative result
203 set_gr_limmed 0x7fff,0xffff,gr8
204 set_spr_limmed 0xbfff,0xffff,iacc0h
205 set_spr_limmed 0x0000,0x0001,iacc0l
207 test_gr_limmed 0x7fff,0xffff,gr8
208 test_gr_limmed 0x7fff,0xffff,gr7
209 test_spr_immed 0,iacc0l ; bfffffff00000001-(7fffffff*7fffffff)
210 test_spr_limmed 0x8000,0x0000,iacc0h
213 set_gr_immed -3,gr7 ; multiply small numbers
215 set_spr_immed 0,iacc0h
216 set_spr_immed 7,iacc0l
220 test_spr_immed 1,iacc0l ; 7-(-3*-2)
221 test_spr_immed 0,iacc0h
223 set_gr_immed -1,gr7 ; multiply by 1
225 set_spr_immed 0,iacc0h
226 set_spr_immed 3,iacc0l
230 test_spr_immed 1,iacc0l ; 3-(-1*-2)
231 test_spr_immed 0,iacc0h
233 set_gr_immed -2,gr7 ; multiply by 1
235 set_spr_immed 0,iacc0h
236 set_spr_immed 3,iacc0l
240 test_spr_immed 1,iacc0l ; 3-(-2*-1)
241 test_spr_immed 0,iacc0h
243 set_gr_immed -32768,gr7 ; 31 bit result
244 set_gr_immed -32768,gr8
245 set_spr_immed 0,iacc0h
246 set_spr_limmed 0xbfff,0xffff,iacc0l
248 test_gr_immed -32768,gr8
249 test_gr_immed -32768,gr7
250 test_spr_limmed 0x7fff,0xffff,iacc0l ; 7ffffffb-(-2*-2)
251 test_spr_immed 0,iacc0h
253 set_gr_immed 0xffff,gr7 ; 32 bit result
254 set_gr_immed 0xffff,gr8
255 set_spr_immed 1,iacc0h
256 set_spr_limmed 0xfffe,0x0000,iacc0l
258 test_gr_immed 0xffff,gr8
259 test_gr_immed 0xffff,gr7
260 test_spr_limmed 0xffff,0xffff,iacc0l ; 1fffe0000-ffff*ffff
261 test_spr_immed 0,iacc0h
263 set_gr_limmed 0x0001,0x0000,gr7 ; 33 bit result
264 set_gr_limmed 0x0001,0x0000,gr8
265 set_spr_immed 2,iacc0h
266 set_spr_immed 1,iacc0l
268 test_gr_limmed 0x0001,0x0000,gr8
269 test_gr_limmed 0x0001,0x0000,gr7
270 test_spr_immed 1,iacc0l ; 0x200000001-0x10000*0x10000
271 test_spr_immed 1,iacc0h
273 set_gr_immed -2,gr7 ; almost max positive result
275 set_spr_limmed 0x7fff,0xffff,iacc0h
276 set_spr_limmed 0xffff,0xffff,iacc0l
280 test_spr_limmed 0xffff,0xfffb,iacc0l ; maxpos - (-2*-2)
281 test_spr_limmed 0x7fff,0xffff,iacc0h
283 set_gr_immed 0,gr7 ; max positive result
285 set_spr_limmed 0x7fff,0xffff,iacc0h
286 set_spr_limmed 0xffff,0xffff,iacc0l
290 test_spr_limmed 0xffff,0xffff,iacc0l ; maxpos-(0*0)
291 test_spr_limmed 0x7fff,0xffff,iacc0h
293 set_gr_limmed 0x7fff,0xffff,gr7 ; not quite overflow (pos)
294 set_gr_limmed 0x8000,0x0000,gr8
295 set_spr_limmed 0x4000,0x0000,iacc0h
296 set_spr_limmed 0x7fff,0xffff,iacc0l
298 test_gr_limmed 0x8000,0x0000,gr8
299 test_gr_limmed 0x7fff,0xffff,gr7
300 test_spr_limmed 0xffff,0xffff,iacc0l ; 400000007fffffff -
301 test_spr_limmed 0x7fff,0xffff,iacc0h ; 0x80000000*0x7fffffff
303 set_gr_limmed 0x7fff,0xffff,gr7 ; just barely overflow (pos)
304 set_gr_limmed 0x8000,0x0000,gr8
305 set_spr_limmed 0x4000,0x0000,iacc0h
306 set_spr_limmed 0x8000,0x0000,iacc0l
308 test_gr_limmed 0x8000,0x0000,gr8
309 test_gr_limmed 0x7fff,0xffff,gr7
310 test_spr_limmed 0xffff,0xffff,iacc0l ; 4000000080000000 -
311 test_spr_limmed 0x7fff,0xffff,iacc0h ; 0x80000000*0x7fffffff
314 set_gr_limmed 0x7fff,0xffff,gr7 ; maximum overflow (pos)
315 set_gr_limmed 0x8000,0x0000,gr8
316 set_spr_limmed 0xffff,0xffff,iacc0l
317 set_spr_limmed 0x7fff,0xffff,iacc0h
319 test_gr_limmed 0x8000,0x0000,gr8
320 test_gr_limmed 0x7fff,0xffff,gr7
321 test_spr_limmed 0xffff,0xffff,iacc0l ; 7fffffffffffffff -
322 test_spr_limmed 0x7fff,0xffff,iacc0h ; 80000000*80000000
324 set_gr_limmed 0x7fff,0xffff,gr7 ; not quite overflow (neg)
325 set_gr_limmed 0x7fff,0xffff,gr8
326 set_spr_immed 1,iacc0l
327 set_spr_limmed 0xbfff,0xffff,iacc0h
329 test_gr_limmed 0x7fff,0xffff,gr8
330 test_gr_limmed 0x7fff,0xffff,gr7
331 test_spr_limmed 0x0000,0x0000,iacc0l ; bfffffff00000001 -
332 test_spr_limmed 0x8000,0x0000,iacc0h ; 0x7fffffff*0x7fffffff
334 set_gr_limmed 0x7fff,0xffff,gr7 ; just barely overflow (neg)
335 set_gr_limmed 0x7fff,0xffff,gr8
336 set_spr_immed 0,iacc0l
337 set_spr_limmed 0xbfff,0xffff,iacc0h
339 test_gr_limmed 0x7fff,0xffff,gr8
340 test_gr_limmed 0x7fff,0xffff,gr7
341 test_spr_limmed 0x0000,0x0000,iacc0l ; 7fffffff*7fffffff+
342 test_spr_limmed 0x8000,0x0000,iacc0h ; bfffffff7fffffff
344 set_gr_limmed 0x7fff,0xffff,gr7 ; maximum overflow (neg)
345 set_gr_limmed 0x7fff,0xffff,gr8
346 set_spr_limmed 0x0000,0x0000,iacc0l
347 set_spr_limmed 0x8000,0x0000,iacc0h
349 test_gr_limmed 0x7fff,0xffff,gr8
350 test_gr_limmed 0x7fff,0xffff,gr7
351 test_spr_limmed 0x0000,0x0000,iacc0l ; 8000000000000000-
352 test_spr_limmed 0x8000,0x0000,iacc0h ; 7fffffff*7fffffff+