Bug 921490 - Ionmonkey ARM: fix the negative zero check path in convertFloat32ToInt32. r=mjrosenb

This commit is contained in:
Douglas Crosher 2013-09-28 00:36:51 +10:00
Родитель d16240276a
Коммит 21646d826a
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -92,7 +92,8 @@ MacroAssemblerARM::branchTruncateDouble(const FloatRegister &src, const Register
// integer is written to the output register. Otherwise, a bailout is taken to // integer is written to the output register. Otherwise, a bailout is taken to
// the given snapshot. This function overwrites the scratch float register. // the given snapshot. This function overwrites the scratch float register.
void void
MacroAssemblerARM::convertDoubleToInt32(const FloatRegister &src, const Register &dest, Label *fail, bool negativeZeroCheck) MacroAssemblerARM::convertDoubleToInt32(const FloatRegister &src, const Register &dest,
Label *fail, bool negativeZeroCheck)
{ {
// convert the floating point value to an integer, if it did not fit, // convert the floating point value to an integer, if it did not fit,
// then when we convert it *back* to a float, it will have a // then when we convert it *back* to a float, it will have a
@ -120,7 +121,8 @@ MacroAssemblerARM::convertDoubleToInt32(const FloatRegister &src, const Register
// integer is written to the output register. Otherwise, a bailout is taken to // integer is written to the output register. Otherwise, a bailout is taken to
// the given snapshot. This function overwrites the scratch float register. // the given snapshot. This function overwrites the scratch float register.
void void
MacroAssemblerARM::convertFloat32ToInt32(const FloatRegister &src, const Register &dest, Label *fail, bool negativeZeroCheck) MacroAssemblerARM::convertFloat32ToInt32(const FloatRegister &src, const Register &dest,
Label *fail, bool negativeZeroCheck)
{ {
// convert the floating point value to an integer, if it did not fit, // convert the floating point value to an integer, if it did not fit,
// then when we convert it *back* to a float, it will have a // then when we convert it *back* to a float, it will have a
@ -136,9 +138,9 @@ MacroAssemblerARM::convertFloat32ToInt32(const FloatRegister &src, const Registe
if (negativeZeroCheck) { if (negativeZeroCheck) {
ma_cmp(dest, Imm32(0)); ma_cmp(dest, Imm32(0));
// Test and bail for -0.0, when integer result is 0 // Test and bail for -0.0, when integer result is 0
// Move the top word of the double into the output reg, if it is non-zero, // Move the float into the output reg, and if it is non-zero then
// then the original value was -0.0 // the original value was -0.0
as_vxfer(dest, InvalidReg, src, FloatToCore, Assembler::Equal, 0); as_vxfer(dest, InvalidReg, VFPRegister(src).singleOverlay(), FloatToCore, Assembler::Equal, 0);
ma_cmp(dest, Imm32(0x80000000), Assembler::Equal); ma_cmp(dest, Imm32(0x80000000), Assembler::Equal);
ma_b(fail, Assembler::Equal); ma_b(fail, Assembler::Equal);
} }