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): initialise ARM dialect #3455

Merged
merged 15 commits into from
Nov 18, 2024
Merged

dialects (arm): initialise ARM dialect #3455

merged 15 commits into from
Nov 18, 2024

Conversation

emmau678
Copy link
Contributor

Initialise ARM dialect

@emmau678 emmau678 added the dialects Changes on the dialects label Nov 15, 2024
@emmau678 emmau678 self-assigned this Nov 15, 2024
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.21%. Comparing base (33a9e6a) to head (c32a45f).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3455   +/-   ##
=======================================
  Coverage   90.20%   90.21%           
=======================================
  Files         459      462    +3     
  Lines       57631    57717   +86     
  Branches     5564     5565    +1     
=======================================
+ Hits        51984    52067   +83     
- Misses       4201     4203    +2     
- Partials     1446     1447    +1     

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


🚨 Try these New Features:

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
emmau678 and others added 5 commits November 15, 2024 14:22
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
@compor compor self-requested a review November 15, 2024 14:56
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.

Mostly small comments

return cls._parameters_from_spelling(name)

def verify(self) -> None:
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't think there's any reason to have an empty verify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only left it in because I've been getting the following error if I take it out:

xdsl/backend/register_type.py:75: in verify
    raise NotImplementedError()
E   NotImplementedError

is this unexpected?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I missed that your ArmRegisterType inherited from RegisterType. In that case this is fine.

Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a comment explaining this?

Copy link
Member

Choose a reason for hiding this comment

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

Actually I would say that this is the better place to put the assert name.startswith("x", name) above, and raise a verification error instead

Copy link
Member

Choose a reason for hiding this comment

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

We played around with this locally, and our verify-diangostics runs after the parsing, so it's not trivial to do here. I also have a feeling that raising an error here might be a bit premature, and that we would probably benefit from building more infrastructure here to see how we deal with the weirdnesses of ARM registers before doing the verification.

emmau678 and others added 4 commits November 15, 2024 15:09
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

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

Code looks great! Would just need two small tests to make sure that the behaviour is what we expect, one with valid registers, and one without:

"test.op"() {unallocated = !arm.reg} : () -> ()
"test.op"() {allocated = !arm.reg<x1>} : () -> ()

// -----

"test.op"() {error = !arm.reg<error>} : () -> ()

These can be in the same file, would just need to add --split-input-file and --verify-diagnostics to make sure that it can match successfully

@emmau678 emmau678 marked this pull request as ready for review November 18, 2024 11:51
@superlopuh
Copy link
Member

W pair programmed the latest changes with @emmau678, would love a review from @compor or @alexarice to merge!

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.

Seems good to me (have left 1 small nit)

@emmau678 emmau678 merged commit 98c2df3 into main Nov 18, 2024
15 checks passed
@emmau678 emmau678 deleted the emma/arm-init branch November 18, 2024 16:03
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
Initialise ARM dialect

---------

Co-authored-by: emmau678 <eu233@Emma-laptop>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
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.

4 participants