Repository navigation
x86: opt-in -fzext-load, zero-extending loads with 64-bit results (#25, approved trusted-base change) - #37
Merged
Merged
Conversation
…sults Trusted-base change approved in issue #25: the Asm instructions Pmovzbq_rm, Pmovzwq_rm, Pmovzbq_rr and Pmovzwq_rr (movzbl/movzwl viewed as producing a zero-extended 64-bit result), their semantics (exec_load_zx) and their printing. New operators Ozextb64/Ozextw64. With -fzext-load (off by default), selection turns longofintu of an 8/16-bit unsigned load or cast into them, and the Linear Loadop pass fuses the load with the extension into the memory forms. The binary load-op fusion remains gated on -fload-op. Without the flag the generated code is unchanged. siphash24: -6%.
…tion 20) Also fixes the README changes table, which blank lines had split, and updates the verification summary. Closes #25.
This was referenced Oct 23, 2026
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.
Closes #25. Trusted-base change, approved by the owner on 2026-10-22 (recorded on #25).
Trusted part: exactly the approved text
x86/Asm.v: the four constructorsPmovzbq_rm,Pmovzwq_rm,Pmovzbq_rrandPmovzwq_rr, theexec_load_zxhelper, and theirexec_instrcases.x86/TargetPrinter.ml: the four printer cases, identical to the existingmovzbl/movzwlones.extraction/extraction.v: flag wiring only.Validation:
asm_difftestgroupzxloadcompares the full 64-bit destination against the extracted semantics. 0 mismatches, and the upper 32 bits were always zeroed. The only undefined cases are misaligned 16-bit addresses, which the model treats asStuck, as it does for the existingPmovzw_rm. I re-ran the test with a fresh seed.Verified part (behind
-fzext-load, off by default)Ozextb64/Ozextw64, used by selection forlongofintuof 8/16-bit unsigned loads and casts.Loadoppass fuses the load with the extension. Binary load-op fusion remains gated on-fload-op.Results
-fzext-load: siphash24 −6% (my re-run: 0.163 → 0.153 s). aes is unchanged.Protocol checklist (#1)
x86/Asm.vandx86/TargetPrinter.ml(approved text only), plus the flag line inextraction/extraction.v.check_axioms.sh: adds onlyCompopts.optim_zextload.make proof+make ccomp: all 6 targets. After rebasing onto master I re-checked x86_64 (clean build), arm and aarch64.make -C test all test: 154 passed, both by default and with-fzext-load -fload-op -fshift-mask -ftrust-libmtogether.The branch was rebased onto master by me, with the owner's permission. The implementing agent's own rebase was blocked by the permission system. The two conflicts were adjacent flag declarations.
Also fixes the README "Changes" table, which blank lines had split into several pieces.