Ignore:
Timestamp:
Dec 11, 2015, 3:45:04 PM (10 years ago)
Author:
[email protected]
Message:

[JSC] Add an implementation of pow() taking an integer exponent to B3
https://bugs.webkit.org/show_bug.cgi?id=152165

Reviewed by Mark Lam.

LLVM has this really neat optimized opcode for
raising the power of something by an integer exponent.

There is no such native instruction so we need to extend
the existing FTLOutput API to something efficient.

DFG has a pretty competitive implementation. In this patch,
I added a version of it to B3.
I created powDoubleInt32() instead of putting the code directly
in FTL for easier testing and optimization.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • b3/B3MathExtras.cpp: Added.

(JSC::B3::powDoubleInt32):

  • b3/B3MathExtras.h: Added.
  • b3/B3MemoryValue.h:
  • b3/testb3.cpp:

(JSC::B3::testPowDoubleByIntegerLoop):
(JSC::B3::run):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::compileArithPowIntegerFastPath):

  • ftl/FTLB3Output.cpp:

(JSC::FTL::Output::doublePowi):

  • ftl/FTLB3Output.h:

(JSC::FTL::Output::doublePowi): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r193974 r193989  
    42244224{
    42254225    MacroAssembler::JumpList skipFastPath;
    4226     skipFastPath.append(assembler.branch32(MacroAssembler::LessThan, yOperand, MacroAssembler::TrustedImm32(0)));
    4227     skipFastPath.append(assembler.branch32(MacroAssembler::GreaterThan, yOperand, MacroAssembler::TrustedImm32(1000)));
     4226    skipFastPath.append(assembler.branch32(MacroAssembler::Above, yOperand, MacroAssembler::TrustedImm32(1000)));
    42284227
    42294228    static const double oneConstant = 1.0;
Note: See TracChangeset for help on using the changeset viewer.