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

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

Issue 1306833002: X87: [turbofan] Support unboxed float and double stack parameters and add tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | src/compiler/x87/instruction-selector-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x87/code-generator-x87.cc
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc
index c3e999bcbffc40b1fb12c5c10f4ba20e4498e7b5..391cdcadafdbc01f5923fb84fa21fab0503a70ed 100644
--- a/src/compiler/x87/code-generator-x87.cc
+++ b/src/compiler/x87/code-generator-x87.cc
@@ -1104,7 +1104,29 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break;
}
case kX87Push:
- if (HasImmediateInput(instr, 0)) {
+ if (instr->InputAt(0)->IsDoubleRegister()) {
+ auto allocated = AllocatedOperand::cast(*instr->InputAt(0));
+ if (allocated.machine_type() == kRepFloat32) {
+ __ sub(esp, Immediate(kDoubleSize));
+ __ fst_s(Operand(esp, 0));
+ } else {
+ DCHECK(allocated.machine_type() == kRepFloat64);
+ __ sub(esp, Immediate(kDoubleSize));
+ __ fst_d(Operand(esp, 0));
+ }
+ } else if (instr->InputAt(0)->IsDoubleStackSlot()) {
+ auto allocated = AllocatedOperand::cast(*instr->InputAt(0));
+ if (allocated.machine_type() == kRepFloat32) {
+ __ sub(esp, Immediate(kDoubleSize));
+ __ fld_s(i.InputOperand(0));
+ __ fstp_s(MemOperand(esp, 0));
+ } else {
+ DCHECK(allocated.machine_type() == kRepFloat64);
+ __ sub(esp, Immediate(kDoubleSize));
+ __ fld_d(i.InputOperand(0));
+ __ fstp_d(MemOperand(esp, 0));
+ }
+ } else if (HasImmediateInput(instr, 0)) {
__ push(i.InputImmediate(0));
} else {
__ push(i.InputOperand(0));
« no previous file with comments | « no previous file | src/compiler/x87/instruction-selector-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698