From d15321f2f88352cf4ffa161ab742772d9e6b6aa3 Mon Sep 17 00:00:00 2001 From: "plind44@gmail.com" Date: Mon, 1 Apr 2013 16:06:52 +0000 Subject: [PATCH] MIPS: Fixed some soft-float bugs. TEST=cctest/test-api/ExternalUnsignedIntArray BUG= Review URL: https://codereview.chromium.org/13165007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14101 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/lithium-codegen-mips.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 7f04fa4..615e356 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -4578,10 +4578,11 @@ void LCodeGen::DoNumberTagU(LNumberTagU* instr) { // Convert unsigned integer with specified number of leading zeroes in binary // representation to IEEE 754 double. -// Integer to convert is passed in register hiword. +// Integer to convert is passed in register src. // Resulting double is returned in registers hiword:loword. // This functions does not work correctly for 0. static void GenerateUInt2Double(MacroAssembler* masm, + Register src, Register hiword, Register loword, Register scratch, @@ -4595,12 +4596,12 @@ static void GenerateUInt2Double(MacroAssembler* masm, kBitsPerInt - mantissa_shift_for_hi_word; masm->li(scratch, Operand(biased_exponent << HeapNumber::kExponentShift)); if (mantissa_shift_for_hi_word > 0) { - masm->sll(loword, hiword, mantissa_shift_for_lo_word); - masm->srl(hiword, hiword, mantissa_shift_for_hi_word); + masm->sll(loword, src, mantissa_shift_for_lo_word); + masm->srl(hiword, src, mantissa_shift_for_hi_word); masm->Or(hiword, scratch, hiword); } else { masm->mov(loword, zero_reg); - masm->sll(hiword, hiword, mantissa_shift_for_hi_word); + masm->sll(hiword, src, mantissa_shift_for_hi_word); masm->Or(hiword, scratch, hiword); } @@ -4651,17 +4652,17 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, __ mtc1(src, dbl_scratch); __ Cvt_d_uw(dbl_scratch, dbl_scratch, f22); } else { - Label no_leading_zero, done; + Label no_leading_zero, convert_done; __ And(at, src, Operand(0x80000000)); __ Branch(&no_leading_zero, ne, at, Operand(zero_reg)); // Integer has one leading zeros. - GenerateUInt2Double(masm(), sfpd_hi, sfpd_lo, t0, 1); - __ Branch(&done); + GenerateUInt2Double(masm(), src, sfpd_hi, sfpd_lo, t0, 1); + __ Branch(&convert_done); __ bind(&no_leading_zero); - GenerateUInt2Double(masm(), sfpd_hi, sfpd_lo, t0, 0); - __ Branch(&done); + GenerateUInt2Double(masm(), src, sfpd_hi, sfpd_lo, t0, 0); + __ bind(&convert_done); } } -- 2.7.4