Chromium Code Reviews| 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..1a6d2b92b4067062b9d1c3844cbe2c9b7fe8eb29 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(ool->entry(), hs, offset, i.InputOperand(1)); \ |
|
paul.l...
2014/12/04 16:05:56
micro-optimization possible by putting the addu in
dusmil.imgtec
2014/12/04 17:25:23
Done.
dusmil.imgtec
2014/12/04 17:25:23
Very nice, I missed it.
|
| + __ 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)); \ |
|
balazs.kilvady
2014/12/04 15:33:40
As I understand the operands were replaced in the
|
| + __ 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(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); \ |
| + __ Branch(&done, hs, offset, i.InputOperand(1)); \ |
| + auto value = i.Input##width##Register(2); \ |
|
paul.l...
2014/12/04 16:05:56
If you do use the delay slot of the branch, you mi
dusmil.imgtec
2014/12/04 17:25:23
Done.
|
| + __ addu(at, i.InputRegister(3), offset); \ |
| + __ asm_instr(value, MemOperand(at, 0)); \ |
| + } else { \ |
| + auto offset = i.InputOperand(0).immediate(); \ |
| + __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \ |
| + auto value = i.Input##width##Register(2); \ |
| + __ 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); \ |
| + __ Branch(&done, hs, offset, i.InputOperand(1)); \ |
| + auto value = i.InputRegister(2); \ |
| + __ addu(at, i.InputRegister(3), offset); \ |
| + __ asm_instr(value, MemOperand(at, 0)); \ |
| + } else { \ |
| + auto offset = i.InputOperand(0).immediate(); \ |
| + __ Branch(&done, ls, i.InputRegister(1), Operand(offset)); \ |
| + auto value = i.InputRegister(2); \ |
| + __ asm_instr(value, MemOperand(i.InputRegister(3), offset)); \ |
| + } \ |
| + __ bind(&done); \ |
| } while (0) |