| Index: src/compiler/ppc/code-generator-ppc.cc
|
| diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
|
| index c75e698e9572ad6d7c000ae5294671f0318ee142..d8509a3b54704db3b842bdbd5584f0f2b594162e 100644
|
| --- a/src/compiler/ppc/code-generator-ppc.cc
|
| +++ b/src/compiler/ppc/code-generator-ppc.cc
|
| @@ -1340,8 +1340,15 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
| case kPPC_PushFrame: {
|
| int num_slots = i.InputInt32(1);
|
| if (instr->InputAt(0)->IsFPRegister()) {
|
| - __ StoreDoubleU(i.InputDoubleRegister(0),
|
| + LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
|
| + if (op->representation() == MachineRepresentation::kFloat64) {
|
| + __ StoreDoubleU(i.InputDoubleRegister(0),
|
| MemOperand(sp, -num_slots * kPointerSize), r0);
|
| + } else {
|
| + DCHECK(op->representation() == MachineRepresentation::kFloat32);
|
| + __ StoreSingleU(i.InputDoubleRegister(0),
|
| + MemOperand(sp, -num_slots * kPointerSize), r0);
|
| + }
|
| } else {
|
| __ StorePU(i.InputRegister(0),
|
| MemOperand(sp, -num_slots * kPointerSize), r0);
|
| @@ -1351,8 +1358,15 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
| case kPPC_StoreToStackSlot: {
|
| int slot = i.InputInt32(1);
|
| if (instr->InputAt(0)->IsFPRegister()) {
|
| - __ StoreDouble(i.InputDoubleRegister(0),
|
| - MemOperand(sp, slot * kPointerSize), r0);
|
| + LocationOperand* op = LocationOperand::cast(instr->InputAt(0));
|
| + if (op->representation() == MachineRepresentation::kFloat64) {
|
| + __ StoreDouble(i.InputDoubleRegister(0),
|
| + MemOperand(sp, slot * kPointerSize), r0);
|
| + } else {
|
| + DCHECK(op->representation() == MachineRepresentation::kFloat32);
|
| + __ StoreSingle(i.InputDoubleRegister(0),
|
| + MemOperand(sp, slot * kPointerSize), r0);
|
| + }
|
| } else {
|
| __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize), r0);
|
| }
|
| @@ -2016,17 +2030,33 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
|
| __ Move(dst, src);
|
| } else {
|
| DCHECK(destination->IsFPStackSlot());
|
| - __ StoreDouble(src, g.ToMemOperand(destination), r0);
|
| + LocationOperand* op = LocationOperand::cast(source);
|
| + if (op->representation() == MachineRepresentation::kFloat64) {
|
| + __ StoreDouble(src, g.ToMemOperand(destination), r0);
|
| + } else {
|
| + __ StoreSingle(src, g.ToMemOperand(destination), r0);
|
| + }
|
| }
|
| } else if (source->IsFPStackSlot()) {
|
| DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot());
|
| MemOperand src = g.ToMemOperand(source);
|
| if (destination->IsFPRegister()) {
|
| - __ LoadDouble(g.ToDoubleRegister(destination), src, r0);
|
| + LocationOperand* op = LocationOperand::cast(source);
|
| + if (op->representation() == MachineRepresentation::kFloat64) {
|
| + __ LoadDouble(g.ToDoubleRegister(destination), src, r0);
|
| + } else {
|
| + __ LoadSingle(g.ToDoubleRegister(destination), src, r0);
|
| + }
|
| } else {
|
| + LocationOperand* op = LocationOperand::cast(source);
|
| DoubleRegister temp = kScratchDoubleReg;
|
| - __ LoadDouble(temp, src, r0);
|
| - __ StoreDouble(temp, g.ToMemOperand(destination), r0);
|
| + if (op->representation() == MachineRepresentation::kFloat64) {
|
| + __ LoadDouble(temp, src, r0);
|
| + __ StoreDouble(temp, g.ToMemOperand(destination), r0);
|
| + } else {
|
| + __ LoadSingle(temp, src, r0);
|
| + __ StoreSingle(temp, g.ToMemOperand(destination), r0);
|
| + }
|
| }
|
| } else {
|
| UNREACHABLE();
|
|
|