Repository navigation
Conversation
Simplify the LSX and LASX isamax/isamin/idamax/idamin kernels: use a single seed-then-loop structure for both the unit-stride and strided cases, and locate the index by rescanning only the winning vector block. This removes the duplicated unrolled code and the per-lane index bookkeeping of the old kernels.
Same rework as the real isamax/isamin kernels, applied to the absolute-value variants (isamax/isamin, idamax/idamin): one shared structure for unit-stride and strided input, block reduction followed by a rescan of the winning block for the exact first matching index.
Same rework as the other index search kernels, applied to the complex variants (icamax/icamin, izamax/izamin): the |Re| + |Im| magnitudes of a whole vector block are reduced at once, and only the winning block is rescanned to get the index of the first occurrence.
This branch has not been deployed
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.
Simplify LoongArch64 index-search kernels and optimize complex scaling kernels.
The LSX/LASX isamax/isamin, idamax/idamin, icamax/icamin and izamax/izamin kernels have been reworked: replace the old fully-unrolled inner loop with per-lane index tracking with a unified seed-then-loop block reduction scheme, supporting both unit-stride and strided paths.
We reduce a full vector block at once (|Re| + |Im| for complex variants), then only rescan the winning block to get the index of the first extremum.