Struct simd::f32x4
[−]
[src]
pub struct f32x4(_, _, _, _);
A SIMD vector of 4 f32
s.
Methods
impl f32x4
[src]
const fn new(x0: f32, x1: f32, x2: f32, x3: f32) -> f32x4
Create a new instance.
const fn splat(x: f32) -> f32x4
Create a new instance where every lane has value x
.
fn eq(self, other: Self) -> bool32fx4
Compare for equality.
fn ne(self, other: Self) -> bool32fx4
Compare for equality.
fn lt(self, other: Self) -> bool32fx4
Compare for equality.
fn le(self, other: Self) -> bool32fx4
Compare for equality.
fn gt(self, other: Self) -> bool32fx4
Compare for equality.
fn ge(self, other: Self) -> bool32fx4
Compare for equality.
fn extract(self, idx: u32) -> f32
fn replace(self, idx: u32, elem: f32) -> Self
Return a new vector where the idx
th lane is replaced
by elem
.
Panics
replace
will panic if idx
is out of bounds.
fn load(array: &[f32], idx: usize) -> Self
Load a new value from the idx
th position of array
.
This is equivalent to the following, but is possibly more efficient:
Self::new(array[idx], array[idx + 1], ...)
Panics
load
will panic if idx
is out of bounds in
array
, or if array[idx..]
is too short.
fn store(self, array: &mut [f32], idx: usize)
Store the elements of self
to array
, starting at
the idx
th position.
This is equivalent to the following, but is possibly more efficient:
array[i] = self.extract(0); array[i + 1] = self.extract(1); // ...
Panics
store
will panic if idx
is out of bounds in
array
, or if array[idx...]
is too short.
impl f32x4
[src]
fn sqrt(self) -> Self
Compute the square root of each lane.
fn approx_rsqrt(self) -> Self
Compute an approximation to the reciprocal of the square root
of self
, that is, f32::splat(1.0) / self.sqrt()
.
The accuracy of this approximation is platform dependent.
fn approx_reciprocal(self) -> Self
Compute an approximation to the reciprocal of self
, that is,
f32::splat(1.0) / self
.
The accuracy of this approximation is platform dependent.
fn max(self, other: Self) -> Self
Compute the lane-wise maximum of self
and other
.
This is equivalent to the following, but is possibly more efficient:
f32x4::new(self.extract(0).max(other.extract(0)), self.extract(1).max(other.extract(1)), ...)
fn min(self, other: Self) -> Self
Compute the lane-wise minimum of self
and other
.
This is equivalent to the following, but is possibly more efficient:
f32x4::new(self.extract(0).min(other.extract(0)), self.extract(1).min(other.extract(1)), ...)
fn to_i32(self) -> i32x4
Convert each lane to a signed integer.
fn to_u32(self) -> u32x4
Convert each lane to an unsigned integer.
Trait Implementations
impl Neg for f32x4
[src]
type Output = Self
The resulting type after applying the -
operator
fn neg(self) -> Self
The method for the unary -
operator
impl Add for f32x4
[src]
type Output = Self
The resulting type after applying the +
operator
fn add(self, x: Self) -> Self
The method for the +
operator
impl Sub for f32x4
[src]
type Output = Self
The resulting type after applying the -
operator
fn sub(self, x: Self) -> Self
The method for the -
operator
impl Mul for f32x4
[src]
type Output = Self
The resulting type after applying the *
operator
fn mul(self, x: Self) -> Self
The method for the *
operator
impl Div for f32x4
[src]
type Output = Self
The resulting type after applying the /
operator
fn div(self, x: Self) -> Self
The method for the /
operator
impl Sse2F32x4 for f32x4
[src]
impl Sse3F32x4 for f32x4
[src]
fn addsub(self, other: Self) -> Self
fn hadd(self, other: Self) -> Self
fn hsub(self, other: Self) -> Self
impl Sse41F32x4 for f32x4
[src]
impl AvxF32x4 for f32x4
[src]
fn permutevar(self, other: i32x4) -> f32x4
impl Aarch64F32x4 for f32x4
[src]
impl Simd for f32x4
[src]
type Bool = bool32fx4
The corresponding boolean vector type.
type Elem = f32
The element that this vector stores.
impl Clone for f32x4
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more