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

Unified Diff: src/compiler/mips/code-generator-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 | « no previous file | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips/code-generator-mips.cc
diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc
index 6605bd3589cf6503617e1d36696ab5af27ce276c..b808856dc011e6654514067036386be82d137e2c 100644
--- a/src/compiler/mips/code-generator-mips.cc
+++ b/src/compiler/mips/code-generator-mips.cc
@@ -165,51 +165,77 @@ class OutOfLineLoadInteger FINAL : public OutOfLineCode {
} // namespace
-#define ASSEMBLE_CHECKED_LOAD_FLOAT(width, asm_instr) \
- do { \
- auto result = i.Output##width##Register(); \
- auto offset = i.InputRegister(0); \
- auto ool = new (zone()) OutOfLineLoad##width(this, result); \
- __ Branch(ool->entry(), hs, offset, Operand(i.InputRegister(1))); \
- __ addu(at, i.InputRegister(2), offset); \
- __ asm_instr(result, MemOperand(at, 0)); \
- __ bind(ool->exit()); \
+#define ASSEMBLE_CHECKED_LOAD_FLOAT(width, asm_instr) \
+ do { \
+ auto result = i.Output##width##Register(); \
+ auto ool = new (zone()) OutOfLineLoad##width(this, result); \
+ if (instr->InputAt(0)->IsRegister()) { \
+ auto offset = i.InputRegister(0); \
+ __ Branch(USE_DELAY_SLOT, ool->entry(), hs, offset, i.InputOperand(1)); \
+ __ addu(at, i.InputRegister(2), offset); \
+ __ asm_instr(result, MemOperand(at, 0)); \
+ } else { \
+ auto offset = i.InputOperand(0).immediate(); \
+ __ Branch(ool->entry(), ls, i.InputRegister(1), Operand(offset)); \
+ __ asm_instr(result, MemOperand(i.InputRegister(2), offset)); \
+ } \
+ __ bind(ool->exit()); \
} while (0)
-#define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr) \
- do { \
- auto result = i.OutputRegister(); \
- auto offset = i.InputRegister(0); \
- auto ool = new (zone()) OutOfLineLoadInteger(this, result); \
- __ Branch(ool->entry(), hs, offset, Operand(i.InputRegister(1))); \
- __ addu(at, i.InputRegister(2), offset); \
- __ asm_instr(result, MemOperand(at, 0)); \
- __ bind(ool->exit()); \
+#define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr) \
+ do { \
+ auto result = i.OutputRegister(); \
+ auto ool = new (zone()) OutOfLineLoadInteger(this, result); \
+ if (instr->InputAt(0)->IsRegister()) { \
+ auto offset = i.InputRegister(0); \
+ __ Branch(USE_DELAY_SLOT, ool->entry(), hs, offset, i.InputOperand(1)); \
+ __ addu(at, i.InputRegister(2), offset); \
+ __ asm_instr(result, MemOperand(at, 0)); \
+ } else { \
+ auto offset = i.InputOperand(0).immediate(); \
+ __ Branch(ool->entry(), ls, i.InputRegister(1), Operand(offset)); \
+ __ asm_instr(result, MemOperand(i.InputRegister(2), offset)); \
+ } \
+ __ bind(ool->exit()); \
} while (0)
-#define ASSEMBLE_CHECKED_STORE_FLOAT(width, asm_instr) \
- do { \
- auto offset = i.InputRegister(0); \
- Label done; \
- __ Branch(&done, hs, offset, Operand(i.InputRegister(1))); \
- auto value = i.Input##width##Register(2); \
- __ addu(at, i.InputRegister(3), offset); \
- __ asm_instr(value, MemOperand(at, 0)); \
- __ bind(&done); \
+#define ASSEMBLE_CHECKED_STORE_FLOAT(width, asm_instr) \
+ do { \
+ Label done; \
+ if (instr->InputAt(0)->IsRegister()) { \
+ auto offset = i.InputRegister(0); \
+ auto value = i.Input##width##Register(2); \
+ __ Branch(USE_DELAY_SLOT, &done, hs, offset, i.InputOperand(1)); \
+ __ addu(at, i.InputRegister(3), offset); \
+ __ asm_instr(value, MemOperand(at, 0)); \
+ } else { \
+ auto offset = i.InputOperand(0).immediate(); \
+ auto value = i.Input##width##Register(2); \
+ __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \
+ __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \
+ } \
+ __ bind(&done); \
} while (0)
-#define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \
- do { \
- auto offset = i.InputRegister(0); \
- Label done; \
- __ Branch(&done, hs, offset, Operand(i.InputRegister(1))); \
- auto value = i.InputRegister(2); \
- __ addu(at, i.InputRegister(3), offset); \
- __ asm_instr(value, MemOperand(at, 0)); \
- __ bind(&done); \
+#define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \
+ do { \
+ Label done; \
+ if (instr->InputAt(0)->IsRegister()) { \
+ auto offset = i.InputRegister(0); \
+ auto value = i.InputRegister(2); \
+ __ Branch(USE_DELAY_SLOT, &done, hs, offset, i.InputOperand(1)); \
+ __ addu(at, i.InputRegister(3), offset); \
+ __ asm_instr(value, MemOperand(at, 0)); \
+ } else { \
+ auto offset = i.InputOperand(0).immediate(); \
+ auto value = i.InputRegister(2); \
+ __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \
+ __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \
+ } \
+ __ bind(&done); \
} while (0)
« no previous file with comments | « no previous file | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698