Ignore:
Timestamp:
Sep 17, 2013, 6:04:31 PM (12 years ago)
Author:
[email protected]
Message:

DFG should use the (x & 0x7fffffff) trick for doing overflow and neg-zero checks on negation in one go
https://bugs.webkit.org/show_bug.cgi?id=121520

Reviewed by Oliver Hunt.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileArithNegate):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileArithNegate):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r155793 r156016  
    10181018            if (bytecodeCanTruncateInteger(m_node->arithNodeFlags()))
    10191019                result = m_out.neg(value);
    1020             else {
     1020            else if (bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) {
    10211021                // We don't have a negate-with-overflow intrinsic. Hopefully this
    10221022                // does the trick, though.
     
    10241024                speculate(Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
    10251025                result = m_out.extractValue(overflowResult, 0);
    1026                 speculate(NegativeZero, noValue(), 0, m_out.isZero32(result));
     1026            } else {
     1027                speculate(Overflow, noValue(), 0, m_out.testIsZero32(value, m_out.constInt32(0x7fffffff)));
     1028                result = m_out.neg(value);
    10271029            }
    10281030           
Note: See TracChangeset for help on using the changeset viewer.