зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1464366 : [MIPS] Provide implementation for CodeGenerator::visitTrunc{F}; r=jandem
--HG-- extra : rebase_source : 11facc1f91e4a3155be8067e2293ff6001ee41b7
This commit is contained in:
Родитель
b669b4de9c
Коммит
c2ed3aa9cb
|
@ -1455,13 +1455,43 @@ CodeGenerator::visitRoundF(LRoundF* lir)
|
|||
void
|
||||
CodeGenerator::visitTrunc(LTrunc* lir)
|
||||
{
|
||||
MOZ_CRASH("visitTrunc");
|
||||
FloatRegister input = ToFloatRegister(lir->input());
|
||||
Register output = ToRegister(lir->output());
|
||||
|
||||
Label notZero;
|
||||
masm.as_truncwd(ScratchFloat32Reg, input);
|
||||
masm.as_cfc1(ScratchRegister, Assembler::FCSR);
|
||||
masm.moveFromFloat32(ScratchFloat32Reg, output);
|
||||
masm.ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseV, 1);
|
||||
|
||||
masm.ma_b(output, Imm32(0), ¬Zero, Assembler::NotEqual, ShortJump);
|
||||
masm.moveFromDoubleHi(input, ScratchRegister);
|
||||
// Check if input is in ]-1; -0] range by checking the sign bit.
|
||||
masm.as_slt(ScratchRegister, ScratchRegister, zero);
|
||||
masm.bind(¬Zero);
|
||||
|
||||
bailoutCmp32(Assembler::NotEqual, ScratchRegister, Imm32(0), lir->snapshot());
|
||||
}
|
||||
|
||||
void
|
||||
CodeGenerator::visitTruncF(LTruncF* lir)
|
||||
{
|
||||
MOZ_CRASH("visitTruncF");
|
||||
FloatRegister input = ToFloatRegister(lir->input());
|
||||
Register output = ToRegister(lir->output());
|
||||
|
||||
Label notZero;
|
||||
masm.as_truncws(ScratchFloat32Reg, input);
|
||||
masm.as_cfc1(ScratchRegister, Assembler::FCSR);
|
||||
masm.moveFromFloat32(ScratchFloat32Reg, output);
|
||||
masm.ma_ext(ScratchRegister, ScratchRegister, Assembler::CauseV, 1);
|
||||
|
||||
masm.ma_b(output, Imm32(0), ¬Zero, Assembler::NotEqual, ShortJump);
|
||||
masm.moveFromFloat32(input, ScratchRegister);
|
||||
// Check if input is in ]-1; -0] range by checking the sign bit.
|
||||
masm.as_slt(ScratchRegister, ScratchRegister, zero);
|
||||
masm.bind(¬Zero);
|
||||
|
||||
bailoutCmp32(Assembler::NotEqual, ScratchRegister, Imm32(0), lir->snapshot());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче