1 /* Tests the MAC instructions.
3 Copyright (C) 2017-2019 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 # output: report(0x00000000);\n
20 # output: report(0x00000006);\n
21 # output: report(0x00000000);\n
22 # output: report(0x0000000c);\n
23 # output: report(0x00000001);\n
24 # output: report(0x00000000);\n
25 # output: report(0x40000000);\n
26 # output: report(0x00000000);\n
27 # output: report(0x00000000);\n
28 # output: report(0x00000000);\n
29 # output: report(0xffffffff);\n
30 # output: report(0x00000006);\n
31 # output: report(0x80000000);\n
32 # output: report(0x00000006);\n
33 # output: report(0x00000000);\n
34 # output: report(0x7ffffffe);\n
35 # output: report(0x00000000);\n
36 # output: report(0x80000000);\n
37 # output: report(0x00000001);\n
38 # output: report(0x00000000);\n
39 # output: report(0x7fffffff);\n
40 # output: report(0xffffffff);\n
41 # output: report(0x00000000);\n
42 # output: report(0x7ffffffd);\n
43 # output: report(0x00000000);\n
44 # output: report(0x00000000);\n
45 # output: report(0xffffffff);\n
46 # output: report(0x00000000);\n
47 # output: report(0x00000000);\n
48 # output: report(0x00000006);\n
49 # output: report(0x00000000);\n
50 # output: report(0x0000000c);\n
51 # output: report(0x00000000);\n
52 # output: report(0x00000005);\n
53 # output: report(0xffffffff);\n
54 # output: report(0xfffffffa);\n
55 # output: report(0x00000000);\n
56 # output: report(0x00000006);\n
57 # output: report(0x00000000);\n
58 # output: report(0xffffffff);\n
59 # output: report(0x7fffffff);\n
60 # output: report(0xfffffff9);\n
61 # output: report(0xffffffff);\n
62 # output: report(0xfffffff9);\n
63 # output: report(0xfffffffe);\n
64 # output: report(0xffffffff);\n
65 # output: report(0x80000000);\n
66 # output: report(0x00000000);\n
67 # output: report(0xffffffff);\n
68 # output: report(0x80000000);\n
69 # output: report(0xffffffff);\n
70 # output: report(0x80000006);\n
71 # output: report(0x00000000);\n
72 # output: report(0x00000000);\n
73 # output: report(0x7fffffff);\n
74 # output: report(0x7fffffff);\n
75 # output: report(0xffffffff);\n
76 # output: report(0x7fffffff);\n
77 # output: report(0xfffffffe);\n
78 # output: report(0xffffffff);\n
79 # output: report(0x80000000);\n
80 # output: report(0x00000000);\n
81 # output: report(0x00000000);\n
82 # output: report(0x00000006);\n
83 # output: report(0x00000000);\n
84 # output: report(0x0000000c);\n
85 # output: report(0x00000001);\n
86 # output: report(0x00000000);\n
87 # output: report(0x40000000);\n
88 # output: report(0x00000000);\n
89 # output: report(0x00000000);\n
90 # output: report(0x00000000);\n
91 # output: report(0xffffffff);\n
92 # output: report(0x00000006);\n
93 # output: report(0x80000000);\n
94 # output: report(0x00000006);\n
95 # output: report(0x00000000);\n
96 # output: report(0x7ffffffe);\n
97 # output: report(0x00000000);\n
98 # output: report(0x80000000);\n
99 # output: report(0x00000001);\n
100 # output: report(0x00000000);\n
101 # output: report(0x7fffffff);\n
102 # output: report(0xffffffff);\n
103 # output: report(0x00000000);\n
104 # output: report(0x7ffffffd);\n
105 # output: report(0x00000000);\n
106 # output: report(0x00000000);\n
107 # output: report(0xffffffff);\n
108 # output: report(0x00000000);\n
109 # output: report(0x00000000);\n
110 # output: report(0x00000006);\n
111 # output: report(0x00000000);\n
112 # output: report(0x0000000c);\n
113 # output: report(0x00000000);\n
114 # output: report(0x00000005);\n
115 # output: report(0xffffffff);\n
116 # output: report(0xfffffffa);\n
117 # output: report(0x00000000);\n
118 # output: report(0x00000006);\n
119 # output: report(0x00000000);\n
120 # output: report(0xffffffff);\n
121 # output: report(0x7fffffff);\n
122 # output: report(0xfffffff9);\n
123 # output: report(0xffffffff);\n
124 # output: report(0xfffffff9);\n
125 # output: report(0xfffffffe);\n
126 # output: report(0xffffffff);\n
127 # output: report(0x80000000);\n
128 # output: report(0x00000000);\n
129 # output: report(0xffffffff);\n
130 # output: report(0x80000000);\n
131 # output: report(0xffffffff);\n
132 # output: report(0x80000006);\n
133 # output: report(0x00000000);\n
134 # output: report(0x00000000);\n
135 # output: report(0x7fffffff);\n
136 # output: report(0x7fffffff);\n
137 # output: report(0xffffffff);\n
138 # output: report(0x7fffffff);\n
139 # output: report(0xfffffffe);\n
140 # output: report(0xffffffff);\n
141 # output: report(0x80000000);\n
142 # output: report(0x00000000);\n
143 # output: report(0x00000006);\n
144 # output: report(0x0000000c);\n
145 # output: report(0x00000000);\n
146 # output: report(0x00000000);\n
147 # output: report(0x00000000);\n
148 # output: report(0x00000006);\n
149 # output: report(0x00000006);\n
150 # output: report(0x7ffffffe);\n
151 # output: report(0x80000000);\n
152 # output: report(0x00000000);\n
153 # output: report(0xffffffff);\n
154 # output: report(0x7ffffffd);\n
155 # output: report(0x00000000);\n
156 # output: report(0x00000000);\n
157 # output: report(0x00000006);\n
158 # output: report(0x0000000c);\n
159 # output: report(0x00000005);\n
160 # output: report(0xfffffffa);\n
161 # output: report(0x00000006);\n
162 # output: report(0xffffffff);\n
163 # output: report(0xfffffff9);\n
164 # output: report(0xfffffff9);\n
165 # output: report(0xffffffff);\n
166 # output: report(0x00000000);\n
167 # output: report(0x80000000);\n
168 # output: report(0x80000006);\n
169 # output: report(0x00000000);\n
170 # output: report(0x7fffffff);\n
171 # output: report(0x7fffffff);\n
172 # output: report(0xffffffff);\n
173 # output: report(0x00000000);\n
174 # output: report(0xffffffff);\n
175 # output: report(0xfffffffa);\n
176 # output: report(0x00000000);\n
177 # output: report(0x00000006);\n
178 # output: report(0x00000000);\n
179 # output: report(0xfffffffa);\n
180 # output: report(0x3fffffff);\n
181 # output: report(0xfffffffa);\n
182 # output: report(0xffffffff);\n
183 # output: report(0xfffffff4);\n
184 # output: report(0xfffffffe);\n
185 # output: report(0xffffffff);\n
186 # output: report(0x80000000);\n
187 # output: report(0x00000000);\n
188 # output: report(0xffffffff);\n
189 # output: report(0x80000002);\n
190 # output: report(0xffffffff);\n
191 # output: report(0x80000004);\n
192 # output: report(0x00000000);\n
193 # output: report(0x00000004);\n
194 # output: report(0x7ffffffe);\n
195 # output: report(0xffffffff);\n
196 # output: report(0xffffffff);\n
197 # output: report(0x80000001);\n
198 # output: report(0xffffffff);\n
199 # output: report(0x00000004);\n
200 # output: report(0xfffffffe);\n
201 # output: report(0x00000004);\n
202 # output: report(0x00000000);\n
203 # output: report(0x00000000);\n
204 # output: report(0x00000000);\n
205 # output: report(0x00000006);\n
206 # output: report(0xffffffff);\n
207 # output: report(0xfffffff9);\n
208 # output: report(0x00000000);\n
209 # output: report(0x00000006);\n
210 # output: report(0x00000000);\n
211 # output: report(0x0000000c);\n
212 # output: report(0x00000001);\n
213 # output: report(0x00000005);\n
214 # output: report(0x7fffffff);\n
215 # output: report(0xffffffff);\n
216 # output: report(0xffffffff);\n
217 # output: report(0xffffffff);\n
218 # output: report(0xffffffff);\n
219 # output: report(0x00000005);\n
220 # output: report(0x80000000);\n
221 # output: report(0x00000006);\n
222 # output: report(0x00000000);\n
223 # output: report(0x80000000);\n
224 # output: report(0x00000000);\n
225 # output: report(0x80000006);\n
226 # output: report(0x00000001);\n
227 # output: report(0x00000000);\n
228 # output: report(0x7fffffff);\n
229 # output: report(0xffffffff);\n
230 # output: report(0x00000000);\n
231 # output: report(0x7fffffff);\n
232 # output: report(0xffffffff);\n
233 # output: report(0x7fffffff);\n
234 # output: report(0x80000000);\n
235 # output: report(0x80000000);\n
238 #include "or1k-asm-test-helpers.h"
240 .macro TEST_MACRC mac_hi, mac_lo, op1, op2
241 LOAD_IMMEDIATE r2, \mac_hi
242 MOVE_TO_SPR SPR_MACHI, r2
243 LOAD_IMMEDIATE r2, \mac_lo
244 MOVE_TO_SPR SPR_MACLO, r2
245 LOAD_IMMEDIATE r5, \op1
246 LOAD_IMMEDIATE r6, \op2
249 REPORT_REG_TO_CONSOLE r3
252 .macro TEST_MAC mac_hi, mac_lo, op1, op2
253 LOAD_IMMEDIATE r2, \mac_hi
254 MOVE_TO_SPR SPR_MACHI, r2
255 LOAD_IMMEDIATE r2, \mac_lo
256 MOVE_TO_SPR SPR_MACLO, r2
257 LOAD_IMMEDIATE r5, \op1
258 LOAD_IMMEDIATE r6, \op2
260 MOVE_FROM_SPR r3, SPR_MACHI
261 REPORT_REG_TO_CONSOLE r3
262 MOVE_FROM_SPR r3, SPR_MACLO
263 REPORT_REG_TO_CONSOLE r3
266 .macro TEST_MACI mac_hi, mac_lo, op1, op2_immediate
267 LOAD_IMMEDIATE r2, \mac_hi
268 MOVE_TO_SPR SPR_MACHI, r2
269 LOAD_IMMEDIATE r2, \mac_lo
270 MOVE_TO_SPR SPR_MACLO, r2
271 LOAD_IMMEDIATE r5, \op1
272 l.maci r5, \op2_immediate
273 MOVE_FROM_SPR r3, SPR_MACHI
274 REPORT_REG_TO_CONSOLE r3
275 MOVE_FROM_SPR r3, SPR_MACLO
276 REPORT_REG_TO_CONSOLE r3
279 .macro TEST_MSB mac_hi, mac_lo, op1, op2
280 LOAD_IMMEDIATE r2, \mac_hi
281 MOVE_TO_SPR SPR_MACHI, r2
282 LOAD_IMMEDIATE r2, \mac_lo
283 MOVE_TO_SPR SPR_MACLO, r2
284 LOAD_IMMEDIATE r5, \op1
285 LOAD_IMMEDIATE r6, \op2
287 MOVE_FROM_SPR r3, SPR_MACHI
288 REPORT_REG_TO_CONSOLE r3
289 MOVE_FROM_SPR r3, SPR_MACLO
290 REPORT_REG_TO_CONSOLE r3
293 STANDARD_TEST_ENVIRONMENT
297 PUSH LINK_REGISTER_R9
299 /* Test the l.mac instruction. */
301 /* two small positive numbers */
303 /* MAC two small positive numbers on a zero total */
304 TEST_MAC 0x00000000, 0x00000000, 0x00000002, 0x00000003
306 /* MAC two small positive numbers on a small positive total */
307 TEST_MAC 0x00000000, 0x00000006, 0x00000002, 0x00000003,
309 /* MAC two small positive numbers on a moderate positive total */
310 TEST_MAC 0x00000000, 0xfffffffa, 0x00000002, 0x00000003
312 /* MAC two small positive numbers on a large positive total */
313 TEST_MAC 0x3fffffff, 0xfffffffa, 0x00000002, 0x00000003
315 /* MAC two small positive numbers on a small negative total */
316 TEST_MAC 0xffffffff, 0xfffffffa, 0x00000002, 0x00000003
318 /* MAC two small positive numbers on a moderate negative total */
319 TEST_MAC 0xffffffff, 0x00000000, 0x00000002, 0x00000003
321 /* MAC two small positive numbers on a large negative total */
322 TEST_MAC 0x80000000, 0x00000000, 0x00000002, 0x00000003
324 /* two moderate positive numbers */
326 /* MAC two moderate positive numbers on a zero total */
327 TEST_MAC 0x00000000, 0x00000000, 0x00008001, 0x0000fffe
329 /* MAC two moderate positive numbers on a small positive total */
330 TEST_MAC 0x00000000, 0x00000002, 0x00008001, 0x0000fffe
332 /* MAC two moderate positive numbers on a moderate positive total */
333 TEST_MAC 0x00000000, 0x80000002, 0x00008001, 0x0000fffe
335 /* MAC two moderate positive numbers on a large positive total */
336 TEST_MAC 0x7fffffff, 0x80000001, 0x00008001, 0x0000fffe
338 /* MAC two moderate positive numbers on a small negative total */
339 TEST_MAC 0xffffffff, 0xffffffff, 0x00008001, 0x0000fffe
341 /* MAC two moderate positive numbers on a moderate negative total */
342 TEST_MAC 0xffffffff, 0x80000002, 0x00008001, 0x0000fffe
344 /* MAC two moderate positive numbers on a large negative total */
345 TEST_MAC 0xfffffffe, 0x80000002, 0x00008001, 0x0000fffe
347 /* two small negative numbers */
349 /* MAC two small negative numbers on a zero total */
350 TEST_MAC 0x00000000, 0x00000000, 0xfffffffe, 0xfffffffd
352 /* MAC two small negative numbers on a small positive total */
353 TEST_MAC 0x00000000, 0x00000006, 0xfffffffe, 0xfffffffd
355 /* MAC two small negative numbers on a small negative total */
356 TEST_MAC 0xffffffff, 0xffffffff, 0xfffffffe, 0xfffffffd
358 /* one small positive and one small negative */
360 /* MAC one small positive and one small negative number on a zero
362 TEST_MAC 0x00000000, 0x00000000, 0x00000002, 0xfffffffd
364 /* MAC one small positive and one small negative number on a small
366 TEST_MAC 0x00000000, 0x0000000c, 0x00000002, 0xfffffffd
368 /* MAC one small positive and one small negative number on a
369 moderate positive total */
370 TEST_MAC 0x00000001, 0x00000005, 0x00000002, 0xfffffffd
372 /* MAC one small positive and one small negative number on a large
374 TEST_MAC 0x7fffffff, 0xffffffff, 0x00000002, 0xfffffffd
376 /* MAC one small positive and one small negative number on a small
378 TEST_MAC 0xffffffff, 0xffffffff, 0x00000002, 0xfffffffd
380 /* MAC one small positive and one small negative number on a
381 moderate negative total */
382 TEST_MAC 0xffffffff, 0x00000005, 0x00000002, 0xfffffffd
384 /* MAC one small positive and one small negative number on a large
386 TEST_MAC 0x80000000, 0x00000006, 0x00000002, 0xfffffffd
388 /* one moderate positive and one moderate negative number */
390 /* MAC one moderate positive and one moderate negative number on a
392 TEST_MAC 0x00000000, 0x00000000, 0x00008000, 0xffff0000
394 /* MAC one moderate positive and one moderate negative number on a
395 small positive total */
396 TEST_MAC 0x00000000, 0x00000006, 0x00008000, 0xffff0000
398 /* MAC one moderate positive and one moderate negative number on a
399 moderate positive total */
400 TEST_MAC 0x00000000, 0x80000000, 0x00008000, 0xffff0000
402 /* MAC one moderate positive and one moderate negative number on a
403 large positive total */
404 TEST_MAC 0x7fffffff, 0xffffffff, 0x00008000, 0xffff0000
406 /* MAC one moderate positive and one moderate negative number on a
407 small negative total */
408 TEST_MAC 0xffffffff, 0xffffffff, 0x00008000, 0xffff0000
410 /* MAC one moderate positive and one moderate negative number on a
411 moderate negative total */
412 TEST_MAC 0xffffffff, 0x7fffffff, 0x00008000, 0xffff0000
414 /* MAC one moderate positive and one moderate negative number on a
415 large negative total */
416 TEST_MAC 0x80000000, 0x80000000, 0x00008000, 0xffff0000
418 /* Test the l.maci instruction. */
420 /* two small positive numbers */
422 /* MAC two small positive numbers on a zero total */
423 TEST_MACI 0x00000000, 0x00000000, 0x00000002, 0x0003
425 /* MAC two small positive numbers on a small positive total */
426 TEST_MACI 0x00000000, 0x00000006, 0x00000002, 0x0003
428 /* MAC two small positive numbers on a moderate positive total */
429 TEST_MACI 0x00000000, 0xfffffffa, 0x00000002, 0x0003
431 /* MAC two small positive numbers on a large positive total */
432 TEST_MACI 0x3fffffff, 0xfffffffa, 0x00000002, 0x0003
434 /* MAC two small positive numbers on a small negative total */
435 TEST_MACI 0xffffffff, 0xfffffffa, 0x00000002, 0x0003
437 /* MAC two small positive numbers on a moderate negative total */
438 TEST_MACI 0xffffffff, 0x00000000, 0x00000002, 0x0003
440 /* MAC two small positive numbers on a large negative total */
441 TEST_MACI 0x80000000, 0x00000000, 0x00000002, 0x0003
443 /* two moderate positive numbers */
445 /* MAC two moderate positive numbers on a zero total */
446 TEST_MACI 0x00000000, 0x00000000, 0x00010002, 0x7fff
448 /* MAC two moderate positive numbers on a small positive total */
449 TEST_MACI 0x00000000, 0x00000002, 0x00010002, 0x7fff
451 /* MAC two moderate positive numbers on a moderate positive total */
452 TEST_MACI 0x00000000, 0x80000002, 0x00010002, 0x7fff
454 /* MAC two moderate positive numbers on a large positive total */
455 TEST_MACI 0x7fffffff, 0x80000001, 0x00010002, 0x7fff
457 /* MAC two moderate positive numbers on a small negative total */
458 TEST_MACI 0xffffffff, 0xffffffff, 0x00010002, 0x7fff
460 /* MAC two moderate positive numbers on a moderate negative total */
461 TEST_MACI 0xffffffff, 0x80000002, 0x00010002, 0x7fff
463 /* MAC two moderate positive numbers on a large negative total */
464 TEST_MACI 0xfffffffe, 0x80000002, 0x00010002, 0x7fff
466 /* two small negative numbers */
468 /* MAC two small negative numbers on a zero total */
469 TEST_MACI 0x00000000, 0x00000000, 0xfffffffe, 0xfffd
471 /* MAC two small negative numbers on a small positive total */
472 TEST_MACI 0x00000000, 0x00000006, 0xfffffffe, 0xfffd
474 /* MAC two small negative numbers on a small negative total */
475 TEST_MACI 0xffffffff, 0xffffffff, 0xfffffffe, 0xfffd
477 /* one small positive and one small negative */
479 /* MAC one small positive and one small negative number on a zero
481 TEST_MACI 0x00000000, 0x00000000, 0x00000002, 0xfffd
483 /* MAC one small positive and one small negative number on a small
485 TEST_MACI 0x00000000, 0x0000000c, 0x00000002, 0xfffd
487 /* MAC one small positive and one small negative number on a
488 moderate positive total */
489 TEST_MACI 0x00000001, 0x00000005, 0x00000002, 0xfffd
491 /* MAC one small positive and one small negative number on a large
493 TEST_MACI 0x7fffffff, 0xffffffff, 0x00000002, 0xfffd
495 /* MAC one small positive and one small negative number on a small
497 TEST_MACI 0xffffffff, 0xffffffff, 0x00000002, 0xfffd
499 /* MAC one small positive and one small negative number on a
500 moderate negative total */
501 TEST_MACI 0xffffffff, 0x00000005, 0x00000002, 0xfffd
503 /* MAC one small positive and one small negative number on a large
505 TEST_MACI 0x80000000, 0x00000006, 0x00000002, 0xfffd
507 /* one moderate positive and one moderate negative */
509 /* MAC one moderate positive and one moderate negative number on a
511 TEST_MACI 0x00000000, 0x00000000, 0x00010000, 0x8000
513 /* MAC one moderate positive and one moderate negative number on a
514 small positive total */
515 TEST_MACI 0x00000000, 0x00000006, 0x00010000, 0x8000
517 /* MAC one moderate positive and one moderate negative number on a
518 moderate positive total */
519 TEST_MACI 0x00000000, 0x80000000, 0x00010000, 0x8000
521 /* MAC one moderate positive and one moderate negative number on a
522 large positive total */
523 TEST_MACI 0x7fffffff, 0xffffffff, 0x00010000, 0x8000
525 /* MAC one moderate positive and one moderate negative number on a
526 small negative total */
527 TEST_MACI 0xffffffff, 0xffffffff, 0x00010000, 0x8000
529 /* MAC one moderate positive and one moderate negative number on a
530 moderate negative total */
531 TEST_MACI 0xffffffff, 0x7fffffff, 0x00010000, 0x8000
533 /* MAC one moderate positive and one moderate negative number on a
534 large negative total */
535 TEST_MACI 0x80000000, 0x80000000, 0x00010000, 0x8000
537 /* Test the l.macrc instruction.
539 Note that these tests use the same input data as the ones for
540 l.mac above. The results are the same, but only the low 32-bits
543 /* two small positive numbers */
545 /* MAC two small positive numbers on a zero total */
546 TEST_MACRC 0x00000000, 0x00000000, 0x00000002, 0x00000003
548 /* MAC two small positive numbers on a small positive total */
549 TEST_MACRC 0x00000000, 0x00000006, 0x00000002, 0x00000003
551 /* MAC two small positive numbers on a moderate positive total */
552 TEST_MACRC 0x00000000, 0xfffffffa, 0x00000002, 0x00000003
554 /* MAC two small positive numbers on a large positive total */
555 TEST_MACRC 0x3fffffff, 0xfffffffa, 0x00000002, 0x00000003
557 /* MAC two small positive numbers on a small negative total */
558 TEST_MACRC 0xffffffff, 0xfffffffa, 0x00000002, 0x00000003
560 /* MAC two small positive numbers on a moderate negative total */
561 TEST_MACRC 0xffffffff, 0x00000000, 0x00000002, 0x00000003
563 /* MAC two small positive numbers on a large negative total */
564 TEST_MACRC 0x80000000, 0x00000000, 0x00000002, 0x00000003
566 /* two moderate positive numbers */
568 /* MAC two moderate positive numbers on a zero total */
569 TEST_MACRC 0x00000000, 0x00000000, 0x00008001, 0x0000fffe
571 /* MAC two moderate positive numbers on a small positive total */
572 TEST_MACRC 0x00000000, 0x00000002, 0x00008001, 0x0000fffe
574 /* MAC two moderate positive numbers on a moderate positive total */
575 TEST_MACRC 0x00000000, 0x80000002, 0x00008001, 0x0000fffe
577 /* MAC two moderate positive numbers on a large positive total */
578 TEST_MACRC 0x7fffffff, 0x80000001, 0x00008001, 0x0000fffe
580 /* MAC two moderate positive numbers on a small negative total */
581 TEST_MACRC 0xffffffff, 0xffffffff, 0x00008001, 0x0000fffe
583 /* MAC two moderate positive numbers on a moderate negative total */
584 TEST_MACRC 0xffffffff, 0x80000002, 0x00008001, 0x0000fffe
586 /* MAC two moderate positive numbers on a large negative total */
587 TEST_MACRC 0xfffffffe, 0x80000002, 0x00008001, 0x0000fffe
589 /* two small negative numbers */
591 /* MAC two small negative numbers on a zero total */
592 TEST_MACRC 0x00000000, 0x00000000, 0xfffffffe, 0xfffffffd
594 /* MAC two small negative numbers on a small positive total */
595 TEST_MACRC 0x00000000, 0x00000006, 0xfffffffe, 0xfffffffd
597 /* MAC two small negative numbers on a small negative total */
598 TEST_MACRC 0xffffffff, 0xffffffff, 0xfffffffe, 0xfffffffd
600 /* one small positive and one small negative number */
602 /* MAC one small positive and one small negative number on a zero
604 TEST_MACRC 0x00000000, 0x00000000, 0x00000002, 0xfffffffd
606 /* MAC one small positive and one small negative number on a small
608 TEST_MACRC 0x00000000, 0x0000000c, 0x00000002, 0xfffffffd
610 /* MAC one small positive and one small negative number on a
611 moderate positive total */
612 TEST_MACRC 0x00000001, 0x00000005, 0x00000002, 0xfffffffd
614 /* MAC one small positive and one small negative number on a large
616 TEST_MACRC 0x7fffffff, 0xffffffff, 0x00000002, 0xfffffffd
618 /* MAC one small positive and one small negative number on a small
620 TEST_MACRC 0xffffffff, 0xffffffff, 0x00000002, 0xfffffffd
622 /* MAC one small positive and one small negative number on a
623 moderate negative total */
624 TEST_MACRC 0xffffffff, 0x00000005, 0x00000002, 0xfffffffd
626 /* MAC one small positive and one small negative number on a large
628 TEST_MACRC 0x80000000, 0x00000006, 0x00000002, 0xfffffffd
630 /* one moderate positive and one moderate negative */
632 /* MAC one moderate positive and one moderate negative number on a
634 TEST_MACRC 0x00000000, 0x00000000, 0x00008000, 0xffff0000
636 /* MAC one moderate positive and one moderate negative number on a
637 small positive total */
638 TEST_MACRC 0x00000000, 0x00000006, 0x00008000, 0xffff0000
640 /* MAC one moderate positive and one moderate negative number on a
641 moderate positive total */
642 TEST_MACRC 0x00000000, 0x80000000, 0x00008000, 0xffff0000
644 /* MAC one moderate positive and one moderate negative number on a
645 large positive total */
646 TEST_MACRC 0x7fffffff, 0xffffffff, 0x00008000, 0xffff0000
648 /* MAC one moderate positive and one moderate negative number on a
649 small negative total */
650 TEST_MACRC 0xffffffff, 0xffffffff, 0x00008000, 0xffff0000
652 /* MAC one moderate positive and one moderate negative number on a
653 moderate negative total */
654 TEST_MACRC 0xffffffff, 0x7fffffff, 0x00008000, 0xffff0000
656 /* MAC one moderate positive and one moderate negative number on a
657 large negative total */
658 TEST_MACRC 0x80000000, 0x80000000, 0x00008000, 0xffff0000
660 /* Test the l.msb instruction. */
662 /* MSB two small positive numbers on a zero total */
663 TEST_MSB 0x00000000, 0x00000000, 0x00000002, 0x00000003
665 /* MSB two small positive numbers on a small positive total */
666 TEST_MSB 0x00000000, 0x0000000c, 0x00000002, 0x00000003
668 /* MSB two small positive numbers on a moderate positive total */
669 TEST_MSB 0x00000001, 0x00000000, 0x00000002, 0x00000003
671 /* MSB two small positive numbers on a large positive total */
672 TEST_MSB 0x40000000, 0x00000000, 0x00000002, 0x00000003
674 /* MSB two small positive numbers on a small negative total */
675 TEST_MSB 0xffffffff, 0xfffffffa, 0x00000002, 0x00000003
677 /* MSB two small positive numbers on a moderate negative total */
678 TEST_MSB 0xffffffff, 0x00000005, 0x00000002, 0x00000003
680 /* MSB two small positive numbers on a large negative total */
681 TEST_MSB 0x80000000, 0x00000006, 0x00000002, 0x00000003
683 /* two moderate positive numbers */
685 /* MSB two moderate positive numbers on a zero total */
686 TEST_MSB 0x00000000, 0x00000000, 0x00008001, 0x0000fffe
688 /* MSB two moderate positive numbers on a small positive total */
689 TEST_MSB 0x00000000, 0x00000002, 0x00008001, 0x0000fffe
691 /* MSB two moderate positive numbers on a moderate positive total */
692 TEST_MSB 0x00000000, 0x80000002, 0x00008001, 0x0000fffe
694 /* MSB two moderate positive numbers on a large positive total */
695 TEST_MSB 0x7fffffff, 0x7ffffffd, 0x00008001, 0x0000fffe
697 /* MSB two moderate positive numbers on a small negative total */
698 TEST_MSB 0xffffffff, 0xffffffff, 0x00008001, 0x0000fffe
700 /* MSB two moderate positive numbers on a moderate negative total */
701 TEST_MSB 0xffffffff, 0x80000002, 0x00008001, 0x0000fffe
703 /* MSB two moderate positive numbers on a large negative total */
704 TEST_MSB 0xfffffffe, 0x80000002, 0x00008001, 0x0000fffe
706 /* two small negative numbers */
708 /* MSB two small negative numbers on a zero total */
709 TEST_MSB 0x00000000, 0x00000006, 0xfffffffe, 0xfffffffd
711 /* MSB two small negative numbers on a small positive total */
712 TEST_MSB 0x00000000, 0x0000000c, 0xfffffffe, 0xfffffffd
714 /* MSB two small negative numbers on a small negative total */
715 TEST_MSB 0xffffffff, 0xffffffff, 0xfffffffe, 0xfffffffd
717 /* one small positive and one small negative number */
719 /* MSB one small positive and one small negative number on a zero
721 TEST_MSB 0x00000000, 0x00000000, 0x00000002, 0xfffffffd
723 /* MSB one small positive and one small negative number on a small
725 TEST_MSB 0x00000000, 0x00000006, 0x00000002, 0xfffffffd
727 /* MSB one small positive and one small negative number on a
728 moderate positive total */
729 TEST_MSB 0x00000000, 0xffffffff, 0x00000002, 0xfffffffd
731 /* MSB one small positive and one small negative number on a large
733 TEST_MSB 0x7fffffff, 0xfffffff9, 0x00000002, 0xfffffffd
735 /* MSB one small positive and one small negative number on a small
737 TEST_MSB 0xffffffff, 0xfffffff9, 0x00000002, 0xfffffffd
739 /* MSB one small positive and one small negative number on a
740 moderate negative total */
741 TEST_MSB 0xfffffffe, 0xffffffff, 0x00000002, 0xfffffffd
743 /* MSB one small positive and one small negative number on a large
745 TEST_MSB 0x80000000, 0x00000000, 0x00000002, 0xfffffffd
747 /* one moderate positive and one moderate negative number */
749 /* MSB one moderate positive and one moderate negative number on a
751 TEST_MSB 0x00000000, 0x00000000, 0x00008000, 0xffff0000
753 /* MSB one moderate positive and one moderate negative number on a
754 small positive total */
755 TEST_MSB 0x00000000, 0x00000006, 0x00008000, 0xffff0000
757 /* MSB one moderate positive and one moderate negative number on a
758 moderate positive total */
759 TEST_MSB 0x00000000, 0x80000000, 0x00008000, 0xffff0000
761 /* MSB one moderate positive and one moderate negative number on a
762 large positive total */
763 TEST_MSB 0x7fffffff, 0x7fffffff, 0x00008000, 0xffff0000
765 /* MSB one moderate positive and one moderate negative number on a
766 small negative total */
767 TEST_MSB 0xffffffff, 0xffffffff, 0x00008000, 0xffff0000
769 /* MSB one moderate positive and one moderate negative number on a
770 moderate negative total */
771 TEST_MSB 0xfffffffe, 0xffffffff, 0x00008000, 0xffff0000
773 /* MSB one moderate positive and one moderate negative number on a
774 large negative total */
775 TEST_MSB 0x80000000, 0x00000000, 0x00008000, 0xffff0000
778 RETURN_TO_LINK_REGISTER_R9