Commit 3cf56fe0 authored by akos.palfi's avatar akos.palfi Committed by Commit bot

MIPS: [turbofan] Add RoundUint32ToFloat32 operator to Turbofan.

Port 187b3f28

BUG=

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

Cr-Commit-Position: refs/heads/master@{#34130}
parent 594a1e1d
......@@ -1028,6 +1028,12 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ cvt_s_w(i.OutputDoubleRegister(), scratch);
break;
}
case kMipsCvtSUw: {
FPURegister scratch = kScratchDoubleReg;
__ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0), scratch);
__ cvt_s_d(i.OutputDoubleRegister(), i.OutputDoubleRegister());
break;
}
case kMipsCvtDUw: {
FPURegister scratch = kScratchDoubleReg;
__ Cvt_d_uw(i.OutputDoubleRegister(), i.InputRegister(0), scratch);
......
......@@ -82,6 +82,7 @@ namespace compiler {
V(MipsCvtDW) \
V(MipsCvtDUw) \
V(MipsCvtSW) \
V(MipsCvtSUw) \
V(MipsLb) \
V(MipsLbu) \
V(MipsSb) \
......
......@@ -520,7 +520,7 @@ void InstructionSelector::VisitRoundInt32ToFloat32(Node* node) {
void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
UNIMPLEMENTED();
VisitRR(this, kMipsCvtSUw, node);
}
......
......@@ -1215,6 +1215,10 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
__ cvt_s_w(i.OutputDoubleRegister(), scratch);
break;
}
case kMips64CvtSUw: {
__ Cvt_s_uw(i.OutputDoubleRegister(), i.InputRegister(0));
break;
}
case kMips64CvtSL: {
FPURegister scratch = kScratchDoubleReg;
__ dmtc1(i.InputRegister(0), scratch);
......
......@@ -103,6 +103,7 @@ namespace compiler {
V(Mips64CvtDW) \
V(Mips64CvtSL) \
V(Mips64CvtSW) \
V(Mips64CvtSUw) \
V(Mips64CvtSUl) \
V(Mips64CvtDL) \
V(Mips64CvtDUw) \
......
......@@ -830,7 +830,7 @@ void InstructionSelector::VisitRoundInt32ToFloat32(Node* node) {
void InstructionSelector::VisitRoundUint32ToFloat32(Node* node) {
UNIMPLEMENTED();
VisitRR(this, kMips64CvtSUw, node);
}
......
......@@ -1652,6 +1652,22 @@ void MacroAssembler::Cvt_d_ul(FPURegister fd, Register rs) {
bind(&conversion_done);
}
void MacroAssembler::Cvt_s_uw(FPURegister fd, FPURegister fs) {
// Move the data from fs to t8.
mfc1(t8, fs);
Cvt_s_uw(fd, t8);
}
void MacroAssembler::Cvt_s_uw(FPURegister fd, Register rs) {
// Convert rs to a FP value in fd.
DCHECK(!rs.is(t9));
DCHECK(!rs.is(at));
// Zero extend int32 in rs.
Dext(t9, rs, 0, 32);
dmtc1(t9, fd);
cvt_s_l(fd, fd);
}
void MacroAssembler::Cvt_s_ul(FPURegister fd, FPURegister fs) {
// Move the data from fs to t8.
......
......@@ -832,6 +832,10 @@ class MacroAssembler: public Assembler {
void Cvt_d_ul(FPURegister fd, FPURegister fs);
void Cvt_d_ul(FPURegister fd, Register rs);
// Convert unsigned word to float.
void Cvt_s_uw(FPURegister fd, FPURegister fs);
void Cvt_s_uw(FPURegister fd, Register rs);
// Convert unsigned long to float.
void Cvt_s_ul(FPURegister fd, FPURegister fs);
void Cvt_s_ul(FPURegister fd, Register rs);
......
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