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

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

Issue 2036523003: S390: Store Floats as 4 bytes and Double as 8 bytes for codegen (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/s390/code-generator-s390.cc
diff --git a/src/compiler/s390/code-generator-s390.cc b/src/compiler/s390/code-generator-s390.cc
index 3f49f1862335c880a80e0012d2df16b99beff078..2c870af71e863304979070ee680855d2c7da4c2d 100644
--- a/src/compiler/s390/code-generator-s390.cc
+++ b/src/compiler/s390/code-generator-s390.cc
@@ -1318,8 +1318,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
int num_slots = i.InputInt32(1);
__ lay(sp, MemOperand(sp, -num_slots * kPointerSize));
if (instr->InputAt(0)->IsFPRegister()) {
- __ StoreDouble(i.InputDoubleRegister(0),
- MemOperand(sp));
+ LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
+ if (op->representation() == MachineRepresentation::kFloat64) {
+ __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp));
+ } else {
+ DCHECK(op->representation() == MachineRepresentation::kFloat32);
+ __ StoreFloat32(i.InputDoubleRegister(0), MemOperand(sp));
+ }
} else {
__ StoreP(i.InputRegister(0),
MemOperand(sp));
@@ -1329,8 +1334,15 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kS390_StoreToStackSlot: {
int slot = i.InputInt32(1);
if (instr->InputAt(0)->IsFPRegister()) {
- __ StoreDouble(i.InputDoubleRegister(0),
- MemOperand(sp, slot * kPointerSize));
+ LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
+ if (op->representation() == MachineRepresentation::kFloat64) {
+ __ StoreDouble(i.InputDoubleRegister(0),
+ MemOperand(sp, slot * kPointerSize));
+ } else {
+ DCHECK(op->representation() == MachineRepresentation::kFloat32);
+ __ StoreFloat32(i.InputDoubleRegister(0),
+ MemOperand(sp, slot * kPointerSize));
+ }
} else {
__ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize));
}
@@ -2017,17 +2029,33 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ Move(dst, src);
} else {
DCHECK(destination->IsFPStackSlot());
- __ StoreDouble(src, g.ToMemOperand(destination));
+ LocationOperand* op = LocationOperand::cast(source);
+ if (op->representation() == MachineRepresentation::kFloat64) {
+ __ StoreDouble(src, g.ToMemOperand(destination));
+ } else {
+ __ StoreFloat32(src, g.ToMemOperand(destination));
+ }
}
} else if (source->IsFPStackSlot()) {
DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
MemOperand src = g.ToMemOperand(source);
if (destination->IsFPRegister()) {
- __ LoadDouble(g.ToDoubleRegister(destination), src);
+ LocationOperand* op = LocationOperand::cast(source);
+ if (op->representation() == MachineRepresentation::kFloat64) {
+ __ LoadDouble(g.ToDoubleRegister(destination), src);
+ } else {
+ __ LoadFloat32(g.ToDoubleRegister(destination), src);
+ }
} else {
+ LocationOperand* op = LocationOperand::cast(source);
DoubleRegister temp = kScratchDoubleReg;
- __ LoadDouble(temp, src);
- __ StoreDouble(temp, g.ToMemOperand(destination));
+ if (op->representation() == MachineRepresentation::kFloat64) {
+ __ LoadDouble(temp, src);
+ __ StoreDouble(temp, g.ToMemOperand(destination));
+ } else {
+ __ LoadFloat32(temp, src);
+ __ StoreFloat32(temp, g.ToMemOperand(destination));
+ }
}
} else {
UNREACHABLE();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698