-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚨 Try these New Features:
|
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>
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
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.
Mostly small comments
xdsl/dialects/arm/register.py
Outdated
return cls._parameters_from_spelling(name) | ||
|
||
def verify(self) -> None: | ||
return |
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.
Don't think there's any reason to have an empty verify
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.
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?
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.
I missed that your ArmRegisterType
inherited from RegisterType
. In that case this is fine.
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.
Could you please add a comment explaining this?
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.
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
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.
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.
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
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.
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
W pair programmed the latest changes with @emmau678, would love a review from @compor or @alexarice to merge! |
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.
Seems good to me (have left 1 small nit)
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>
Initialise ARM dialect