Skip to content
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 mov op #3476

Merged
merged 8 commits into from
Nov 25, 2024
Merged

dialects (arm): add mov op #3476

merged 8 commits into from
Nov 25, 2024

Conversation

emmau678
Copy link
Contributor

Add a mov op that moves data from source to destination

@emmau678 emmau678 added the dialects Changes on the dialects label Nov 19, 2024
@emmau678 emmau678 self-assigned this Nov 19, 2024
@emmau678 emmau678 marked this pull request as ready for review November 19, 2024 15:29
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.33%. Comparing base (f617e48) to head (05d6c38).
Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3476      +/-   ##
==========================================
+ Coverage   90.26%   90.33%   +0.06%     
==========================================
  Files         462      464       +2     
  Lines       57820    58157     +337     
  Branches     5565     5557       -8     
==========================================
+ Hits        52192    52536     +344     
+ Misses       4191     4190       -1     
+ Partials     1437     1431       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@irdl_op_definition
class DSMovOp(ARMOperation):
"""
Copies the value of r1 into r2.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are r1 and r2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this should be operand(2) and rd

name = "arm.ds.mov"

rd = result_def(IntRegisterType)
operand2 = operand_def(IntRegisterType)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having an operand2 but no operand feels odd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just following the ARM documentation for this instruction (https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/mov), but I can change it

xdsl/dialects/arm/ops.py Show resolved Hide resolved
xdsl/dialects/arm/ops.py Outdated Show resolved Hide resolved
emmau678 and others added 3 commits November 20, 2024 08:45
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Copy link
Collaborator

@alexarice alexarice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have put one small comment (which is more of a personal preference thing so feel free to ignore) then this looks good to merge from my end.

s: Operation | SSAValue,
*,
comment: str | StringAttr | None = None,
d: IntRegisterType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally put this as a positional argument.

emmau678 and others added 2 commits November 20, 2024 09:55
Add assembly printing for ARM instructions
Note: stacked PR

---------

Co-authored-by: emmau678 <eu233@Emma-laptop>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
@emmau678 emmau678 merged commit 91d3100 into main Nov 25, 2024
14 checks passed
@emmau678 emmau678 deleted the emma/arm-mov-op branch November 25, 2024 13:47
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
Add a mov op that moves data from source to destination

---------

Co-authored-by: emmau678 <eu233@Emma-laptop>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants