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

Allow checking for overflow without penalising fast path #31

Open
unzvfu opened this issue Mar 21, 2020 · 0 comments
Open

Allow checking for overflow without penalising fast path #31

unzvfu opened this issue Mar 21, 2020 · 0 comments
Assignees

Comments

@unzvfu
Copy link
Owner

unzvfu commented Mar 21, 2020

From data61#51:

Currently, to assert that addition doesn't overflow, we

add_cy(s, cy, a, b);
assert(digit::is_zero(cy));

If NDEBUG is not set, then this checks that overflow hasn't occurred. If NDEBUG is set, it's possible (need to verify) that some carry handling code is generated; this is wasteful as it isn't used.

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

No branches or pull requests

1 participant