-
Notifications
You must be signed in to change notification settings - Fork 77
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
dialects (arm): add mul instruction with 2 source registers #3515
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3515 +/- ##
==========================================
- Coverage 90.33% 90.33% -0.01%
==========================================
Files 464 464
Lines 58157 58165 +8
Branches 5557 5559 +2
==========================================
+ Hits 52536 52542 +6
- Misses 4190 4192 +2
Partials 1431 1431 ☔ View full report in Codecov by Sentry. |
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.
Looks good.
What's the plan for the 2 operand case? I believe the work I'm doing to fix the bufferization operation would allow you to have an optional result here, though that might mess with your naming scheme.
thanks! |
Either would probably work. Which would be better in the long run is hard to tell and probably depends on how you plan to use these operations. |
xdsl/dialects/arm/ops.py
Outdated
|
||
def __init__( | ||
self, | ||
d: IntRegisterType, |
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.
This is where the named argument is better than positional, as it would make sense for me to make this the unallocated type by default, as in the RISC-V equivalent.
I would expect that the two operand case is some sort of assembly shorthand, we could add some custom logic to print it that way when the second argument happens to be the same register as the result, but I don't think we want that reflected in the IR. |
…ect#3515) Add mul instruction (https://developer.arm.com/documentation/ddi0597/2024-06/Base-Instructions/MUL--MULS--Multiply-?lang=en). The mul instruction supports either 2 or 3 operands (in the case of 2, the destination is also treated as the 2nd source). This PR only handles the case where 3 operands are provided, 2 source registers and 1 destination.
Add mul instruction (https://developer.arm.com/documentation/ddi0597/2024-06/Base-Instructions/MUL--MULS--Multiply-?lang=en).
The mul instruction supports either 2 or 3 operands (in the case of 2, the destination is also treated as the 2nd source). This PR only handles the case where 3 operands are provided, 2 source registers and 1 destination.