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

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

Issue 782493002: MIPS; Improve checked load/store operators for constant offset and length. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments addressed. Created 6 years 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 | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('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 0d2d96794db1ebacdb581e750d05267bd42bc7dc..b08d0e83ae2c6357d8981b750525e608a5e845f7 100644
--- a/src/compiler/mips/instruction-selector-mips.cc
+++ b/src/compiler/mips/instruction-selector-mips.cc
@@ -42,6 +42,10 @@ class MipsOperandGenerator FINAL : public OperandGenerator {
return is_uint16(value);
case kMipsLdc1:
case kMipsSdc1:
+ case kCheckedLoadFloat32:
+ case kCheckedLoadFloat64:
+ case kCheckedStoreFloat32:
+ case kCheckedStoreFloat64:
return is_int16(value + kIntSize);
default:
return is_int16(value);
@@ -513,9 +517,18 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
UNREACHABLE();
return;
}
- InstructionOperand* offset_operand = g.UseRegister(offset);
+ InstructionOperand* offset_operand = g.CanBeImmediate(offset, opcode)
+ ? g.UseImmediate(offset)
+ : g.UseRegister(offset);
+
+ InstructionOperand* length_operand =
+ (!g.CanBeImmediate(offset, opcode)) ? g.CanBeImmediate(length, opcode)
+ ? g.UseImmediate(length)
+ : g.UseRegister(length)
+ : g.UseRegister(length);
+
Emit(opcode | AddressingModeField::encode(kMode_MRI),
- g.DefineAsRegister(node), offset_operand, g.UseRegister(length),
+ g.DefineAsRegister(node), offset_operand, length_operand,
g.UseRegister(buffer));
}
@@ -548,9 +561,18 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
UNREACHABLE();
return;
}
- InstructionOperand* offset_operand = g.UseRegister(offset);
+ InstructionOperand* offset_operand = g.CanBeImmediate(offset, opcode)
+ ? g.UseImmediate(offset)
+ : g.UseRegister(offset);
+
+ InstructionOperand* length_operand =
+ (!g.CanBeImmediate(offset, opcode)) ? g.CanBeImmediate(length, opcode)
+ ? g.UseImmediate(length)
+ : g.UseRegister(length)
+ : g.UseRegister(length);
+
Emit(opcode | AddressingModeField::encode(kMode_MRI), nullptr, offset_operand,
- g.UseRegister(length), g.UseRegister(value), g.UseRegister(buffer));
+ length_operand, g.UseRegister(value), g.UseRegister(buffer));
}
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698