Riscv LMUL#2
Open
dop-amin wants to merge 21 commits into
Open
Conversation
Collaborator
dop-amin
commented
Aug 19, 2025
- Allow allocating register ranges following LMUL mandates
- For instructions using specifier, merge parts of the logic with the one for LMUL
- Add tests and examples
* Allow allocating register ranges following LMUL mandates * For instructions using <nf> specifier, merge parts of the logic with the one for LMUL * Add tests and examples
…gister extraction - Add early return for simple cases (expansion_factor <= 1) - Extract _extract_base_registers helper function to reduce code duplication - Replace complex nested if-else logic with cleaner helper function calls - Consolidate LMUL and NF instruction writing into unified _write_expanded_instruction - Rename _write_lmul_instruction to _write_expanded_instruction for generality - Simplify _expand_vector_registers_for_nf to auto-infer NF value from instruction The refactoring reduces code complexity while maintaining the same functionality for both LMUL register grouping and NF load/store whole register operations. 🤖 Generated with the help of Claude Code
* Allow allocating register ranges following LMUL mandates * For instructions using <nf> specifier, merge parts of the logic with the one for LMUL * Add tests and examples
…gister extraction - Add early return for simple cases (expansion_factor <= 1) - Extract _extract_base_registers helper function to reduce code duplication - Replace complex nested if-else logic with cleaner helper function calls - Consolidate LMUL and NF instruction writing into unified _write_expanded_instruction - Rename _write_lmul_instruction to _write_expanded_instruction for generality - Simplify _expand_vector_registers_for_nf to auto-infer NF value from instruction The refactoring reduces code complexity while maintaining the same functionality for both LMUL register grouping and NF load/store whole register operations. 🤖 Generated with the help of Claude Code
88a5fa9 to
e7c4777
Compare
…r RISCVVectorIntegerVectorVectorMasked * Needs smae process to be applied for further classes
dop-amin
pushed a commit
that referenced
this pull request
Dec 2, 2025
When parsing a loop, SLOTHY tries to match any of the available loop types and takes the first that matches. This could lead to the unfortunately situation that a Armv7E-M loop type matches for AArch64 code. For example, previously this code would match a Armv7E-M BranchLoop: count .req x2 mov count, slothy-optimizer#16 start: add x5, x5, x4 add x7, x5, x1 ldr x5, [x0, slothy-optimizer#4] add x5, x5, x7 subs count, count, #2 b.ne start This makes absolutely no sense and would ultimately result in a mysterious error message that b.ne is not a known instruction. This commit fixes that by only trying to parse loop types for the current architecture.
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.