Repository navigation
arm64: NEON div and max/min, Go 1.27 mnemonics for sqrt/add/sub/mul; parallelFor findings - #30
Merged
Merged
Conversation
…ls (Go 1.27) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asurements replace the cache-affinity guess Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers off arm64 (dead there) 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.
What changes
VFSQRT,VFADD,VFSUB,VFMUL,VFDIV,VFMAXandVFMINon.D2. Each was assembled with go1.27.1 and checked against its disassembly.VFSQRT V0.D2, V0.D2→6ee1f800, the word the kernel emitted before. Go's order for the subtraction:VFSUB V1, V2, V0gives V0 = V2 − V1.WORDs becomeVFSQRT, with identical machine code.VFADD/VFSUB/VFMULreplace the exact-FMA-against-1.0 trick. Results are bit-identical, and the code is easier to read.VFDIVkernel. Division was scalar on arm64; the README already claimed it was NEON.VFMAX/VFMINkernel with four D2 accumulators, used from 8 elements up; below that, the scalar oracle.reduce_unrolled.gois now excluded on arm64, where it would be dead code, which the coverage gate caught.FMLA …D[i]of the GEMM. Go has no mnemonic for it yet (pending as CL 764224).Tests
TestMaxMinSIMDSpecialsInVectorLanesputs ±0 and ±Inf at every position of arrays of 8–40 elements, so they reach every vector lane and the tail. The old specials test had 6 elements and only reached the scalar path.subgives b−a),VFMINused inmaxNEON, and the fold dropping two accumulators.-race.go vetis clean on arm64, amd64, ppc64le, loong64, riscv64 and 386.Measured (one core, 8 interleaved rounds against v0.5.1, medians)
Sum,SqrtIntoandAddIntodo not change and measure 1.00×, which serves as the control.Docs
parallelFor's fork/join (2.4 of 8 CPUs busy). Three replacement schedulers were tried. None ships: each fixes one worker count and breaks another. Keeping exactly the static chunks still lost, which refutes the affinity idea. The code is onexperiment/parallel-for-scheduling.Version: v0.5.2 (kernels and docs, no API change).
🤖 Generated with Claude Code