-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.S-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(uint_carryless_mul)]
This is a tracking issue for functions that return the carryless product (XOR multiplication) of unsigned integers.
carryless_mul returns the low-order bits of the result, and widening_carryless_mul returns the full result in the next wider unsigned integer type.
Public API
widening_carryless_mul is not implemented for u128 because there is no larger integer type to return.
impl uN {
/// Returns the low-order bits of the carryless product of `self` and `rhs`.
pub const fn carryless_mul(self, rhs: Self) -> Self;
}
impl u8 {
/// Returns the full carryless product result of `self` and `rhs` in the next wider power-of-two unsigned integer.
pub const fn widening_carryless_mul(self, rhs: Self) -> u16;
}
impl u16 {
pub const fn widening_carryless_mul(self, rhs: Self) -> u32;
}
impl u32 {
pub const fn widening_carryless_mul(self, rhs: Self) -> u64;
}
impl u64 {
pub const fn widening_carryless_mul(self, rhs: Self) -> u128;
}Steps / History
- ACP: ACP: Add carryless product for unsigned integers libs-team#738
- Implementation: implement
carryless_mul#152132 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
carrying_carryless_mul?: In the ACP, there was a voicing of desire for a function that returned the product as a 2-sized tuple with the same sized integer,(Self, Self).- Evaluate the quality of codegen before stabilization: Not all architectures have these operations as hardware instructions and the instructions are not uniform in their integer coverage, nor are the hardware instructions part of the baseline of some targets. However, even without hardware instructions, the intrinsics that these functions wrap should produce equal or better code than a (naive) user implementation.
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.S-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.