Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 2486283003: MIPS: Optimize load/store with large offset (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/mips/assembler-mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips/instruction-selector-mips.cc
diff --git a/src/compiler/mips/instruction-selector-mips.cc b/src/compiler/mips/instruction-selector-mips.cc
index d26b8a28c4bb880d7ecb52cb4a3d958baad10979..ce2d4ea42e35a8907d03b117a2238941f1a951cb 100644
--- a/src/compiler/mips/instruction-selector-mips.cc
+++ b/src/compiler/mips/instruction-selector-mips.cc
@@ -46,12 +46,33 @@ class MipsOperandGenerator final : public OperandGenerator {
case kMipsSub:
case kMipsXor:
return is_uint16(value);
+ case kMipsLb:
+ case kMipsLbu:
+ case kMipsSb:
+ case kMipsLh:
+ case kMipsLhu:
+ case kMipsSh:
+ case kMipsLw:
+ case kMipsSw:
+ case kMipsLwc1:
+ case kMipsSwc1:
case kMipsLdc1:
case kMipsSdc1:
+ case kCheckedLoadInt8:
+ case kCheckedLoadUint8:
+ case kCheckedLoadInt16:
+ case kCheckedLoadUint16:
+ case kCheckedLoadWord32:
+ case kCheckedStoreWord8:
+ case kCheckedStoreWord16:
+ case kCheckedStoreWord32:
+ case kCheckedLoadFloat32:
case kCheckedLoadFloat64:
+ case kCheckedStoreFloat32:
case kCheckedStoreFloat64:
- return std::numeric_limits<int16_t>::min() <= (value + kIntSize) &&
- std::numeric_limits<int16_t>::max() >= (value + kIntSize);
+ // true even for 32b values, offsets > 16b
+ // are handled in assembler-mips.cc
+ return is_int32(value);
default:
return is_int16(value);
}
@@ -1765,6 +1786,7 @@ void InstructionSelector::VisitAtomicLoad(Node* node) {
UNREACHABLE();
return;
}
+
if (g.CanBeImmediate(index, opcode)) {
Emit(opcode | AddressingModeField::encode(kMode_MRI),
g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index));
« no previous file with comments | « no previous file | src/mips/assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698