CmpLE32U operation was incorrectly implemented as a signed comparaison,
use less-or-same for unsigned.
Max32U operation was incorrectly implemented using the SLT instruction,
use the unsigned variant SLTU.
This partially fixes none/tests/iropt-test.
Patch by:
Dimitrije Dzunic <dimitrije.dzunic@htecgroup.com>
Aleksandar Rikalo <aleksandar.rikalo@htecgroup.com>
case Malu_SLT:
ret = immR ? "slti" : "slt";
break;
+ case Malu_SLTU:
+ ret = immR ? "sltui" : "sltu";
+ break;
default:
vpanic("showMIPSAluOp");
break;
p = mkFormR(p, 0, r_srcL, r_srcR, r_dst, 0, 42);
}
break;
+ case Malu_SLTU:
+ if (immR) {
+ goto bad;
+ } else {
+ p = mkFormR(p, 0, r_srcL, r_srcR, r_dst, 0, 43);
+ }
+ break;
default:
goto bad;
Malu_ADD, Malu_SUB,
Malu_AND, Malu_OR, Malu_NOR, Malu_XOR,
Malu_DADD, Malu_DSUB,
- Malu_SLT
+ Malu_SLT, Malu_SLTU
} MIPSAluOp;
extern const HChar *showMIPSAluOp(MIPSAluOp,
size32 = False;
break;
case Iop_CmpLE32U:
- cc = MIPScc_LE;
+ cc = MIPScc_LS;
size32 = True;
break;
case Iop_CmpLE32S:
MIPSRH *argRH = MIPSRH_Reg(argR);
/* max (v0, s0)
------------
- slt v1, v0, s0
+ sltu v1, v0, s0
movn v0, s0, v1 */
- addInstr(env, MIPSInstr_Alu(Malu_SLT, tmp, argL, argRH));
+ addInstr(env, MIPSInstr_Alu(Malu_SLTU, tmp, argL, argRH));
#if (__mips_isa_rev >= 6)
{
HReg r_temp = newVRegI(env);