RONDB-880#16
Open
svenssonaxel wants to merge 4 commits into
Open
Conversation
mronstro
force-pushed
the
24.10-main
branch
9 times, most recently
from
July 25, 2025 22:45
6e4c18e to
357ced2
Compare
mronstro
force-pushed
the
24.10-main
branch
from
September 10, 2025 16:20
be7d618 to
4cad7f7
Compare
mronstro
pushed a commit
that referenced
this pull request
May 4, 2026
Adds extract_one_arm64() alongside extract_one_x86. Two-pass walk:
Pass 1 — relocations: strip the trailing R_AARCH64_CALL26/JUMP26
`b next` (4 bytes) for ordinary stencils; for the branch
stencil keep both unconditional branches and classify the one
against `next` as HK_BRANCH_FALL, the one against HOLE_BLT_TGT
as HK_BRANCH_TAKE.
Pass 2 — magic-byte chain scan: walk every 4-byte instruction in
the trimmed stencil, decode movz/movk (sf=1 forms), accumulate
per-Rd 64-bit value with per-slot byte offsets. When a register
matches one of the magics in kHoleMagicTable, emit four Hole
entries (one per imm16 slot, width=4, all sharing the kind from
the table). Reset on match to avoid double-counting. movn-based
chains are deliberately not detected — none of the random
magics trigger movn lowering.
Also adds kArm64Terminator (ldp x20, x30, [sp], #16; ret) — paired
with the future Day 4 jit1 aarch64 preamble — and refactors
emit_header to take the predef-macro string directly instead of
constructing __%s__ from an arch tag.
Verified on macOS Apple Silicon with brew llvm@20:
- aarch64 extraction yields 8 stencils with hole counts matching
expectations (4 per magic chain plus branch relocs).
- LCI_DST chain in op_load_const_int shows the expected
interleaving (offsets 24,28,36,40 — clang slipped a non-mov
instruction between slots 16 and 32) — extractor handled
correctly via per-Rd accumulators.
- op_branch_lt_int_int chains BLT_A/BLT_B interleaved slot-by-slot
(clang scheduled both chains in lockstep) — handled correctly.
- x86_64 regression: cross-compiled stencils.o re-extracts to the
same bytes as the Phase 1 hand-authored stencils_x86_64.h for
all 6 non-trivial stencils.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mronstro
pushed a commit
that referenced
this pull request
May 29, 2026
Adds extract_one_arm64() alongside extract_one_x86. Two-pass walk:
Pass 1 — relocations: strip the trailing R_AARCH64_CALL26/JUMP26
`b next` (4 bytes) for ordinary stencils; for the branch
stencil keep both unconditional branches and classify the one
against `next` as HK_BRANCH_FALL, the one against HOLE_BLT_TGT
as HK_BRANCH_TAKE.
Pass 2 — magic-byte chain scan: walk every 4-byte instruction in
the trimmed stencil, decode movz/movk (sf=1 forms), accumulate
per-Rd 64-bit value with per-slot byte offsets. When a register
matches one of the magics in kHoleMagicTable, emit four Hole
entries (one per imm16 slot, width=4, all sharing the kind from
the table). Reset on match to avoid double-counting. movn-based
chains are deliberately not detected — none of the random
magics trigger movn lowering.
Also adds kArm64Terminator (ldp x20, x30, [sp], #16; ret) — paired
with the future Day 4 jit1 aarch64 preamble — and refactors
emit_header to take the predef-macro string directly instead of
constructing __%s__ from an arch tag.
Verified on macOS Apple Silicon with brew llvm@20:
- aarch64 extraction yields 8 stencils with hole counts matching
expectations (4 per magic chain plus branch relocs).
- LCI_DST chain in op_load_const_int shows the expected
interleaving (offsets 24,28,36,40 — clang slipped a non-mov
instruction between slots 16 and 32) — extractor handled
correctly via per-Rd accumulators.
- op_branch_lt_int_int chains BLT_A/BLT_B interleaved slot-by-slot
(clang scheduled both chains in lockstep) — handled correctly.
- x86_64 regression: cross-compiled stencils.o re-extracts to the
same bytes as the Phase 1 hand-authored stencils_x86_64.h for
all 6 non-trivial stencils.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mronstro
pushed a commit
that referenced
this pull request
Jun 5, 2026
Adds extract_one_arm64() alongside extract_one_x86. Two-pass walk:
Pass 1 — relocations: strip the trailing R_AARCH64_CALL26/JUMP26
`b next` (4 bytes) for ordinary stencils; for the branch
stencil keep both unconditional branches and classify the one
against `next` as HK_BRANCH_FALL, the one against HOLE_BLT_TGT
as HK_BRANCH_TAKE.
Pass 2 — magic-byte chain scan: walk every 4-byte instruction in
the trimmed stencil, decode movz/movk (sf=1 forms), accumulate
per-Rd 64-bit value with per-slot byte offsets. When a register
matches one of the magics in kHoleMagicTable, emit four Hole
entries (one per imm16 slot, width=4, all sharing the kind from
the table). Reset on match to avoid double-counting. movn-based
chains are deliberately not detected — none of the random
magics trigger movn lowering.
Also adds kArm64Terminator (ldp x20, x30, [sp], #16; ret) — paired
with the future Day 4 jit1 aarch64 preamble — and refactors
emit_header to take the predef-macro string directly instead of
constructing __%s__ from an arch tag.
Verified on macOS Apple Silicon with brew llvm@20:
- aarch64 extraction yields 8 stencils with hole counts matching
expectations (4 per magic chain plus branch relocs).
- LCI_DST chain in op_load_const_int shows the expected
interleaving (offsets 24,28,36,40 — clang slipped a non-mov
instruction between slots 16 and 32) — extractor handled
correctly via per-Rd accumulators.
- op_branch_lt_int_int chains BLT_A/BLT_B interleaved slot-by-slot
(clang scheduled both chains in lockstep) — handled correctly.
- x86_64 regression: cross-compiled stencils.o re-extracts to the
same bytes as the Phase 1 hand-authored stencils_x86_64.h for
all 6 non-trivial stencils.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.