RISC-V: fold redundant code in riscv_ip()
Jan fixed an issue reported by Jiawei and suggests a patch to rename 'O4' before applying the main patch for clearer code.
Jan Beulich responds to Jiawei’s review of a patch series that folds redundant code in riscv_ip(). He confirms fixing an issue reported, and suggests inserting a patch to rename O4 to O7 for clarity. This would simplify the main patch by avoiding the introduction and immediate removal of a misleading comment.
- contributor
Confirms fixing an issue reported by Jiawei and suggests inserting a patch to rename 'O4' before applying the main patch.
“I've fixed this. For this I'm rather inclined to insert a patch ahead of this one. Then the odd ... won't even need introducing (just to later delete it again).”
In Details
The riscv_ip() function is likely involved in instruction pattern matching (IP) for the RISC-V architecture within binutils. The discussion centers around refactoring the code to reduce redundancy in parsing instruction operands, making it easier to add new sub-forms. Renaming O4 to O7 aims to clarify the meaning of a 7-bit field.
For Context
This discussion concerns the internal implementation of binutils, a collection of binary tools like assemblers and linkers. The specific area of focus is the RISC-V architecture and how binutils handles instruction patterns. The goal is to simplify the code for parsing instruction operands, making it easier to maintain and extend.