Repository navigation
perf: loong64 Max/Min (float64, float32) in LSX integer arithmetic - #71
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Proves CI's loong64 lane (qemu la464, LASX required) fails on a broken kernel. The next push removes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…now fail) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… docs 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.
loong64
Max/Minfor float64 and float32, the last 64-bit target without vector extrema. It also closes a test gap that the sabotage run found.Kernels in LSX integer arithmetic. Go's loong64 assembler has no vector float max, min or compare:
t = x XOR ((x >>a N−1) >>l 1)flips the magnitude bits of the negatives. The signed order oftis the float order, with −0 below +0 (Go's rule), and the map is its own inverse.max(acc, t) = acc XOR ((acc XOR t) AND (acc < t))(vslt.d/vslt.w); min swaps the compare.(x AND abs) >u +Inf's bits(vsltu). The masks are OR-accumulated and returned as a flag.The four accumulators fold the same way into one vector, stored in
torder. Go maps it back and folds the lanes and the tail with itsmax/min.The test gap.
max32LSX's first lane dropped, passed CI.math.NaN(), which is positive. A negative NaN sorts below everything, and only the NaN test catches it. x86's default NaN (0×∞,∞−∞) is negative.TestExtrema32MatchSequential: special Max32 n=16: -0, sequential NaN, loong64 lane), while every other architecture's kernels passed the negative-NaN cases.Validated under emulation only. CI's loong64 lane runs qemu
la464with LASX required (#67). The Loongson these would be timed on (cfarm401) accepted TCP but never sent its SSH banner today, so their speed is not measured yet.docs/perf.mdsays so.The local coverage gate (
covblocks) reports 0 uncovered blocks.SECURITY.mdrecords the test gap.A minor release, v0.25.0.
🤖 Generated with Claude Code