Skip to content
Working area for collabouratively developing POWER9 JIT for Firefox.
Branch: master
Clone or download
Latest commit f3a87d2 Apr 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Architecture-mips-shared.cpp
Architecture-mips-shared.h upload work so far Mar 21, 2019
Architecture-mips64.cpp
Architecture-mips64.h upload work so far Mar 21, 2019
Assembler-mips-shared.cpp
Assembler-mips-shared.h upload work so far Mar 21, 2019
Assembler-mips64.cpp
Assembler-mips64.h upload work so far Mar 21, 2019
AtomicOperations-mips-shared.h upload work so far Mar 21, 2019
AtomicOperations-ppc64le.h upload work so far Mar 21, 2019
Bailouts-mips-shared.cpp upload work so far Mar 21, 2019
Bailouts-mips64.cpp upload work so far Mar 21, 2019
Bailouts-mips64.h upload work so far Mar 21, 2019
Bailouts-ppc64le.cpp upload work so far Mar 21, 2019
Bailouts-ppc64le.h
BaselineCompiler-mips-shared.cpp upload work so far Mar 21, 2019
BaselineCompiler-mips-shared.h upload work so far Mar 21, 2019
BaselineCompiler-mips64.cpp upload work so far Mar 21, 2019
BaselineCompiler-mips64.h upload work so far Mar 21, 2019
BaselineCompiler-ppc64le.cpp upload work so far Mar 21, 2019
BaselineCompiler-ppc64le.h
BaselineIC-mips-shared.cpp upload work so far Mar 21, 2019
BaselineIC-mips64.cpp upload work so far Mar 21, 2019
BaselineIC-ppc64le.cpp upload work so far Mar 21, 2019
CodeGenerator-mips-shared.cpp upload work so far Mar 21, 2019
CodeGenerator-mips-shared.h
CodeGenerator-mips64.cpp upload work so far Mar 21, 2019
CodeGenerator-mips64.h upload work so far Mar 21, 2019
CodeGenerator-ppc64le.cpp upload work so far Mar 21, 2019
CodeGenerator-ppc64le.h upload work so far Mar 21, 2019
LICENSE
LIR-mips-shared.h upload work so far Mar 21, 2019
LIR-mips64.h
LIR-ppc64le.h upload work so far Mar 21, 2019
Lowering-mips-shared.cpp upload work so far Mar 21, 2019
Lowering-mips-shared.h upload work so far Mar 21, 2019
Lowering-mips64.cpp upload work so far Mar 21, 2019
Lowering-mips64.h upload work so far Mar 21, 2019
Lowering-ppc64le.cpp upload work so far Mar 21, 2019
Lowering-ppc64le.h upload work so far Mar 21, 2019
MacroAssembler-mips-shared-inl.h
MacroAssembler-mips-shared.cpp upload work so far Mar 21, 2019
MacroAssembler-mips-shared.h upload work so far Mar 21, 2019
MacroAssembler-mips64-inl.h upload work so far Mar 21, 2019
MacroAssembler-mips64.cpp upload work so far Mar 21, 2019
MacroAssembler-mips64.h upload work so far Mar 21, 2019
MacroAssembler-ppc64le-inl.h upload work so far Mar 21, 2019
MacroAssembler-ppc64le.cpp upload work so far Mar 21, 2019
MacroAssembler-ppc64le.h work so far Apr 8, 2019
MoveEmitter-mips-shared.cpp upload work so far Mar 21, 2019
MoveEmitter-mips-shared.h upload work so far Mar 21, 2019
MoveEmitter-mips64.cpp
MoveEmitter-mips64.h upload work so far Mar 21, 2019
MoveEmitter-ppc64le.cpp upload work so far Mar 21, 2019
MoveEmitter-ppc64le.h upload work so far Mar 21, 2019
README.md
SharedIC-mips64.cpp upload work so far Mar 21, 2019
SharedIC-ppc64le.cpp upload work so far Mar 21, 2019
SharedICHelpers-mips-shared-inl.h
SharedICHelpers-mips-shared.h upload work so far Mar 21, 2019
SharedICHelpers-ppc64le-inl.h upload work so far Mar 21, 2019
SharedICHelpers-ppc64le.h upload work so far Mar 21, 2019
SharedICRegisters-mips64.h upload work so far Mar 21, 2019
SharedICRegisters-ppc64le.h upload work so far Mar 21, 2019
Simulator-mips64.cpp upload work so far Mar 21, 2019
Simulator-mips64.h upload work so far Mar 21, 2019
Trampoline-mips64.cpp upload work so far Mar 21, 2019
Trampoline-ppc64le.cpp upload work so far Mar 21, 2019

README.md

JITPOWER

This is a temporary staging ground for work on the Firefox ppc64 JIT. Once the MVP has been completed, the intention is to add it to the Firefox tree for maintenance as part of Firefox and this repo will eventually be removed.

MVP Definition

The Minimum Viable Product is a POWER9 little-endian JIT with Wasm and without SIMD running with the 64-bit ABI and a 64K page size. There is certainly interest and value in big-endian and additional 64-bit PowerPC support (potentially all the way down to the 970/G5), but these can be grafted on after the fact and the SpiderMonkey JIT core is known to have endian problems which need fixing separately (see TenFourFox for more on that). Additionally, POWER9 is a viable desktop system thanks to the Raptor Talos family which developers are likely to already be using, and the new instructions in ISA 3.0 make initial porting substantially simpler on POWER9.

SIMD is a separate issue which will not be addressed during the MVP period, and isn't necessary to get the JIT off the ground on any platform.

Work Phases

Required For MVP

  1. Create a first draft JIT using the existing MIPS64 LE sources from Fx62 as a scaffold. Fx62 was chosen simply because it was the version when the port was originally commenced; there's nothing special about it otherwise other than to eliminate churn with constantly integrating new changes. This step is already in progress.
  2. Ensure the first draft JIT compiles. A temporary Fx62 tree will probably be uploaded to facilitate this.
  3. Ensure the first draft JIT links (add any missing functions).
  4. Ensure the first draft JIT passes all tests in Fx62 (all tests in js/src/jit-test, js/src/tests and jsapi-tests).
  5. Forward port the first draft JIT to mozilla-central as the second draft JIT.
  6. Ensure the second draft JIT compiles.
  7. Ensure the second draft JIT links.
  8. Repair any new test failures.
  9. Submit to Bugzilla in separate patch sets (patches needed against the JIT core, and new files).

In Scope But Not Required For MVP

  1. Simulator support to allow automated testing.

Not In Scope For MVP (but desirable)

Roughly in order of priority:

  1. Support for POWER8 and earlier.
  2. BE support.
  3. Support for non-64K page sizes.
  4. SIMD with VMX/VSX.

Please don't submit pull requests for these yet unless they are trivial.

Phase 1: What's Done So Far (And Might Even Work)

Some of this code originates from TenFourFox's IonPower JIT.

  • Ion code generator (CodeGenerator*)
  • Baseline code generator (BaselineCompiler*)
  • Baseline and shared inline cache code generators (BaselineIC*, SharedIC*)
  • LIR (intermediate representation) design (LIR*.h)
  • Basic lowering/strength reduction (Lowering*)
  • Bailouts (Bailouts*)
  • Move code generator (MoveEmitter*)
  • Trampoline code generator (Trampoline*.cpp)

What's remaining to do:

  • Check my work, because I'm an idiot
  • Define Architecture and exact interal JIT ABI usage, including temporary registers; see the ABI documentation
    • Current plan is to use r0 and r12 as temporary registers (regenerating r12 when making PLT-like calls back to PPC64 ABI-compliant code through mtctr bctr); r12 or some other non-r0 register needed as an "address" holder
    • Try to enable use of as many GPRs and FPRs as possible
    • Don't define SPRs other than lr outside of our JIT backend since SpiderMonkey doesn't understand the concept
    • No vector registers for the MVP
  • Create MacroAssembler (ma_* functions) based on those used by the code generators
  • Create Assembler (as_* [native instructions] and xs_* [commonly accepted alternative mnemonics] functions) based on instructions issued by the code generators and the macro assembler

Feel free to start on what you like

The original MIPS code from which the new source was cribbed and rewritten is provided. Don't remove these just in case we need to refer back to them for the original semantics.

All code is MPL 2.0 and you agree that by submitting a pull request, you automatically grant use of your work under that license.

You can’t perform that action at this time.