-
Notifications
You must be signed in to change notification settings - Fork 243
libm: implement accelerated computation of (x << e) % y
#1012
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
base: master
Are you sure you want to change the base?
Conversation
+ core::ops::Add<Output = Self> | ||
+ core::ops::Sub<Output = Self> | ||
+ core::ops::Shl<u32, Output = Self> | ||
+ core::ops::Shr<u32, Output = Self> |
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.
core::ops
-> ops
since it's already in scope
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.
I think this commit should be able to allow the #[allow(dead_code)]
on NarrowingDiv
use crate::support::int_traits::NarrowingDiv; | ||
use crate::support::{DInt, HInt, Int}; |
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.
Could you add a module-level doc comment with some of the common names used here? E.g. R
, RR
(if that's not R*R
) r
, m
, q
, xq
. I'm unfortunately a bit lost :) (but I don't need to understand it in detail)
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.
If you've authored this, add /* SPDX-License-Identifier: MIT OR Apache-2.0 */
as well (or only MIT if it's derived, as appropriate)
} | ||
|
||
#[cfg(test)] | ||
mod test { |
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.
Could this spot check another integer size as well? Just using constants
Builds on #1011, both were split from #1002
The computation is implemented in
linear_mul_reduction
.