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

Fix saturating add matching in associativity checking #8220

Merged
merged 4 commits into from
May 24, 2024

Conversation

abadams
Copy link
Member

@abadams abadams commented May 14, 2024

The associative ops table defined saturating add as saturating_narrow(widen(x + y)), instead of saturating_narrow(widen(x) + y)

I noticed this because I'm changing the simplifier to more aggressively simplify using bounds, and it simplifies saturating_narrow(widen(x + y)) to just x + y.

Also added matching for the saturating_add intrinsic, which requiring teaching the solver about commutative intrinsics.

The associative ops table defined saturating add as
saturating_narrow(widen(x + y)), instead of saturating_narrow(widen(x) +
y)
@abadams
Copy link
Member Author

abadams commented May 24, 2024

Ready for review

@abadams abadams merged commit 33d5ba9 into main May 24, 2024
19 checks passed
@abadams abadams deleted the abadams/fix_saturating_add_associativity branch May 24, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants