pub struct f32x16 { /* private fields */ }Implementations§
Source§impl f32x16
impl f32x16
pub fn new(array: [f32; 16]) -> Self
pub fn blend(self, t: Self, f: Self) -> Self
pub fn max(self, rhs: Self) -> Self
pub fn min(self, rhs: Self) -> Self
pub fn is_nan(self) -> Self
pub fn is_finite(self) -> Self
pub fn round(self) -> Self
pub fn round_int(self) -> i32x16
pub fn to_array(self) -> [f32; 16]
pub fn as_array(&self) -> &[f32; 16]
pub fn as_mut_array(&mut self) -> &mut [f32; 16]
Sourcepub fn mul_add(self, m: Self, a: Self) -> Self
pub fn mul_add(self, m: Self, a: Self) -> Self
Performs a multiply-add operation: self * m + a
When hardware FMA support is available, this computes the result with a single rounding operation. Without FMA support, it falls back to separate multiply and add operations with two roundings.
§Platform-specific behavior
- On
x86/x86_64with AVX-512F+FMA: Uses 512-bitvfmadd(single rounding, best accuracy) - On
x86/x86_64with AVX-512F only: Uses(self * m) + a(two roundings) - Other platforms: Delegates to
f32x8(inherits its FMA behavior)
§Examples
let a = f32x16::from([1.0; 16]);
let b = f32x16::from([2.0; 16]);
let c = f32x16::from([10.0; 16]);
let result = a.mul_add(b, c);
let expected = f32x16::from([12.0; 16]);
assert_eq!(result, expected);Sourcepub fn mul_sub(self, m: Self, s: Self) -> Self
pub fn mul_sub(self, m: Self, s: Self) -> Self
Performs a multiply-subtract operation: self * m - s
When hardware FMA support is available, this computes the result with a single rounding operation. Without FMA support, it falls back to separate multiply and subtract operations with two roundings.
§Platform-specific behavior
- On
x86/x86_64with AVX-512F+FMA: Uses 512-bitvfmsub(single rounding, best accuracy) - On
x86/x86_64with AVX-512F only: Uses(self * m) - s(two roundings) - Other platforms: Delegates to
f32x8(inherits its FMA behavior)
§Examples
let a = f32x16::from([10.0; 16]);
let b = f32x16::from([3.0; 16]);
let c = f32x16::from([5.0; 16]);
let result = a.mul_sub(b, c);
let expected = f32x16::from([25.0; 16]);
assert_eq!(result, expected);Sourcepub fn mul_neg_add(self, m: Self, a: Self) -> Self
pub fn mul_neg_add(self, m: Self, a: Self) -> Self
Performs a negative multiply-add operation: a - (self * m)
When hardware FMA support is available, this computes the result with a single rounding operation. Without FMA support, it falls back to separate operations with two roundings.
§Platform-specific behavior
- On
x86/x86_64with AVX-512F+FMA: Uses 512-bitvfnmadd(single rounding, best accuracy) - On
x86/x86_64with AVX-512F only: Usesa - (self * m)(two roundings) - Other platforms: Delegates to
f32x8(inherits its FMA behavior)
§Examples
let a = f32x16::from([4.0; 16]);
let b = f32x16::from([2.0; 16]);
let c = f32x16::from([10.0; 16]);
let result = a.mul_neg_add(b, c);
let expected = f32x16::from([2.0; 16]);
assert_eq!(result, expected);Sourcepub fn mul_neg_sub(self, m: Self, s: Self) -> Self
pub fn mul_neg_sub(self, m: Self, s: Self) -> Self
Performs a negative multiply-subtract operation: -(self * m) - s
When hardware FMA support is available, this computes the result with a single rounding operation. Without FMA support, it falls back to separate operations with two roundings.
§Platform-specific behavior
- On
x86/x86_64with AVX-512F+FMA: Uses 512-bitvfnmsub(single rounding, best accuracy) - On
x86/x86_64with AVX-512F only: Uses-(self * m) - s(two roundings) - Other platforms: Delegates to
f32x8(inherits its FMA behavior)
§Examples
let a = f32x16::from([4.0; 16]);
let b = f32x16::from([2.0; 16]);
let c = f32x16::from([1.0; 16]);
let result = a.mul_neg_sub(b, c);
let expected = f32x16::from([-9.0; 16]);
assert_eq!(result, expected);Trait Implementations§
Source§impl AddAssign<&f32x16> for f32x16
impl AddAssign<&f32x16> for f32x16
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+= operation. Read moreSource§impl AddAssign for f32x16
impl AddAssign for f32x16
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl BitAndAssign<&f32x16> for f32x16
impl BitAndAssign<&f32x16> for f32x16
Source§fn bitand_assign(&mut self, rhs: &Self)
fn bitand_assign(&mut self, rhs: &Self)
&= operation. Read moreSource§impl BitAndAssign for f32x16
impl BitAndAssign for f32x16
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOrAssign<&f32x16> for f32x16
impl BitOrAssign<&f32x16> for f32x16
Source§fn bitor_assign(&mut self, rhs: &Self)
fn bitor_assign(&mut self, rhs: &Self)
|= operation. Read moreSource§impl BitOrAssign for f32x16
impl BitOrAssign for f32x16
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXorAssign<&f32x16> for f32x16
impl BitXorAssign<&f32x16> for f32x16
Source§fn bitxor_assign(&mut self, rhs: &Self)
fn bitxor_assign(&mut self, rhs: &Self)
^= operation. Read moreSource§impl BitXorAssign for f32x16
impl BitXorAssign for f32x16
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl DivAssign<&f32x16> for f32x16
impl DivAssign<&f32x16> for f32x16
Source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
/= operation. Read moreSource§impl DivAssign for f32x16
impl DivAssign for f32x16
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl MulAssign<&f32x16> for f32x16
impl MulAssign<&f32x16> for f32x16
Source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
*= operation. Read moreSource§impl MulAssign for f32x16
impl MulAssign for f32x16
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl SubAssign<&f32x16> for f32x16
impl SubAssign<&f32x16> for f32x16
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-= operation. Read moreSource§impl SubAssign for f32x16
impl SubAssign for f32x16
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreimpl Copy for f32x16
impl Pod for f32x16
impl StructuralPartialEq for f32x16
Auto Trait Implementations§
impl Freeze for f32x16
impl RefUnwindSafe for f32x16
impl Send for f32x16
impl Sync for f32x16
impl Unpin for f32x16
impl UnwindSafe for f32x16
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.