Ignore:
Timestamp:
Sep 6, 2011, 7:00:16 PM (14 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=67486
This reverts r65993 which gives wrong results for rshift
in some corner cases (see the test).

Patch by Yong Li <[email protected]> on 2011-09-06
Reviewed by Gavin Barraclough.

New test: fast/js/floating-point-truncate-rshift.html

  • assembler/ARMAssembler.h:
  • assembler/MacroAssemblerARM.h:

(JSC::MacroAssemblerARM::supportsFloatingPointTruncate):
(JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=67486
Add a test case for branchTruncateDoubleToInt32() which is
used in right shift optimization when the assembler
"supportsFloatingPointTruncate".

Patch by Yong Li <[email protected]> on 2011-09-06
Reviewed by Gavin Barraclough.

  • fast/js/floating-point-truncate-rshift-expected.txt: Added.
  • fast/js/floating-point-truncate-rshift.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h

    r90237 r94622  
    788788    bool supportsFloatingPointTruncate() const
    789789    {
    790         return s_isVFPPresent;
     790        return false;
    791791    }
    792792
     
    903903    // If the result is not representable as a 32 bit value, branch.
    904904    // May also branch for some values that are representable in 32 bits
    905     // (specifically, in this case, INT_MIN and INT_MAX).
     905    // (specifically, in this case, INT_MIN).
    906906    Jump branchTruncateDoubleToInt32(FPRegisterID src, RegisterID dest)
    907907    {
    908         m_assembler.vcvtr_s32_f64_r(ARMRegisters::SD0 << 1, src);
    909         // If VCVTR.S32.F64 can't fit the result into a 32-bit
    910         // integer, it saturates at INT_MAX or INT_MIN. Testing this is
    911         // probably quicker than testing FPSCR for exception.
    912         m_assembler.vmov_arm_r(dest, ARMRegisters::SD0 << 1);
    913         m_assembler.sub_r(ARMRegisters::S0, dest, ARMAssembler::getOp2(0x80000000));
    914         m_assembler.cmn_r(ARMRegisters::S0, ARMAssembler::getOp2(1), ARMCondition(NotEqual));
    915         return Jump(m_assembler.jmp(ARMCondition(Equal)));
     908        UNUSED_PARAM(src);
     909        UNUSED_PARAM(dest);
     910        ASSERT_NOT_REACHED();
     911        return jump();
    916912    }
    917913
Note: See TracChangeset for help on using the changeset viewer.