-
Notifications
You must be signed in to change notification settings - Fork 596
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
feat: OverflowingMul trait #5172
Conversation
d815851
to
8208bbb
Compare
8208bbb
to
c90085c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @enitrat)
corelib/src/integer.cairo
line 2970 at r1 (raw file):
} else { (wide_result.try_into().unwrap(), false) }
since we are worse case based:
Suggestion:
let MASK: u16 = BoundedInt::<u8>::max().into();
let (v_low, _, v_with_low_masked) = u8_bitwise(wide_result, MASK);
(v_low, v_with_low_masked != MASK)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @orizi)
corelib/src/integer.cairo
line 2970 at r1 (raw file):
Previously, orizi wrote…
since we are worse case based:
What are the returned values of ux_bitwise
extern functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @enitrat)
corelib/src/integer.cairo
line 2970 at r1 (raw file):
Previously, enitrat (Mathieu) wrote…
What are the returned values of
ux_bitwise
extern functions?
(and, xor, or)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @orizi)
corelib/src/integer.cairo
line 2970 at r1 (raw file):
Previously, orizi wrote…
(and, xor, or)
Done. Added a boyscout line documenting the biwtise libfunc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @enitrat)
a discussion (no related file):
@gilbens-starkware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @enitrat)
I haven't implemented OverflowingMul for signed integers as the implementation is a bit more complex and I'm not sure about the most efficient approach yet.
This change is