Index: src/mips64/macro-assembler-mips64.cc |
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc |
index 8f667ef98ce00624aefe0c4f4010a93d9998171d..d21e686115a05c9e692e04d0e174172b8b0a366c 100644 |
--- a/src/mips64/macro-assembler-mips64.cc |
+++ b/src/mips64/macro-assembler-mips64.cc |
@@ -1294,8 +1294,9 @@ void MacroAssembler::Pref(int32_t hint, const MemOperand& rs) { |
void MacroAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa, |
Register scratch) { |
+ DCHECK(sa >= 1 && sa <= 31); |
if (kArchVariant == kMips64r6 && sa <= 4) { |
- lsa(rd, rt, rs, sa); |
+ lsa(rd, rt, rs, sa - 1); |
} else { |
Register tmp = rd.is(rt) ? scratch : rd; |
DCHECK(!tmp.is(rt)); |
@@ -1307,8 +1308,9 @@ void MacroAssembler::Lsa(Register rd, Register rt, Register rs, uint8_t sa, |
void MacroAssembler::Dlsa(Register rd, Register rt, Register rs, uint8_t sa, |
Register scratch) { |
+ DCHECK(sa >= 1 && sa <= 31); |
if (kArchVariant == kMips64r6 && sa <= 4) { |
- dlsa(rd, rt, rs, sa); |
+ dlsa(rd, rt, rs, sa - 1); |
} else { |
Register tmp = rd.is(rt) ? scratch : rd; |
DCHECK(!tmp.is(rt)); |