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

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 662813002: IA: Double arithmetic binops support memory operand (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months 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/ia32/instruction-selector-ia32.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index 070c7bb33b571e7fc48733454b995ba384d19920..f0f1982c7266c8a7041b47bb56d1dec4b00eeec4 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -202,6 +202,16 @@ static bool HasImmediateInput(Instruction* instr, int index) {
} while (0)
+#define ASSEMBLE_DOUBLE_BINOP(asm_instr) \
+ do { \
+ if (instr->InputAt(1)->IsDoubleRegister()) { \
+ __ asm_instr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
+ } else { \
+ __ asm_instr(i.InputDoubleRegister(0), i.InputOperand(1)); \
+ } \
+ } while (0)
+
+
// Assembles an instruction after register allocation, producing machine code.
void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
X64OperandConverter i(this, instr);
@@ -351,23 +361,19 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
ASSEMBLE_SHIFT(rorq, 6);
break;
case kSSEFloat64Cmp:
- if (instr->InputAt(1)->IsDoubleRegister()) {
- __ ucomisd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
- } else {
- __ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
- }
+ ASSEMBLE_DOUBLE_BINOP(ucomisd);
break;
case kSSEFloat64Add:
- __ addsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
+ ASSEMBLE_DOUBLE_BINOP(addsd);
break;
case kSSEFloat64Sub:
- __ subsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
+ ASSEMBLE_DOUBLE_BINOP(subsd);
break;
case kSSEFloat64Mul:
- __ mulsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
+ ASSEMBLE_DOUBLE_BINOP(mulsd);
break;
case kSSEFloat64Div:
- __ divsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
+ ASSEMBLE_DOUBLE_BINOP(divsd);
break;
case kSSEFloat64Mod: {
__ subq(rsp, Immediate(kDoubleSize));
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698