Chromium Code Reviews| Index: src/mips/macro-assembler-mips.cc |
| diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
| index a6b818a67ac08796eba5972bae3382f73774f46e..b758a7da93a72a69354a0b08a4a32665af3e8828 100644 |
| --- a/src/mips/macro-assembler-mips.cc |
| +++ b/src/mips/macro-assembler-mips.cc |
| @@ -1121,11 +1121,16 @@ void MacroAssembler::Slt(Register rd, Register rs, const Operand& rt) { |
| void MacroAssembler::Sltu(Register rd, Register rs, const Operand& rt) { |
| + const uint32_t int16_min = std::numeric_limits<int16_t>::min(); |
|
balazs.kilvady
2016/09/30 17:45:19
This should be in the else branch.
akos.palfi.imgtec
2016/09/30 17:55:10
Acknowledged.
|
| if (rt.is_reg()) { |
| sltu(rd, rs, rt.rm()); |
| } else { |
| - if (is_uint16(rt.imm32_) && !MustUseReg(rt.rmode_)) { |
| + if (is_uint15(rt.imm32_) && !MustUseReg(rt.rmode_)) { |
| + // Imm range is: [0, 32767]. |
| sltiu(rd, rs, rt.imm32_); |
| + } else if (is_uint15(rt.imm32_ - int16_min) && !MustUseReg(rt.rmode_)) { |
| + // Imm range is: [max_unsigned-32767,max_unsigned]. |
| + sltiu(rd, rs, static_cast<uint16_t>(rt.imm32_)); |
|
balazs.kilvady
2016/09/30 17:45:19
sltiu() expects int16 or uint16? Is this cast ok?
akos.palfi.imgtec
2016/09/30 17:55:10
It expects int32. This casts [ffff8000, ffffffff]
|
| } else { |
| // li handles the relocation. |
| DCHECK(!rs.is(at)); |