Skip to content

Commit

Permalink
Rename to algebraic_* to match checked_*().
Browse files Browse the repository at this point in the history
  • Loading branch information
calder committed Feb 4, 2025
1 parent bab448a commit b33ee72
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
10 changes: 5 additions & 5 deletions library/core/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2995,7 +2995,7 @@ pub unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> I

/// Float addition that allows optimizations based on algebraic rules.
///
/// Stabilized as [`f16::add_algebraic`], [`f32::add_algebraic`], [`f64::add_algebraic`] and [`f128::add_algebraic`].
/// Stabilized as [`f16::algebraic_add`], [`f32::algebraic_add`], [`f64::algebraic_add`] and [`f128::algebraic_add`].
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
Expand All @@ -3005,7 +3005,7 @@ pub fn fadd_algebraic<T: Copy>(_a: T, _b: T) -> T {

/// Float subtraction that allows optimizations based on algebraic rules.
///
/// Stabilized as [`f16::sub_algebraic`], [`f32::sub_algebraic`], [`f64::sub_algebraic`] and [`f128::sub_algebraic`].
/// Stabilized as [`f16::algebraic_sub`], [`f32::algebraic_sub`], [`f64::algebraic_sub`] and [`f128::algebraic_sub`].
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
Expand All @@ -3015,7 +3015,7 @@ pub fn fsub_algebraic<T: Copy>(_a: T, _b: T) -> T {

/// Float multiplication that allows optimizations based on algebraic rules.
///
/// Stabilized as [`f16::mul_algebraic`], [`f32::mul_algebraic`], [`f64::mul_algebraic`] and [`f128::mul_algebraic`].
/// Stabilized as [`f16::algebraic_mul`], [`f32::algebraic_mul`], [`f64::algebraic_mul`] and [`f128::algebraic_mul`].
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
Expand All @@ -3025,7 +3025,7 @@ pub fn fmul_algebraic<T: Copy>(_a: T, _b: T) -> T {

/// Float division that allows optimizations based on algebraic rules.
///
/// Stabilized as [`f16::div_algebraic`], [`f32::div_algebraic`], [`f64::div_algebraic`] and [`f128::div_algebraic`].
/// Stabilized as [`f16::algebraic_div`], [`f32::algebraic_div`], [`f64::algebraic_div`] and [`f128::algebraic_div`].
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
Expand All @@ -3035,7 +3035,7 @@ pub fn fdiv_algebraic<T: Copy>(_a: T, _b: T) -> T {

/// Float remainder that allows optimizations based on algebraic rules.
///
/// Stabilized as [`f16::rem_algebraic`], [`f32::rem_algebraic`], [`f64::rem_algebraic`] and [`f128::rem_algebraic`].
/// Stabilized as [`f16::algebraic_rem`], [`f32::algebraic_rem`], [`f64::algebraic_rem`] and [`f128::algebraic_rem`].
#[rustc_nounwind]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
Expand Down
10 changes: 5 additions & 5 deletions library/core/src/num/f128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ impl f128 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn add_algebraic(self, rhs: f128) -> f128 {
pub fn algebraic_add(self, rhs: f128) -> f128 {
intrinsics::fadd_algebraic(self, rhs)
}

Expand All @@ -1382,7 +1382,7 @@ impl f128 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn sub_algebraic(self, rhs: f128) -> f128 {
pub fn algebraic_sub(self, rhs: f128) -> f128 {
intrinsics::fsub_algebraic(self, rhs)
}

Expand All @@ -1392,7 +1392,7 @@ impl f128 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn mul_algebraic(self, rhs: f128) -> f128 {
pub fn algebraic_mul(self, rhs: f128) -> f128 {
intrinsics::fmul_algebraic(self, rhs)
}

Expand All @@ -1402,7 +1402,7 @@ impl f128 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn div_algebraic(self, rhs: f128) -> f128 {
pub fn algebraic_div(self, rhs: f128) -> f128 {
intrinsics::fdiv_algebraic(self, rhs)
}

Expand All @@ -1412,7 +1412,7 @@ impl f128 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn rem_algebraic(self, rhs: f128) -> f128 {
pub fn algebraic_rem(self, rhs: f128) -> f128 {
intrinsics::frem_algebraic(self, rhs)
}
}
10 changes: 5 additions & 5 deletions library/core/src/num/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ impl f16 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn add_algebraic(self, rhs: f16) -> f16 {
pub fn algebraic_add(self, rhs: f16) -> f16 {
intrinsics::fadd_algebraic(self, rhs)
}

Expand All @@ -1358,7 +1358,7 @@ impl f16 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn sub_algebraic(self, rhs: f16) -> f16 {
pub fn algebraic_sub(self, rhs: f16) -> f16 {
intrinsics::fsub_algebraic(self, rhs)
}

Expand All @@ -1368,7 +1368,7 @@ impl f16 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn mul_algebraic(self, rhs: f16) -> f16 {
pub fn algebraic_mul(self, rhs: f16) -> f16 {
intrinsics::fmul_algebraic(self, rhs)
}

Expand All @@ -1378,7 +1378,7 @@ impl f16 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn div_algebraic(self, rhs: f16) -> f16 {
pub fn algebraic_div(self, rhs: f16) -> f16 {
intrinsics::fdiv_algebraic(self, rhs)
}

Expand All @@ -1388,7 +1388,7 @@ impl f16 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn rem_algebraic(self, rhs: f16) -> f16 {
pub fn algebraic_rem(self, rhs: f16) -> f16 {
intrinsics::frem_algebraic(self, rhs)
}
}
10 changes: 5 additions & 5 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ impl f32 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn add_algebraic(self, rhs: f32) -> f32 {
pub fn algebraic_add(self, rhs: f32) -> f32 {
intrinsics::fadd_algebraic(self, rhs)
}

Expand All @@ -1523,7 +1523,7 @@ impl f32 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn sub_algebraic(self, rhs: f32) -> f32 {
pub fn algebraic_sub(self, rhs: f32) -> f32 {
intrinsics::fsub_algebraic(self, rhs)
}

Expand All @@ -1533,7 +1533,7 @@ impl f32 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn mul_algebraic(self, rhs: f32) -> f32 {
pub fn algebraic_mul(self, rhs: f32) -> f32 {
intrinsics::fmul_algebraic(self, rhs)
}

Expand All @@ -1543,7 +1543,7 @@ impl f32 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn div_algebraic(self, rhs: f32) -> f32 {
pub fn algebraic_div(self, rhs: f32) -> f32 {
intrinsics::fdiv_algebraic(self, rhs)
}

Expand All @@ -1553,7 +1553,7 @@ impl f32 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn rem_algebraic(self, rhs: f32) -> f32 {
pub fn algebraic_rem(self, rhs: f32) -> f32 {
intrinsics::frem_algebraic(self, rhs)
}
}
10 changes: 5 additions & 5 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ impl f64 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn add_algebraic(self, rhs: f64) -> f64 {
pub fn algebraic_add(self, rhs: f64) -> f64 {
intrinsics::fadd_algebraic(self, rhs)
}

Expand All @@ -1523,7 +1523,7 @@ impl f64 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn sub_algebraic(self, rhs: f64) -> f64 {
pub fn algebraic_sub(self, rhs: f64) -> f64 {
intrinsics::fsub_algebraic(self, rhs)
}

Expand All @@ -1533,7 +1533,7 @@ impl f64 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn mul_algebraic(self, rhs: f64) -> f64 {
pub fn algebraic_mul(self, rhs: f64) -> f64 {
intrinsics::fmul_algebraic(self, rhs)
}

Expand All @@ -1543,7 +1543,7 @@ impl f64 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn div_algebraic(self, rhs: f64) -> f64 {
pub fn algebraic_div(self, rhs: f64) -> f64 {
intrinsics::fdiv_algebraic(self, rhs)
}

Expand All @@ -1553,7 +1553,7 @@ impl f64 {
#[must_use = "method returns a new number and does not mutate the original value"]
#[unstable(feature = "float_algebraic", issue = "136469")]
#[inline]
pub fn rem_algebraic(self, rhs: f64) -> f64 {
pub fn algebraic_rem(self, rhs: f64) -> f64 {
intrinsics::frem_algebraic(self, rhs)
}
}

0 comments on commit b33ee72

Please sign in to comment.