-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for WREG OPASSIGN WREG #764
Conversation
Signed-off-by: Alan Jowett <[email protected]>
WalkthroughThe changes involve a modification to the regex pattern in the Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
📒 Files selected for processing (1)
- src/asm_parse.cpp (1 hunks)
🔇 Additional comments (1)
src/asm_parse.cpp (1)
157-157
: LGTM! Verify existing instruction patterns.The change correctly enforces that both operands must be wide registers (w or r prefix), which aligns with the expected instruction format.
Let's verify existing instruction patterns in the codebase:
✅ Verification successful
Change is safe and consistent with existing patterns
Based on the verification results:
- The regex pattern change from
WREG OPASSIGN REG
toWREG OPASSIGN WREG
is consistent with the codebase's usage.- All test files in
test-data/
show register assignments using the same register type (r-to-r or w-to-w), confirming this is the expected behavior.- The pattern is used in
src/asm_parse.cpp
alongside other patterns that correctly handle register width requirements.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for instruction patterns that might be affected by the WREG OPASSIGN REG to WREG OPASSIGN WREG change # Test 1: Look for test files containing instruction patterns echo "Searching for test files with instruction patterns:" rg -l "WREG.*OPASSIGN.*REG" "test/" # Test 2: Look for actual instruction examples in test files echo -e "\nSearching for actual instruction examples:" rg -A 2 "r\d+\s*=\s*[rw]\d+" "test/"Length of output: 378
Script:
#!/bin/bash # Let's try a different approach to find test files and instruction patterns # First, find all test-related files in the repository echo "Finding test files in the repository:" fd -t f "test" . # Look for any files containing instruction patterns or register assignments echo -e "\nSearching for instruction patterns in all files:" rg -l "r\d+\s*=\s*[rw]\d+" . # Look for actual regex pattern usage echo -e "\nSearching for WREG and REG pattern usage:" rg "WREG|REG" . # Look for actual instruction examples echo -e "\nSearching for register assignment examples:" rg -A 2 "[rw]\d+\s*=\s*[rw]\d+" .Length of output: 10689
This pull request includes a change to the
parse_instruction
function in thesrc/asm_parse.cpp
file to correct the parsing of a specific instruction format.Parsing correction:
src/asm_parse.cpp
: Modified the regular expression in theparse_instruction
function to correctly match theWREG OPASSIGN WREG
pattern instead of the incorrectWREG OPASSIGN REG
pattern.Summary by CodeRabbit
New Features
Bug Fixes