Repository navigation
perf: float32 pairwise sum blocks on VSX (ppc64le) - #56
Merged
Merged
Conversation
blocks8VSX keeps the eight accumulators in two VSX registers (two dependency chains) and adds each block with xvaddsp, one IEEE float32 addition per lane, so the result is the scalar loop's bit for bit. LXVW4X/STXVW4X keep every word in its lane. VSX is the ppc64le baseline. Go's assembler has no xvaddsp; go-asmgen v0.18.0 emits it as a WORD pinned against GNU as and llvm-mc (go-asmgen/asmgen#27; the cmd/asm side is CL 846285). POWER9 (cfarm29), alternating base/head, GOMAXPROCS=1, pinned core, benchstat n=10: float32 Sum -36% (2^14) / -48% (2^20); float64 and int32 unchanged. The kernel tests and the PROT_NONE fence pass there; a sabotaged kernel (xvsubsp) fails them. docs/perf.md: the ppc64le section; s390x is what is left (vfasb, CL 846286). SECURITY.md: audit entry for the float32 block kernels. Co-Authored-By: Claude Opus 5.5 <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.
blocks8VSX, the float32 pairwise-sum block kernel for ppc64le. It completes the set after SSE2/NEON (#54) and RVV/LSX (#55).xvaddsp, one IEEE float32 addition per lane, so the result is the scalar loop's bit for bit.LXVW4X/STXVW4Xkeep every word in its lane. VSX is the ppc64le baseline, so there is no feature check.xvaddsp. go-asmgen v0.18.0 emits it as aWORD, pinned against GNU as 2.44 and llvm-mc on a POWER9 (gap/ppc64: the VSX single-precision family (xvaddsp ... xvsqrtsp) go-asmgen/asmgen#27). The cmd/asm spelling is CL 846285. Regenerating every other arch with v0.18.0 changes no byte.GOMAXPROCS=1, pinned core, benchstat n=10:SumSum(control)Sum(control)TestBlocks8StaysInsideItsOperands) and the whole root suite pass. A sabotaged kernel (onexvsubsp) failsTestAddBlocks8F32MatchesScalar.docs/perf.mdgets a ppc64le section, and s390x is what is left (vfasb, CL 846286).SECURITY.mdgets an audit entry for the float32 block kernels.🤖 Generated with Claude Code