5 #if (__mips_isa_rev < 6)
7 ADD
=0, ADDI
, ADDIU
, ADDU
,
9 DADDIU
, DADDU
, DCLO
, DCLZ
,
10 DDIV
, DDIVU
, DIV
, DIVU
,
11 DMULT
, DMULTU
, DSUB
, DSUBU
,
12 MADD
, MADDU
, MSUB
, MSUBU
,
13 MUL
, MULT
, MULTU
, MOVN
,
15 SLTI
, SLTIU
, SLTU
, SUB
,
23 DSUB
, DSUBU
, SUB
, SUBU
,
25 SLT
, SLTI
, SLTIU
, SLTU
36 for (op
= ADD
; op
<= SUBU
; op
++) {
37 for (i
= 0; i
< N
; i
++) {
40 /* If either GPR rt or GPR rs does not contain sign-extended
41 32-bit values (bits 63..31 equal), then the result of the
42 operation is UNPREDICTABLE. */
43 TEST1("add $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
47 #if (__mips_isa_rev < 6)
49 /* If GPR rs does not contain a sign-extended 32-bit
50 value (bits 63..31 equal), then the result of the operation
52 TEST2("addi $t0, $t1, 0xff", reg_val1
[i
], 0xff, t0
, t1
);
53 TEST2("addi $t2, $t3, 0xffff", reg_val1
[i
], 0xffff, t2
, t3
);
54 TEST2("addi $a0, $a1, 0x0", reg_val1
[i
], 0x0, a0
, a1
);
55 TEST2("addi $s0, $s1, 0x23", reg_val1
[i
], 0x23, s0
, s1
);
59 /* If GPR rs does not contain a sign-extended 32-bit
60 value (bits 63..31 equal), then the result of the operation
62 TEST2("addiu $t0, $t1, 0xff", reg_val1
[i
], 0xff, t0
, t1
);
63 TEST2("addiu $t2, $t3, 0xffff", reg_val1
[i
], 0xffff, t2
, t3
);
64 TEST2("addiu $a0, $a1, 0x0", reg_val1
[i
], 0x0, a0
, a1
);
65 TEST2("addiu $s0, $s1, 0x23", reg_val1
[i
], 0x23, s0
, s1
);
69 /* If either GPR rt or GPR rs does not contain sign-extended
70 32-bit values (bits 63..31 equal), then the result of the
71 operation is UNPREDICTABLE. */
72 TEST1("addu $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
77 /* If GPR rs does not contain a sign-extended 32-bit
78 value (bits 63..31 equal), then the results of the operation
80 TEST3("clo $t0, $t1", reg_val1
[i
], t0
, t1
);
84 /* If GPR rs does not contain a sign-extended 32-bit
85 value (bits 63..31 equal), then the results of the operation
87 TEST3("clz $t0, $t1", reg_val1
[i
], t0
, t1
);
91 /* If the addition results in 64-bit 2âs complement arithmetic
92 overflow, then the destination register is not modified and
93 an IntegerOverflow exception occurs. */
94 TEST1("dadd $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
97 #if (__mips_isa_rev < 6)
99 /* If the addition results in 64-bit 2âs complement arithmetic
100 overflow, then the destination register is not modified and
101 an Integer Overflow exception occurs. */
102 TEST2("daddi $t0, $t1, 0xff", reg_val1
[i
], 0xff, t0
, t1
);
103 TEST2("daddi $t2, $t3, 0xffff", reg_val1
[i
], 0xffff, t2
, t3
);
104 TEST2("daddi $a0, $a1, 0x0", reg_val1
[i
], 0x0, a0
, a1
);
105 TEST2("daddi $s0, $s1, 0x23", reg_val1
[i
], 0x23, s0
, s1
);
106 TEST2("daddi $t0, $t1, 0xff", reg_val2
[i
], 0xff, t0
, t1
);
107 TEST2("daddi $t2, $t3, 0xffff", reg_val2
[i
], 0xffff, t2
, t3
);
108 TEST2("daddi $a0, $a1, 0x0", reg_val2
[i
], 0x0, a0
, a1
);
109 TEST2("daddi $s0, $s1, 0x23", reg_val2
[i
], 0x23, s0
, s1
);
113 /* No Integer Overflow exception occurs under any
115 TEST2("daddiu $t0, $t1, 0xff", reg_val1
[i
], 0xff, t0
, t1
);
116 TEST2("daddiu $t2, $t3, 0xffff", reg_val1
[i
], 0xffff, t2
, t3
);
117 TEST2("daddiu $a0, $a1, 0x0", reg_val1
[i
], 0x0, a0
, a1
);
118 TEST2("daddiu $s0, $s1, 0x23", reg_val1
[i
], 0x23, s0
, s1
);
119 TEST2("daddiu $t0, $t1, 0xff", reg_val2
[i
], 0xff, t0
, t1
);
120 TEST2("daddiu $t2, $t3, 0xffff", reg_val2
[i
], 0xffff, t2
, t3
);
121 TEST2("daddiu $a0, $a1, 0x0", reg_val2
[i
], 0x0, a0
, a1
);
122 TEST2("daddiu $s0, $s1, 0x23", reg_val2
[i
], 0x23, s0
, s1
);
126 /* No Integer Overflow exception occurs under any
128 TEST1("daddu $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
130 TEST1("daddu $s0, $s1, $s2", reg_val2
[i
], reg_val2
[N
-i
-1],
135 /* No arithmetic exception occurs under any circumstances. */
136 TEST3("dclo $t0, $t1", reg_val1
[i
], t0
, t1
);
137 TEST3("dclo $v0, $v1", reg_val2
[i
], v0
, v1
);
141 /* No arithmetic exception occurs under any circumstances. */
142 TEST3("dclz $t0, $t1", reg_val1
[i
], t0
, t1
);
143 TEST3("dclz $v0, $v1", reg_val2
[i
], v0
, v1
);
145 #if (__mips_isa_rev < 6)
147 /* If the divisor in GPR rt is zero, the arithmetic result value
149 if (reg_val1
[N
-i
-1] != 0)
150 TEST4("ddiv $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
152 if (reg_val2
[N
-i
-1] != 0)
153 TEST4("ddiv $v0, $v1", reg_val2
[i
], reg_val2
[N
-i
-1], v0
, v1
);
158 /* If the divisor in GPR rt is zero, the arithmetic result value
160 if (reg_val1
[N
-i
-1] != 0)
161 TEST4("ddivu $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
163 if (reg_val2
[N
-i
-1] != 0)
164 TEST4("ddivu $v0, $v1", reg_val2
[i
], reg_val2
[N
-i
-1], v0
, v1
);
169 /* If either GPR rt or GPR rs does not contain sign-extended
170 32-bit values (bits 63..31 equal), then the result of the
171 operation is UNPREDICTABLE.
172 If the divisor in GPR rt is zero, the arithmetic result
173 value is UNPREDICTABLE. */
174 if (reg_val1
[N
-i
-1] != 0)
175 TEST4("div $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
180 /* If either GPR rt or GPR rs does not contain sign-extended
181 32-bit values (bits 63..31 equal), then the result of the
182 operation is UNPREDICTABLE.
183 If the divisor in GPR rt is zero, the arithmetic result
184 value is UNPREDICTABLE. */
185 if (reg_val1
[N
-i
-1] != 0)
186 TEST4("divu $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
191 /* No arithmetic exception occurs under any circumstances. */
192 TEST4("dmult $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
193 TEST4("dmult $v0, $v1", reg_val2
[i
], reg_val2
[N
-i
-1], v0
, v1
);
197 /* No arithmetic exception occurs under any circumstances. */
198 TEST4("dmultu $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
199 TEST4("dmultu $v0, $v1", reg_val2
[i
], reg_val2
[N
-i
-1], v0
, v1
);
203 /* If the subtraction results in 64-bit 2âs complement
204 arithmetic overflow, then the destination register is not
205 modified and an Integer Overflow exception occurs. */
206 TEST1("dsub $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
211 /* No Integer Overflow exception occurs under any
213 TEST1("dsubu $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
215 TEST1("dsubu $s0, $s1, $s2", reg_val2
[i
], reg_val2
[N
-i
-1],
218 #if (__mips_isa_rev < 6)
220 /* If GPRs rs or rt do not contain sign-extended 32-bit
221 values (bits 63..31 equal), then the results of the operation
222 are UNPREDICTABLE. */
223 TEST5("madd $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
227 /* If GPRs rs or rt do not contain sign-extended 32-bit
228 values (bits 63..31 equal), then the results of the operation
229 are UNPREDICTABLE. */
230 TEST5("maddu $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
234 /* If GPR rs or rt do not contain a sign-extended 32-bit
235 value (bits 63..31 equal), then the results of the operation
236 are UNPREDICTABLE. */
237 TEST5("msub $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
241 /* If GPRs rs or rt do not contain sign-extended 32-bit
242 values (bits 63..31 equal), then the results of the operation
244 This instruction does not provide the capability of writing
245 directly to a target GPR. */
246 TEST5("msubu $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
250 /* On 64-bit processors, if either GPR rt or GPR rs does not
251 contain sign-extended 32-bit values (bits 63..31 equal), then
252 the result of the operation is UNPREDICTABLE. */
253 TEST1("mul $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
258 /* On 64-bit processors, if either GPR rt or GPR rs does not
259 contain sign-extended 32-bit values (bits 63..31 equal), then
260 the result of the operation is UNPREDICTABLE. */
261 TEST4("mult $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
265 /* On 64-bit processors, if either GPR rt or GPR rs does not
266 contain sign-extended 32-bit values (bits 63..31 equal), then
267 the result of the operation is UNPREDICTABLE. */
268 TEST4("multu $t0, $t1", reg_val1
[i
], reg_val1
[N
-i
-1], t0
, t1
);
272 /* The arithmetic comparison does not cause an Integer Overflow
274 TEST1("movn $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
276 TEST1("movn $s0, $s1, $s2", reg_val2
[i
], reg_val2
[N
-i
-1],
281 /* The arithmetic comparison does not cause an Integer Overflow
283 TEST1("movz $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
285 TEST1("movz $s0, $s1, $s2", reg_val2
[i
], reg_val2
[N
-i
-1],
290 #if (__mips==64) && (__mips_isa_rev>=2)
291 /* If GPR rt does not contain a sign-extended 32-bit
292 value (bits 63..31 equal), then the result of the operation
294 TEST3("seb $t0, $t1", reg_val1
[i
], t0
, t1
);
299 #if (__mips==64) && (__mips_isa_rev>=2)
300 /* If GPR rt does not contain a sign-extended 32-bit
301 value (bits 63..31 equal), then the result of the operation
303 TEST3("seh $t0, $t1", reg_val1
[i
], t0
, t1
);
308 /* The arithmetic comparison does not cause an Integer Overflow
310 TEST1("slt $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
315 /* The arithmetic comparison does not cause an Integer Overflow
317 TEST2("slti $t0, $t1, 0xff", reg_val1
[i
], 0xff, t0
, t1
);
318 TEST2("slti $t2, $t3, 0xffff", reg_val1
[i
], 0xffff, t2
, t3
);
319 TEST2("slti $a0, $a1, 0x0", reg_val1
[i
], 0x0, a0
, a1
);
320 TEST2("slti $s0, $s1, 0x23", reg_val1
[i
], 0x23, s0
, s1
);
321 TEST2("slti $t0, $t1, 0xff", reg_val2
[i
], 0xff, t0
, t1
);
322 TEST2("slti $t2, $t3, 0xffff", reg_val2
[i
], 0xffff, t2
, t3
);
323 TEST2("slti $a0, $a1, 0x0", reg_val2
[i
], 0x0, a0
, a1
);
324 TEST2("slti $s0, $s1, 0x23", reg_val2
[i
], 0x23, s0
, s1
);
328 /* The arithmetic comparison does not cause an Integer Overflow
330 TEST2("sltiu $t0, $t1, 0xff", reg_val1
[i
], 0xff, t0
, t1
);
331 TEST2("sltiu $t2, $t3, 0xffff", reg_val1
[i
], 0xffff, t2
, t3
);
332 TEST2("sltiu $a0, $a1, 0x0", reg_val1
[i
], 0x0, a0
, a1
);
333 TEST2("sltiu $s0, $s1, 0x23", reg_val1
[i
], 0x23, s0
, s1
);
334 TEST2("sltiu $t0, $t1, 0xff", reg_val2
[i
], 0xff, t0
, t1
);
335 TEST2("sltiu $t2, $t3, 0xffff", reg_val2
[i
], 0xffff, t2
, t3
);
336 TEST2("sltiu $a0, $a1, 0x0", reg_val2
[i
], 0x0, a0
, a1
);
337 TEST2("sltiu $s0, $s1, 0x23", reg_val2
[i
], 0x23, s0
, s1
);
341 /* The arithmetic comparison does not cause an Integer Overflow
343 TEST1("sltu $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
345 TEST1("sltu $s0, $s1, $s2", reg_val2
[i
], reg_val2
[N
-i
-1],
350 /* On 64-bit processors, if either GPR rt or GPR rs does not
351 contain sign-extended 32-bit values (bits 63..31 equal), then
352 the result of the operation is UNPREDICTABLE. */
353 if (i
< 8 || (i
> 15 && i
< 22))
354 TEST1("sub $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],
359 /* On 64-bit processors, if either GPR rt or GPR rs does not
360 contain sign-extended 32-bit values (bits 63..31 equal), then
361 the result of the operation is UNPREDICTABLE. */
362 TEST1("subu $t0, $t1, $t2", reg_val1
[i
], reg_val1
[N
-i
-1],