Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 04ee107

Browse files
committed
Remove wrapping from sum/product fns
1 parent 828b274 commit 04ee107

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/core_simd/src/reduction.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ macro_rules! impl_integer_reductions {
66
{
77
/// Horizontal wrapping add. Returns the sum of the lanes of the vector, with wrapping addition.
88
#[inline]
9-
pub fn horizontal_wrapping_sum(self) -> $scalar {
9+
pub fn horizontal_sum(self) -> $scalar {
1010
unsafe { crate::intrinsics::simd_reduce_add_ordered(self, 0) }
1111
}
1212

1313
/// Horizontal wrapping multiply. Returns the product of the lanes of the vector, with wrapping multiplication.
1414
#[inline]
15-
pub fn horizontal_wrapping_product(self) -> $scalar {
15+
pub fn horizontal_product(self) -> $scalar {
1616
unsafe { crate::intrinsics::simd_reduce_mul_ordered(self, 1) }
1717
}
1818

crates/core_simd/tests/ops_macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,20 @@ macro_rules! impl_binary_checked_op_test {
140140
macro_rules! impl_common_integer_tests {
141141
{ $vector:ident, $scalar:ident } => {
142142
test_helpers::test_lanes! {
143-
fn horizontal_wrapping_sum<const LANES: usize>() {
143+
fn horizontal_sum<const LANES: usize>() {
144144
test_helpers::test_1(&|x| {
145145
test_helpers::prop_assert_biteq! (
146-
$vector::<LANES>::from_array(x).horizontal_wrapping_sum(),
146+
$vector::<LANES>::from_array(x).horizontal_sum(),
147147
x.iter().copied().fold(0 as $scalar, $scalar::wrapping_add),
148148
);
149149
Ok(())
150150
});
151151
}
152152

153-
fn horizontal_wrapping_product<const LANES: usize>() {
153+
fn horizontal_product<const LANES: usize>() {
154154
test_helpers::test_1(&|x| {
155155
test_helpers::prop_assert_biteq! (
156-
$vector::<LANES>::from_array(x).horizontal_wrapping_product(),
156+
$vector::<LANES>::from_array(x).horizontal_product(),
157157
x.iter().copied().fold(1 as $scalar, $scalar::wrapping_mul),
158158
);
159159
Ok(())

0 commit comments

Comments
 (0)