From 661d2255793735ac716d8b44344211408eb34879 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 3 Nov 2026 12:17:57 +0100 Subject: [PATCH 1/4] Document platform details for FMA --- fearless_simd/src/generated/simd_trait.rs | 52 ++++++------ fearless_simd/src/generated/simd_types.rs | 96 +++++++++++------------ fearless_simd_gen/src/ops.rs | 22 +++--- 3 files changed, 87 insertions(+), 83 deletions(-) diff --git a/fearless_simd/src/generated/simd_trait.rs b/fearless_simd/src/generated/simd_trait.rs index e5ec3dbc..5f6083ae 100644 --- a/fearless_simd/src/generated/simd_trait.rs +++ b/fearless_simd/src/generated/simd_trait.rs @@ -383,13 +383,13 @@ pub trait Simd: fn interleave_f32x4(self, a: f32x4, b: f32x4) -> (f32x4, f32x4); #[doc = "Deinterleave two vectors.\n\nThe first result contains all even-indexed elements from `a` followed by all even-indexed elements from `b`. The second result contains all odd-indexed elements from `a` followed by all odd-indexed elements from `b`.\n\nThe reverse of this operation is `interleave`.\n\nFor vectors `[a0, b0, a1, b1]` and `[a2, b2, a3, b3]`, returns `([a0, a1, a2, a3], [b0, b1, b2, b3])`."] fn deinterleave_f32x4(self, a: f32x4, b: f32x4) -> (f32x4, f32x4); - #[doc = "Compute `(a * b) + c` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_add_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_add_precise_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; - #[doc = "Compute `(a * b) - c` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_sub_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_sub_precise_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor_f32x4(self, a: f32x4) -> f32x4; @@ -1890,13 +1890,13 @@ pub trait Simd: fn interleave_f64x2(self, a: f64x2, b: f64x2) -> (f64x2, f64x2); #[doc = "Deinterleave two vectors.\n\nThe first result contains all even-indexed elements from `a` followed by all even-indexed elements from `b`. The second result contains all odd-indexed elements from `a` followed by all odd-indexed elements from `b`.\n\nThe reverse of this operation is `interleave`.\n\nFor vectors `[a0, b0, a1, b1]` and `[a2, b2, a3, b3]`, returns `([a0, a1, a2, a3], [b0, b1, b2, b3])`."] fn deinterleave_f64x2(self, a: f64x2, b: f64x2) -> (f64x2, f64x2); - #[doc = "Compute `(a * b) + c` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_add_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_add_precise_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; - #[doc = "Compute `(a * b) - c` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_sub_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_sub_precise_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor_f64x2(self, a: f64x2) -> f64x2; @@ -2702,7 +2702,7 @@ pub trait Simd: self.combine_f32x4(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -2724,7 +2724,7 @@ pub trait Simd: self.mul_add_precise_f32x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -2735,7 +2735,7 @@ pub trait Simd: self.mul_sub_f32x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] #[inline(always)] fn mul_sub_precise_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -6219,7 +6219,7 @@ pub trait Simd: self.combine_f64x2(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -6241,7 +6241,7 @@ pub trait Simd: self.mul_add_precise_f64x2(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -6252,7 +6252,7 @@ pub trait Simd: self.mul_sub_f64x2(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] #[inline(always)] fn mul_sub_precise_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -7652,7 +7652,7 @@ pub trait Simd: self.combine_f32x8(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f32x16(self, a: f32x16, b: f32x16, c: f32x16) -> f32x16 { let (a0, a1) = self.split_f32x16(a); @@ -7679,7 +7679,7 @@ pub trait Simd: self.mul_add_precise_f32x8(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f32x16(self, a: f32x16, b: f32x16, c: f32x16) -> f32x16 { let (a0, a1) = self.split_f32x16(a); @@ -7690,7 +7690,7 @@ pub trait Simd: self.mul_sub_f32x8(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] #[inline(always)] fn mul_sub_precise_f32x16( self, @@ -11182,7 +11182,7 @@ pub trait Simd: self.combine_f64x4(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -11204,7 +11204,7 @@ pub trait Simd: self.mul_add_precise_f64x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -11215,7 +11215,7 @@ pub trait Simd: self.mul_sub_f64x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] #[inline(always)] fn mul_sub_precise_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -12973,14 +12973,14 @@ pub trait SimdFloat: fn approximate_recip(self) -> Self; #[doc = "Return a vector with the magnitude of `self` and the sign of `rhs` for each element.\n\nThis operation copies the sign bit, so if an input element is NaN, the output element will be a NaN with the same payload and a copied sign bit."] fn copysign(self, rhs: impl SimdInto) -> Self; - #[doc = "Compute `(self * op1) + op2` (fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors."] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self; - #[doc = "Compute `(self * op1) + op2` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self; - #[doc = "Compute `(self * op1) - op2` (fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors."] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self; - #[doc = "Compute `(self * op1) - op2` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n # Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self; + #[doc = "Compute `(self * mul) + add` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self; + #[doc = "Compute `(self * mul) + add` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self; + #[doc = "Compute `(self * mul) - sub` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self; + #[doc = "Compute `(self * mul) - sub` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor(self) -> Self; #[doc = "Return the smallest integer greater than or equal to each element, that is, round towards positive infinity."] diff --git a/fearless_simd/src/generated/simd_types.rs b/fearless_simd/src/generated/simd_types.rs index 1b26a420..230480dc 100644 --- a/fearless_simd/src/generated/simd_types.rs +++ b/fearless_simd/src/generated/simd_types.rs @@ -317,24 +317,24 @@ impl crate::SimdFloat for f32x4 { self.simd.copysign_f32x4(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_f32x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_f32x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_precise_f32x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_precise_f32x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_f32x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_f32x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f32x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_precise_f32x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -3497,24 +3497,24 @@ impl crate::SimdFloat for f64x2 { self.simd.copysign_f64x2(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_f64x2(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_f64x2(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_precise_f64x2(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_precise_f64x2(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_f64x2(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_f64x2(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f64x2(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_precise_f64x2(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -4811,24 +4811,24 @@ impl crate::SimdFloat for f32x8 { self.simd.copysign_f32x8(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_f32x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_f32x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_precise_f32x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_precise_f32x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_f32x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_f32x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f32x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_precise_f32x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -8034,24 +8034,24 @@ impl crate::SimdFloat for f64x4 { self.simd.copysign_f64x4(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_f64x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_f64x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_precise_f64x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_precise_f64x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_f64x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_f64x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f64x4(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_precise_f64x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -9343,24 +9343,24 @@ impl crate::SimdFloat for f32x16 { self.simd.copysign_f32x16(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_f32x16(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_f32x16(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_precise_f32x16(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_precise_f32x16(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_f32x16(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_f32x16(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f32x16(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_precise_f32x16(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -12654,24 +12654,24 @@ impl crate::SimdFloat for f64x8 { self.simd.copysign_f64x8(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_f64x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_f64x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { self.simd - .mul_add_precise_f64x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_add_precise_f64x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_f64x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_f64x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, op1: impl SimdInto, op2: impl SimdInto) -> Self { + fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f64x8(self, op1.simd_into(self.simd), op2.simd_into(self.simd)) + .mul_sub_precise_f64x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { diff --git a/fearless_simd_gen/src/ops.rs b/fearless_simd_gen/src/ops.rs index 2bc1c29c..c0bc39f8 100644 --- a/fearless_simd_gen/src/ops.rs +++ b/fearless_simd_gen/src/ops.rs @@ -1151,9 +1151,11 @@ const FLOAT_OPS: &[Op] = &[ "mul_add", OpKind::VecTraitMethod, OpSig::Ternary, - "Compute `({arg0} * {arg1}) + {arg2}` (fused multiply-add) for each element.\n\n\ - Depending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by an add, which will result in two rounding errors.", - ), + "Compute `({arg0} * {arg1}) + {arg2}` (potentially fused multiply-add) for each element.\n\n\ + Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n + # Precision\n\n\ + The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", + ).with_custom_vec_trait_arg_names(&["self", "mul", "add"]), Op::new( "mul_add_precise", OpKind::VecTraitMethod, @@ -1165,26 +1167,28 @@ const FLOAT_OPS: &[Op] = &[ and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\n\ On the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\n\ The exact `NaN` payloads as well as signaling `NaN`s are not preserved.", - ), + ).with_custom_vec_trait_arg_names(&["self", "mul", "add"]), Op::new( "mul_sub", OpKind::VecTraitMethod, OpSig::Ternary, - "Compute `({arg0} * {arg1}) - {arg2}` (fused multiply-subtract) for each element.\n\n\ - Depending on platform support, the result may be computed with only one rounding error, or may be implemented as a regular multiply followed by a subtract, which will result in two rounding errors.", - ), + "Compute `({arg0} * {arg1}) - {arg2}` (potentially fused multiply-subtract) for each element.\n\n\ + Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n + # Precision\n\n\ + The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", + ).with_custom_vec_trait_arg_names(&["self", "mul", "sub"]), Op::new( "mul_sub_precise", OpKind::VecTraitMethod, OpSig::Ternary, "Compute `({arg0} * {arg1}) - {arg2}` for each element, with a single rounding at the end.\n\n\ - The result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly. + The result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n\ # Precision guarantees\n\n\ This function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library \ and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\n\ On the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\n\ The exact `NaN` payloads as well as signaling `NaN`s are not preserved.", - ), + ).with_custom_vec_trait_arg_names(&["self", "mul", "sub"]), Op::new( "floor", OpKind::VecTraitMethod, From 206c42c3807bcebc63a33f898dc33124aa7e61c0 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 3 Nov 2026 12:23:49 +0100 Subject: [PATCH 2/4] Change param names --- fearless_simd/src/generated/simd_trait.rs | 16 ++-- fearless_simd/src/generated/simd_types.rs | 96 +++++++++++------------ fearless_simd_gen/src/ops.rs | 8 +- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/fearless_simd/src/generated/simd_trait.rs b/fearless_simd/src/generated/simd_trait.rs index 5f6083ae..dcf71d6a 100644 --- a/fearless_simd/src/generated/simd_trait.rs +++ b/fearless_simd/src/generated/simd_trait.rs @@ -12973,14 +12973,14 @@ pub trait SimdFloat: fn approximate_recip(self) -> Self; #[doc = "Return a vector with the magnitude of `self` and the sign of `rhs` for each element.\n\nThis operation copies the sign bit, so if an input element is NaN, the output element will be a NaN with the same payload and a copied sign bit."] fn copysign(self, rhs: impl SimdInto) -> Self; - #[doc = "Compute `(self * mul) + add` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self; - #[doc = "Compute `(self * mul) + add` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self; - #[doc = "Compute `(self * mul) - sub` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self; - #[doc = "Compute `(self * mul) - sub` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self; + #[doc = "Compute `(self * a) + b` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self; + #[doc = "Compute `(self * a) + b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self; + #[doc = "Compute `(self * a) - b` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self; + #[doc = "Compute `(self * a) - b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor(self) -> Self; #[doc = "Return the smallest integer greater than or equal to each element, that is, round towards positive infinity."] diff --git a/fearless_simd/src/generated/simd_types.rs b/fearless_simd/src/generated/simd_types.rs index 230480dc..25353419 100644 --- a/fearless_simd/src/generated/simd_types.rs +++ b/fearless_simd/src/generated/simd_types.rs @@ -317,24 +317,24 @@ impl crate::SimdFloat for f32x4 { self.simd.copysign_f32x4(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_f32x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_f32x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_precise_f32x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_precise_f32x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_f32x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_f32x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f32x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_precise_f32x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -3497,24 +3497,24 @@ impl crate::SimdFloat for f64x2 { self.simd.copysign_f64x2(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_f64x2(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_f64x2(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_precise_f64x2(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_precise_f64x2(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_f64x2(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_f64x2(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f64x2(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_precise_f64x2(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -4811,24 +4811,24 @@ impl crate::SimdFloat for f32x8 { self.simd.copysign_f32x8(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_f32x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_f32x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_precise_f32x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_precise_f32x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_f32x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_f32x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f32x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_precise_f32x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -8034,24 +8034,24 @@ impl crate::SimdFloat for f64x4 { self.simd.copysign_f64x4(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_f64x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_f64x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_precise_f64x4(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_precise_f64x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_f64x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_f64x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f64x4(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_precise_f64x4(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -9343,24 +9343,24 @@ impl crate::SimdFloat for f32x16 { self.simd.copysign_f32x16(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_f32x16(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_f32x16(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_precise_f32x16(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_precise_f32x16(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_f32x16(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_f32x16(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f32x16(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_precise_f32x16(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { @@ -12654,24 +12654,24 @@ impl crate::SimdFloat for f64x8 { self.simd.copysign_f64x8(self, rhs.simd_into(self.simd)) } #[inline(always)] - fn mul_add(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_f64x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_f64x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_add_precise(self, mul: impl SimdInto, add: impl SimdInto) -> Self { + fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_add_precise_f64x8(self, mul.simd_into(self.simd), add.simd_into(self.simd)) + .mul_add_precise_f64x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_f64x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_f64x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] - fn mul_sub_precise(self, mul: impl SimdInto, sub: impl SimdInto) -> Self { + fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self { self.simd - .mul_sub_precise_f64x8(self, mul.simd_into(self.simd), sub.simd_into(self.simd)) + .mul_sub_precise_f64x8(self, a.simd_into(self.simd), b.simd_into(self.simd)) } #[inline(always)] fn floor(self) -> Self { diff --git a/fearless_simd_gen/src/ops.rs b/fearless_simd_gen/src/ops.rs index c0bc39f8..2d56d5f5 100644 --- a/fearless_simd_gen/src/ops.rs +++ b/fearless_simd_gen/src/ops.rs @@ -1155,7 +1155,7 @@ const FLOAT_OPS: &[Op] = &[ Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n # Precision\n\n\ The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", - ).with_custom_vec_trait_arg_names(&["self", "mul", "add"]), + ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "mul_add_precise", OpKind::VecTraitMethod, @@ -1167,7 +1167,7 @@ const FLOAT_OPS: &[Op] = &[ and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\n\ On the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\n\ The exact `NaN` payloads as well as signaling `NaN`s are not preserved.", - ).with_custom_vec_trait_arg_names(&["self", "mul", "add"]), + ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "mul_sub", OpKind::VecTraitMethod, @@ -1176,7 +1176,7 @@ const FLOAT_OPS: &[Op] = &[ Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n # Precision\n\n\ The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", - ).with_custom_vec_trait_arg_names(&["self", "mul", "sub"]), + ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "mul_sub_precise", OpKind::VecTraitMethod, @@ -1188,7 +1188,7 @@ const FLOAT_OPS: &[Op] = &[ and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\n\ On the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\n\ The exact `NaN` payloads as well as signaling `NaN`s are not preserved.", - ).with_custom_vec_trait_arg_names(&["self", "mul", "sub"]), + ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "floor", OpKind::VecTraitMethod, From 0397309ae3724dae4b12bb5bb39383c790cfd6eb Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Tue, 3 Nov 2026 12:44:23 +0100 Subject: [PATCH 3/4] Add trailing backslash --- fearless_simd/src/generated/simd_trait.rs | 28 +++++++++++------------ fearless_simd_gen/src/ops.rs | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fearless_simd/src/generated/simd_trait.rs b/fearless_simd/src/generated/simd_trait.rs index dcf71d6a..83a9e148 100644 --- a/fearless_simd/src/generated/simd_trait.rs +++ b/fearless_simd/src/generated/simd_trait.rs @@ -383,11 +383,11 @@ pub trait Simd: fn interleave_f32x4(self, a: f32x4, b: f32x4) -> (f32x4, f32x4); #[doc = "Deinterleave two vectors.\n\nThe first result contains all even-indexed elements from `a` followed by all even-indexed elements from `b`. The second result contains all odd-indexed elements from `a` followed by all odd-indexed elements from `b`.\n\nThe reverse of this operation is `interleave`.\n\nFor vectors `[a0, b0, a1, b1]` and `[a2, b2, a3, b3]`, returns `([a0, a1, a2, a3], [b0, b1, b2, b3])`."] fn deinterleave_f32x4(self, a: f32x4, b: f32x4) -> (f32x4, f32x4); - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_add_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_add_precise_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_sub_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_sub_precise_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; @@ -1890,11 +1890,11 @@ pub trait Simd: fn interleave_f64x2(self, a: f64x2, b: f64x2) -> (f64x2, f64x2); #[doc = "Deinterleave two vectors.\n\nThe first result contains all even-indexed elements from `a` followed by all even-indexed elements from `b`. The second result contains all odd-indexed elements from `a` followed by all odd-indexed elements from `b`.\n\nThe reverse of this operation is `interleave`.\n\nFor vectors `[a0, b0, a1, b1]` and `[a2, b2, a3, b3]`, returns `([a0, a1, a2, a3], [b0, b1, b2, b3])`."] fn deinterleave_f64x2(self, a: f64x2, b: f64x2) -> (f64x2, f64x2); - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_add_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_add_precise_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_sub_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_sub_precise_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; @@ -2702,7 +2702,7 @@ pub trait Simd: self.combine_f32x4(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -2724,7 +2724,7 @@ pub trait Simd: self.mul_add_precise_f32x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -6219,7 +6219,7 @@ pub trait Simd: self.combine_f64x2(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -6241,7 +6241,7 @@ pub trait Simd: self.mul_add_precise_f64x2(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -7652,7 +7652,7 @@ pub trait Simd: self.combine_f32x8(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f32x16(self, a: f32x16, b: f32x16, c: f32x16) -> f32x16 { let (a0, a1) = self.split_f32x16(a); @@ -7679,7 +7679,7 @@ pub trait Simd: self.mul_add_precise_f32x8(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f32x16(self, a: f32x16, b: f32x16, c: f32x16) -> f32x16 { let (a0, a1) = self.split_f32x16(a); @@ -11182,7 +11182,7 @@ pub trait Simd: self.combine_f64x4(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_add_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -11204,7 +11204,7 @@ pub trait Simd: self.mul_add_precise_f64x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] #[inline(always)] fn mul_sub_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -12973,11 +12973,11 @@ pub trait SimdFloat: fn approximate_recip(self) -> Self; #[doc = "Return a vector with the magnitude of `self` and the sign of `rhs` for each element.\n\nThis operation copies the sign bit, so if an input element is NaN, the output element will be a NaN with the same payload and a copied sign bit."] fn copysign(self, rhs: impl SimdInto) -> Self; - #[doc = "Compute `(self * a) + b` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(self * a) + b` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self; #[doc = "Compute `(self * a) + b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self; - #[doc = "Compute `(self * a) - b` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\n # Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(self * a) - b` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self; #[doc = "Compute `(self * a) - b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self; diff --git a/fearless_simd_gen/src/ops.rs b/fearless_simd_gen/src/ops.rs index 2d56d5f5..eab43c4f 100644 --- a/fearless_simd_gen/src/ops.rs +++ b/fearless_simd_gen/src/ops.rs @@ -1152,7 +1152,7 @@ const FLOAT_OPS: &[Op] = &[ OpKind::VecTraitMethod, OpSig::Ternary, "Compute `({arg0} * {arg1}) + {arg2}` (potentially fused multiply-add) for each element.\n\n\ - Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n + Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\ # Precision\n\n\ The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), @@ -1173,7 +1173,7 @@ const FLOAT_OPS: &[Op] = &[ OpKind::VecTraitMethod, OpSig::Ternary, "Compute `({arg0} * {arg1}) - {arg2}` (potentially fused multiply-subtract) for each element.\n\n\ - Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n + Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\ # Precision\n\n\ The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), From aa15bbdea5c623ee253ea9f4b64a92f4fadc39a1 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Fri, 6 Nov 2026 15:02:05 +0100 Subject: [PATCH 4/4] Move perf note to `_precise` methods --- fearless_simd/src/generated/simd_trait.rs | 56 +++++++++++------------ fearless_simd_gen/src/ops.rs | 16 +++---- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/fearless_simd/src/generated/simd_trait.rs b/fearless_simd/src/generated/simd_trait.rs index 83a9e148..8a048cb2 100644 --- a/fearless_simd/src/generated/simd_trait.rs +++ b/fearless_simd/src/generated/simd_trait.rs @@ -383,13 +383,13 @@ pub trait Simd: fn interleave_f32x4(self, a: f32x4, b: f32x4) -> (f32x4, f32x4); #[doc = "Deinterleave two vectors.\n\nThe first result contains all even-indexed elements from `a` followed by all even-indexed elements from `b`. The second result contains all odd-indexed elements from `a` followed by all odd-indexed elements from `b`.\n\nThe reverse of this operation is `interleave`.\n\nFor vectors `[a0, b0, a1, b1]` and `[a2, b2, a3, b3]`, returns `([a0, a1, a2, a3], [b0, b1, b2, b3])`."] fn deinterleave_f32x4(self, a: f32x4, b: f32x4) -> (f32x4, f32x4); - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] fn mul_add_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; - #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] fn mul_add_precise_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] fn mul_sub_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] fn mul_sub_precise_f32x4(self, a: f32x4, b: f32x4, c: f32x4) -> f32x4; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor_f32x4(self, a: f32x4) -> f32x4; @@ -1890,13 +1890,13 @@ pub trait Simd: fn interleave_f64x2(self, a: f64x2, b: f64x2) -> (f64x2, f64x2); #[doc = "Deinterleave two vectors.\n\nThe first result contains all even-indexed elements from `a` followed by all even-indexed elements from `b`. The second result contains all odd-indexed elements from `a` followed by all odd-indexed elements from `b`.\n\nThe reverse of this operation is `interleave`.\n\nFor vectors `[a0, b0, a1, b1]` and `[a2, b2, a3, b3]`, returns `([a0, a1, a2, a3], [b0, b1, b2, b3])`."] fn deinterleave_f64x2(self, a: f64x2, b: f64x2) -> (f64x2, f64x2); - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] fn mul_add_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; - #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] fn mul_add_precise_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] fn mul_sub_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] fn mul_sub_precise_f64x2(self, a: f64x2, b: f64x2, c: f64x2) -> f64x2; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor_f64x2(self, a: f64x2) -> f64x2; @@ -2702,7 +2702,7 @@ pub trait Simd: self.combine_f32x4(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_add_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -2713,7 +2713,7 @@ pub trait Simd: self.mul_add_f32x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_add_precise_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -2724,7 +2724,7 @@ pub trait Simd: self.mul_add_precise_f32x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_sub_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -2735,7 +2735,7 @@ pub trait Simd: self.mul_sub_f32x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_sub_precise_f32x8(self, a: f32x8, b: f32x8, c: f32x8) -> f32x8 { let (a0, a1) = self.split_f32x8(a); @@ -6219,7 +6219,7 @@ pub trait Simd: self.combine_f64x2(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_add_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -6230,7 +6230,7 @@ pub trait Simd: self.mul_add_f64x2(a1, b1, c1), ) } - #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_add_precise_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -6241,7 +6241,7 @@ pub trait Simd: self.mul_add_precise_f64x2(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_sub_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -6252,7 +6252,7 @@ pub trait Simd: self.mul_sub_f64x2(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_sub_precise_f64x4(self, a: f64x4, b: f64x4, c: f64x4) -> f64x4 { let (a0, a1) = self.split_f64x4(a); @@ -7652,7 +7652,7 @@ pub trait Simd: self.combine_f32x8(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_add_f32x16(self, a: f32x16, b: f32x16, c: f32x16) -> f32x16 { let (a0, a1) = self.split_f32x16(a); @@ -7663,7 +7663,7 @@ pub trait Simd: self.mul_add_f32x8(a1, b1, c1), ) } - #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_add_precise_f32x16( self, @@ -7679,7 +7679,7 @@ pub trait Simd: self.mul_add_precise_f32x8(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_sub_f32x16(self, a: f32x16, b: f32x16, c: f32x16) -> f32x16 { let (a0, a1) = self.split_f32x16(a); @@ -7690,7 +7690,7 @@ pub trait Simd: self.mul_sub_f32x8(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_sub_precise_f32x16( self, @@ -11182,7 +11182,7 @@ pub trait Simd: self.combine_f64x4(lo_odd, hi_odd), ) } - #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) + c` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_add_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -11193,7 +11193,7 @@ pub trait Simd: self.mul_add_f64x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) + c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_add_precise_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -11204,7 +11204,7 @@ pub trait Simd: self.mul_add_precise_f64x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(a * b) - c` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] #[inline(always)] fn mul_sub_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -11215,7 +11215,7 @@ pub trait Simd: self.mul_sub_f64x4(a1, b1, c1), ) } - #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(a * b) - c` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] #[inline(always)] fn mul_sub_precise_f64x8(self, a: f64x8, b: f64x8, c: f64x8) -> f64x8 { let (a0, a1) = self.split_f64x8(a); @@ -12973,13 +12973,13 @@ pub trait SimdFloat: fn approximate_recip(self) -> Self; #[doc = "Return a vector with the magnitude of `self` and the sign of `rhs` for each element.\n\nThis operation copies the sign bit, so if an input element is NaN, the output element will be a NaN with the same payload and a copied sign bit."] fn copysign(self, rhs: impl SimdInto) -> Self; - #[doc = "Compute `(self * a) + b` (potentially fused multiply-add) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(self * a) + b` (potentially fused multiply-add) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] fn mul_add(self, a: impl SimdInto, b: impl SimdInto) -> Self; - #[doc = "Compute `(self * a) + b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(self * a) + b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-plus-add rounded once to the element type. This may be substantially slower than `mul_add` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] fn mul_add_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self; - #[doc = "Compute `(self * a) - b` (potentially fused multiply-subtract) for each element.\n\nDepending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n# Precision\n\nThe following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors."] + #[doc = "Compute `(self * a) - b` (potentially fused multiply-subtract) for each element.\n\nThe result may be computed with one or two rounding errors depending on which can be computed faster on the current platform."] fn mul_sub(self, a: impl SimdInto, b: impl SimdInto) -> Self; - #[doc = "Compute `(self * a) - b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved."] + #[doc = "Compute `(self * a) - b` for each element, with a single rounding at the end.\n\nThe result is the infinite-precision product-minus-subtrahend rounded once to the element type. This may be substantially slower than `mul_sub` on platforms without fused multiply-add instructions, including WebAssembly.\n\n# Precision guarantees\n\nThis function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\nOn the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\nThe exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n# Performance\n\nThe following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512."] fn mul_sub_precise(self, a: impl SimdInto, b: impl SimdInto) -> Self; #[doc = "Return the largest integer less than or equal to each element, that is, round towards negative infinity."] fn floor(self) -> Self; diff --git a/fearless_simd_gen/src/ops.rs b/fearless_simd_gen/src/ops.rs index eab43c4f..7d155995 100644 --- a/fearless_simd_gen/src/ops.rs +++ b/fearless_simd_gen/src/ops.rs @@ -1152,9 +1152,7 @@ const FLOAT_OPS: &[Op] = &[ OpKind::VecTraitMethod, OpSig::Ternary, "Compute `({arg0} * {arg1}) + {arg2}` (potentially fused multiply-add) for each element.\n\n\ - Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by an add, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\ - # Precision\n\n\ - The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", + The result may be computed with one or two rounding errors depending on which can be computed faster on the current platform.", ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "mul_add_precise", @@ -1166,16 +1164,16 @@ const FLOAT_OPS: &[Op] = &[ This function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library \ and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\n\ On the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\n\ - The exact `NaN` payloads as well as signaling `NaN`s are not preserved.", + The exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n\ + # Performance\n\n\ + The following platforms will use a single fused multiply-add instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512.", ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "mul_sub", OpKind::VecTraitMethod, OpSig::Ternary, "Compute `({arg0} * {arg1}) - {arg2}` (potentially fused multiply-subtract) for each element.\n\n\ - Depending on platform support, the result may be computed with only one rounding error or as regular multiply followed by a subtract, resulting in two rounding errors. Whichever can be computed faster on the current platform will be used.\n\n\ - # Precision\n\n\ - The following platforms will return results with only one rounding error: ARM NEON, x86 AVX2, and x86 AVX512. All other platforms may have two rounding errors.", + The result may be computed with one or two rounding errors depending on which can be computed faster on the current platform.", ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "mul_sub_precise", @@ -1187,7 +1185,9 @@ const FLOAT_OPS: &[Op] = &[ This function is **not** susceptible to [the bug](https://github.com/rust-lang/compiler-builtins/issues/1262) in Rust standard library \ and in musl libc that causes incorrect rounding for near-zero values on CPUs without hardware support for this operation.\n\n\ On the tier-2 i586-* targets, this function is correct if and only if SSE2 is available on the CPU.\n\n\ - The exact `NaN` payloads as well as signaling `NaN`s are not preserved.", + The exact `NaN` payloads as well as signaling `NaN`s are not preserved.\n\n\ + # Performance\n\n\ + The following platforms will use a single fused multiply-subtract instruction for this operation: ARM NEON, x86 AVX2, and x86 AVX512.", ).with_custom_vec_trait_arg_names(&["self", "a", "b"]), Op::new( "floor",