Index: src/mips/assembler-mips.cc |
diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc |
index 865e64c87d26fabb81a7511d774d1fb9b8440c60..fb260e1ea87bd1f2ffeeef8fc87f4622396d8d0c 100644 |
--- a/src/mips/assembler-mips.cc |
+++ b/src/mips/assembler-mips.cc |
@@ -1779,9 +1779,18 @@ void Assembler::lsa(Register rd, Register rt, Register rs, uint8_t sa) { |
// Helper for base-reg + offset, when offset is larger than int16. |
void Assembler::LoadRegPlusOffsetToAt(const MemOperand& src) { |
DCHECK(!src.rm().is(at)); |
- lui(at, (src.offset_ >> kLuiShift) & kImm16Mask); |
- ori(at, at, src.offset_ & kImm16Mask); // Load 32-bit offset. |
- addu(at, at, src.rm()); // Add base register. |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ int32_t hi = (src.offset_ >> kLuiShift) & kImm16Mask; |
+ if (src.offset_ & kNegOffset) { |
+ hi += 1; |
+ } |
+ aui(at, src.rm(), hi); |
+ addiu(at, at, src.offset_ & kImm16Mask); |
+ } else { |
+ lui(at, (src.offset_ >> kLuiShift) & kImm16Mask); |
+ ori(at, at, src.offset_ & kImm16Mask); // Load 32-bit offset. |
+ addu(at, at, src.rm()); // Add base register. |
+ } |
} |
// Helper for base-reg + upper part of offset, when offset is larger than int16. |
@@ -1797,8 +1806,13 @@ int32_t Assembler::LoadRegPlusUpperOffsetPartToAt(const MemOperand& src) { |
if (src.offset_ & kNegOffset) { |
hi += 1; |
} |
- lui(at, hi); |
- addu(at, at, src.rm()); |
+ |
+ if (IsMipsArchVariant(kMips32r6)) { |
+ aui(at, src.rm(), hi); |
+ } else { |
+ lui(at, hi); |
+ addu(at, at, src.rm()); |
+ } |
return (src.offset_ & kImm16Mask); |
} |