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: (x86) PR13 - M Operations #2531

Merged
merged 2 commits into from
May 3, 2024
Merged

Conversation

KGrykiel
Copy link
Collaborator

@KGrykiel KGrykiel commented May 3, 2024

Implemented some operations taking only one memory access as operand. I decided to make 'push' into its own function as opposed to the way I did it with the register version as I don't think there's any other method that would inherit from that. I will probably reformat the register version as well in a PR later.

@KGrykiel KGrykiel added the dialects Changes on the dialects label May 3, 2024
@KGrykiel KGrykiel requested review from superlopuh, compor and tarinduj May 3, 2024 14:17
@KGrykiel KGrykiel self-assigned this May 3, 2024
@KGrykiel
Copy link
Collaborator Author

KGrykiel commented May 3, 2024

I am not sure how to tackle the M version of the 'pop' operation. Since it only has a destination that is a memory access, there is no registers involved other than RSP. Where would the information of what the memory access should be come from in the IR? I can only think of something like;
x86.m.pop %rsp : (!x86.reg<rsp>) -> (!x86.reg<rsp>)
but that's clearly lacking info.

Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.81%. Comparing base (717f3c2) to head (f9a9d39).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2531      +/-   ##
==========================================
- Coverage   89.83%   89.81%   -0.02%     
==========================================
  Files         351      351              
  Lines       44027    44095      +68     
  Branches     6574     6589      +15     
==========================================
+ Hits        39552    39606      +54     
- Misses       3516     3528      +12     
- Partials      959      961       +2     

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

Comment on lines +1231 to +1240
source = _assembly_arg_str(self.source)
if self.offset is not None:
offset = _assembly_arg_str(self.offset)
if self.offset.value.data > 0:
source = f"[{source}+{offset}]"
else:
source = f"[{source}{offset}]"
else:
source = f"[{source}]"
return (source,)
Copy link
Member

Choose a reason for hiding this comment

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

this is starting to look like a good opportunity for a helper :)

@KGrykiel KGrykiel merged commit 95d4054 into main May 3, 2024
10 checks passed
@KGrykiel KGrykiel deleted the KGrykiel/x86dialect-PRs13 branch May 3, 2024 22:01
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
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants