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

Cmov using sbb when possible #1596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andres-erbsen
Copy link
Contributor

This is required to get decent code for saturated subtraction on clang with intrinsics

Comment on lines 574 to 580

match goal with H5 : _ |- _ => apply unfold_is_bounded_by_bool in H5; cbn in H5 end.
replace c with 1 in * by lia.
rewrite Z.mod_opp_l_nz; rewrite ?Z.mod_small.
replace (M+1-1) with M by lia.
remove_casts.
all : try lia.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any way this can be made more automated, and integrated with the above automation? Like M+1-1 should be folded into interp_good_t_step_arith if possible, etc

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 don't see anything useful to do here. I could wrap the thing in a match clause but I worry doing so might make maintenance harder, not easier.

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