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

arith_ext: add lowering to arith operations #715

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

inbelic
Copy link
Contributor

@inbelic inbelic commented Jun 3, 2024

Following up on #711

Copy link
Collaborator

@AlexanderViand-Intel AlexanderViand-Intel left a comment

Choose a reason for hiding this comment

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

This looks good to me (but does need a rebase/squash) :)

lib/Dialect/ArithExt/IR/ArithExtOps.td Outdated Show resolved Hide resolved
lib/Dialect/ArithExt/IR/ArithExtOps.td Outdated Show resolved Hide resolved
Copy link
Collaborator

@AlexanderViand-Intel AlexanderViand-Intel left a comment

Choose a reason for hiding this comment

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

Thanks for the update/rebase!

@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jun 11, 2024

// Using DRR to generate the lowering patterns for specific operations

defvar DefGE = ConstantEnumCase<Arith_CmpIPredicateAttr, "uge">;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we will always want this to be unsigned (uge = unsigned greater equal) vs signed. I feel that perhaps we should all agree on the semantics of arith_ext ops on this front, i.e., that we always take the representative in [0, modulus) for modular operations.

Still happy to submit and revisit this later.

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 agree we should discuss this further.

I think if we let it be signed then we will have similar confusion/issue with using RemSI where it treats both operands as signed and we generally don't want the second operand to be signed.

FWIW, in the context of HEaan, they do make the assumption that it is an unsigned input.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was planning to spend some time in the next meeting on discussing how we model modular arithmetic, and data-type semantics in general, and I think the signedness question would be a good addition to the list :)

Copy link
Collaborator

@asraa asraa left a comment

Choose a reason for hiding this comment

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

Thanks!

@copybara-service copybara-service bot merged commit 9cad9ed into google:main Jun 12, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialect: mod_arith pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants