Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional Cranelift-based JIT compiler that translates hot MIPS R4400 basic blocks to native x86_64 code at runtime. Feature-gated behind
--features jitand controlled byIRIS_JIT=1at runtime.Architecture
Compiled instructions
Key design decisions
extern "C" fn(*mut JitContext)block signature with#[repr(C)]bridge structblack_boxpointer casts to defeat LLVM noalias optimization through LTOsync_to_executoronly writes back GPRs/PC/hi/lo — CP0, nanotlb, and FPR are managed directly on the executor by helpersRuntime configuration
IRIS_JITIRIS_JIT_MAX_TIERIRIS_JIT_VERIFYIRIS_JIT_PROBEIRIS_JIT_PROBE_MINIRIS_JIT_PROBE_MAXIRIS_JIT_STABLEIRIS_JIT_PROMOTEIRIS_JIT_DEMOTENew files
src/jit/mod.rs— module rootsrc/jit/compiler.rs— Cranelift block compilersrc/jit/dispatch.rs— adaptive dispatch loopsrc/jit/context.rs— JitContext bridge struct and syncsrc/jit/helpers.rs— extern "C" memory access helperssrc/jit/cache.rs— code cache with tier metadatasrc/jit/snapshot.rs— CPU rollback snapshotssrc/jit/profile.rs— profile save/loadTest plan
IRIS_JIT=1 IRIS_JIT_MAX_TIER=0— ALU+branches only, boots to loginIRIS_JIT=1 IRIS_JIT_MAX_TIER=1— loads enabled, boots to loginIRIS_JIT=1— full tier with stores, boots to loginIRIS_JIT=0— interpreter-only, no regression