amd64/arm64: expand compression assembly support#17
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
zhouguangyuan0718
marked this pull request as ready for review
July 19, 2026 11:11
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.
What changed
NOTBtranslation for register and memory operands.LSRW,TST,BMI, andBPLtranslation.FLDPQpair loads andVMOVIbyte-vector constants.TST X0, X0and 64-bitSUBSimmediate instructions.TEST_SRC()expand without leaving a trailing().FuncSig.Nameas the emitted symbol for external declarations, calls, and tail calls.Why
Optimized compression dependencies exposed missing Plan 9 assembly coverage in LLGo:
github.com/dchest/siphashdependency usesNOTB R11.github.com/klauspost/compress/s2uses arm64LSRW, a multi-line zero-argumentTEST_SRC()macro, and callsruntime.memmovewhile LLGo links libcmemmove.github.com/klauspost/reedsolomonusesBMI,BPL, andTST; its generated SVE assembly also emits flag-writingTSTandSUBSinstructions throughWORDdirectives.github.com/minio/crc64nvmeusesFLDPQto load two 128-bit FP/vector registers andVMOVIto initialize a byte vector.Without these translations, LLGo rejects selected assembly instructions, loses the condition flags needed by later branches, generates an invalid macro-expanded branch target, or cannot express an external source symbol whose emitted name differs.
Semantics
NOTBflips only the selected low byte and preserves upper register bits; its memory form loads, flips, and stores one byte. Flags are unchanged.LSRWperforms a 32-bit logical right shift, masks register shift amounts to 0-31, and zero-extends the result to 64 bits.TSTupdates the ARM64 logical N/Z flags, whileBMIandBPLbranch on the negative flag and its inverse.FLDPQperforms two 128-bit loads and writes the vector slots aliased by itsFregister pair;VMOVIsupports the B8 and B16 byte arrangements.WORDhandling remains permissive and only decodes the known reedsolomon flag-writing encodings; unrelated embedded opcodes are still ignored as before.FuncSig.Nameselects the emitted external symbol while signature lookup remains keyed by the resolved Plan 9 symbol.Validation
NOTB; arm64LSRW,TST,BMI,BPL,FLDPQ,VMOVI, and raw flag-writing words; zero-argument function-like macro expansion; and externalFuncSig.Nameon amd64/arm64.go test ./...passes on the combined PR branch.github.com/klauspost/compress/s2,github.com/klauspost/reedsolomon, andgithub.com/minio/crc64nvmewhile using this local plan9asm checkout.