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 first operation #3462

Merged
merged 22 commits into from
Nov 19, 2024
Merged

dialects (arm): add first operation #3462

merged 22 commits into from
Nov 19, 2024

Conversation

emmau678
Copy link
Contributor

@emmau678 emmau678 commented Nov 18, 2024

Add a first op for getting a register and a filecheck
Note: stacked PR

emmau678 and others added 15 commits November 15, 2024 11:13
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>
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
@emmau678 emmau678 added the dialects Changes on the dialects label Nov 18, 2024
@emmau678 emmau678 self-assigned this Nov 18, 2024
@emmau678 emmau678 changed the base branch from main to emma/arm-init November 18, 2024 12:34
@emmau678 emmau678 marked this pull request as ready for review November 18, 2024 12:43
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.26%. Comparing base (98c2df3) to head (4ab62b1).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3462      +/-   ##
==========================================
+ Coverage   90.21%   90.26%   +0.05%     
==========================================
  Files         462      463       +1     
  Lines       57717    57858     +141     
  Branches     5565     5565              
==========================================
+ Hits        52067    52228     +161     
+ Misses       4203     4192      -11     
+ Partials     1447     1438       -9     

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


🚨 Try these New Features:

@emmau678 emmau678 changed the title Emma/arm first op dialects (arm): add first operation Nov 18, 2024
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, I've left a few comments which may need no/limited action

@@ -2474,7 +2474,7 @@ class RM_VbroadcastsdOp(R_RM_Operation[AVXRegisterType, GeneralRegisterType]):
name = "x86.rm.vbroadcastsd"


class GetAnyRegisterOperation(Generic[R1InvT], IRDLOperation, X86Op):
class GetAnyRegisterOperation(Generic[R1InvT], IRDLOperation, X86Op, ABC):
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for including this change?

Copy link
Member

Choose a reason for hiding this comment

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

That was my doing, it was just missing this annotation, and porting the equivalent to ARM meant that it was also missed, it's a small non-functional change

xdsl/dialects/arm/ops.py Outdated Show resolved Hide resolved

from .register import IntRegisterType

R1InvT = TypeVar("R1InvT", bound=IntRegisterType)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there plans to have more register types? This seems like a premature generalisation at this point

Copy link
Member

Choose a reason for hiding this comment

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

Good point, we probably don't need it right now, let's add it later.


@abstractmethod
def assembly_line(self) -> str | None:
raise NotImplementedError()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think there's any need to give an implementation for an abstract method? (I could be very wrong on this, perhaps @superlopuh can correct me)

Copy link
Member

@superlopuh superlopuh Nov 18, 2024

Choose a reason for hiding this comment

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

My understanding is that this is good practice. In theory, the annotation should raise an error if not overriden, but I'm not sure if that ever breaks (and what happens if the @abstractmethod gets lost somehow).

Add custom ARM assembly syntax and generic roundtrip test to filecheck.
Note: stacked PR

Co-authored-by: emmau678 <eu233@Emma-laptop>
Base automatically changed from emma/arm-init to main November 18, 2024 16:03
@emmau678 emmau678 merged commit f617e48 into main Nov 19, 2024
15 checks passed
@emmau678 emmau678 deleted the emma/arm-first-op branch November 19, 2024 14:50
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
Add a first op for getting a register and a filecheck
Note: stacked PR

---------

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