Commit 46bf5aa2 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] Add RoundUint32ToFloat32 operator to Turbofan.

Port 187b3f28

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1680833002

Cr-Commit-Position: refs/heads/master@{#33825}
parent 770a1bf5
......@@ -1196,14 +1196,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break;
#endif
case kPPC_Int32ToFloat32:
__ ConvertIntToFloat(i.OutputDoubleRegister(), i.InputRegister(0),
kScratchReg);
__ ConvertIntToFloat(i.InputRegister(0), i.OutputDoubleRegister());
DCHECK_EQ(LeaveRC, i.OutputRCBit());
break;
case kPPC_Int32ToDouble:
__ ConvertIntToDouble(i.InputRegister(0), i.OutputDoubleRegister());
DCHECK_EQ(LeaveRC, i.OutputRCBit());
break;
case kPPC_Uint32ToFloat32:
__ ConvertUnsignedIntToFloat(i.InputRegister(0),
i.OutputDoubleRegister());
DCHECK_EQ(LeaveRC, i.OutputRCBit());
break;
case kPPC_Uint32ToDouble:
__ ConvertUnsignedIntToDouble(i.InputRegister(0),
i.OutputDoubleRegister());
......
......@@ -84,6 +84,7 @@ namespace compiler {
V(PPC_Uint64ToDouble) \
V(PPC_Int32ToFloat32) \
V(PPC_Int32ToDouble) \
V(PPC_Uint32ToFloat32) \
V(PPC_Uint32ToDouble) \
V(PPC_Float32ToDouble) \
V(PPC_DoubleToInt32) \
......@@ -115,7 +116,6 @@ namespace compiler {
V(PPC_StoreFloat32) \
V(PPC_StoreDouble)
// Addressing modes represent the "shape" of inputs to an instruction.
// Many instructions support multiple addressing modes. Addressing modes
// are encoded into the InstructionCode of the instruction and tell the
......
......@@ -83,6 +83,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kPPC_Uint64ToDouble:
case kPPC_Int32ToFloat32:
case kPPC_Int32ToDouble:
case kPPC_Uint32ToFloat32:
case kPPC_Uint32ToDouble:
case kPPC_Float32ToDouble:
case kPPC_DoubleToInt32:
......
......@@ -946,7 +946,7 @@ void InstructionSelector::VisitRoundInt32ToFloat32(Node* node) {
void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
UNIMPLEMENTED();
VisitRR(this, kPPC_Uint32ToFloat32, node);
}
......
......@@ -716,28 +716,27 @@ void MacroAssembler::CanonicalizeNaN(const DoubleRegister dst,
fsub(dst, src, kDoubleRegZero);
}
void MacroAssembler::ConvertIntToDouble(Register src,
DoubleRegister double_dst) {
MovIntToDouble(double_dst, src, r0);
fcfid(double_dst, double_dst);
void MacroAssembler::ConvertIntToDouble(Register src, DoubleRegister dst) {
MovIntToDouble(dst, src, r0);
fcfid(dst, dst);
}
void MacroAssembler::ConvertUnsignedIntToDouble(Register src,
DoubleRegister double_dst) {
MovUnsignedIntToDouble(double_dst, src, r0);
fcfid(double_dst, double_dst);
DoubleRegister dst) {
MovUnsignedIntToDouble(dst, src, r0);
fcfid(dst, dst);
}
void MacroAssembler::ConvertIntToFloat(const DoubleRegister dst,
const Register src,
const Register int_scratch) {
MovIntToDouble(dst, src, int_scratch);
void MacroAssembler::ConvertIntToFloat(Register src, DoubleRegister dst) {
MovIntToDouble(dst, src, r0);
fcfids(dst, dst);
}
void MacroAssembler::ConvertUnsignedIntToFloat(Register src,
DoubleRegister dst) {
MovUnsignedIntToDouble(dst, src, r0);
fcfids(dst, dst);
}
#if V8_TARGET_ARCH_PPC64
void MacroAssembler::ConvertInt64ToDouble(Register src,
......
......@@ -375,18 +375,20 @@ class MacroAssembler : public Assembler {
}
// Converts the integer (untagged smi) in |src| to a double, storing
// the result to |double_dst|
void ConvertIntToDouble(Register src, DoubleRegister double_dst);
// the result to |dst|
void ConvertIntToDouble(Register src, DoubleRegister dst);
// Converts the unsigned integer (untagged smi) in |src| to
// a double, storing the result to |double_dst|
void ConvertUnsignedIntToDouble(Register src, DoubleRegister double_dst);
// a double, storing the result to |dst|
void ConvertUnsignedIntToDouble(Register src, DoubleRegister dst);
// Converts the integer (untagged smi) in |src| to
// a float, storing the result in |dst|
// Warning: The value in |int_scrach| will be changed in the process!
void ConvertIntToFloat(const DoubleRegister dst, const Register src,
const Register int_scratch);
void ConvertIntToFloat(Register src, DoubleRegister dst);
// Converts the unsigned integer (untagged smi) in |src| to
// a float, storing the result in |dst|
void ConvertUnsignedIntToFloat(Register src, DoubleRegister dst);
#if V8_TARGET_ARCH_PPC64
void ConvertInt64ToFloat(Register src, DoubleRegister double_dst);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment