pub struct Sse2;Expand description
SSE2: 128-bit registers (the x86-64 baseline)
Trait Implementations§
impl Copy for Sse2
Source§impl Simd for Sse2
impl Simd for Sse2
type V = __m128i
fn zero(self) -> __m128i
fn splat8(self, v: u8) -> __m128i
fn splat16(self, v: u16) -> __m128i
fn splat32(self, v: u32) -> __m128i
fn splat64(self, v: u64) -> __m128i
fn splatf(self, v: f32) -> __m128i
fn store(self, b: &mut [u8], v: __m128i)
Source§fn store_px(self, b: &mut [u8], v: __m128i)
fn store_px(self, b: &mut [u8], v: __m128i)
pixel lanes saturated to bytes (packuswb), 4 * PX bytes
Source§fn load_raw(self, b: &[u8]) -> __m128i
fn load_raw(self, b: &[u8]) -> __m128i
4 * PX bytes as they are (“raw” pixels: SSE2 the low 8 bytes, AVX2 the low 16)
fn store_raw(self, b: &mut [u8], v: __m128i)
Source§fn load_lane32(self, b: &[u8]) -> __m128i
fn load_lane32(self, b: &[u8]) -> __m128i
4 bytes into the low dword of every 128-bit lane (BYTES / 4 bytes), the rest 0
fn store_i32(self, b: &mut [i32], v: __m128i)
fn to_i32(self, v: __m128i) -> i32
fn add8(self, a: __m128i, b: __m128i) -> __m128i
fn sub8(self, a: __m128i, b: __m128i) -> __m128i
fn addus8(self, a: __m128i, b: __m128i) -> __m128i
fn subus8(self, a: __m128i, b: __m128i) -> __m128i
fn maxu8(self, a: __m128i, b: __m128i) -> __m128i
fn minu8(self, a: __m128i, b: __m128i) -> __m128i
fn cmpeq8(self, a: __m128i, b: __m128i) -> __m128i
fn avgu8(self, a: __m128i, b: __m128i) -> __m128i
fn unpacklo8(self, a: __m128i, b: __m128i) -> __m128i
fn unpackhi8(self, a: __m128i, b: __m128i) -> __m128i
fn packus16(self, a: __m128i, b: __m128i) -> __m128i
fn add16(self, a: __m128i, b: __m128i) -> __m128i
fn sub16(self, a: __m128i, b: __m128i) -> __m128i
fn subus16(self, a: __m128i, b: __m128i) -> __m128i
fn mullo16(self, a: __m128i, b: __m128i) -> __m128i
fn mulhiu16(self, a: __m128i, b: __m128i) -> __m128i
fn mins16(self, a: __m128i, b: __m128i) -> __m128i
fn maxs16(self, a: __m128i, b: __m128i) -> __m128i
fn cmpeq16(self, a: __m128i, b: __m128i) -> __m128i
fn cmpgts16(self, a: __m128i, b: __m128i) -> __m128i
fn srl16<const N: i32>(self, a: __m128i) -> __m128i
fn sll16<const N: i32>(self, a: __m128i) -> __m128i
Source§fn shuf16<const IMM: i32>(self, a: __m128i) -> __m128i
fn shuf16<const IMM: i32>(self, a: __m128i) -> __m128i
pshuflw + pshufhw with the same immediate (per 64-bit half)
fn unpacklo16(self, a: __m128i, b: __m128i) -> __m128i
fn unpackhi16(self, a: __m128i, b: __m128i) -> __m128i
fn packs32(self, a: __m128i, b: __m128i) -> __m128i
Source§fn madd16(self, a: __m128i, b: __m128i) -> __m128i
fn madd16(self, a: __m128i, b: __m128i) -> __m128i
pmaddwd: i32 lanes = a0 * b0 + a1 * b1 of the signed 16-bit pairs
fn add32(self, a: __m128i, b: __m128i) -> __m128i
fn sub32(self, a: __m128i, b: __m128i) -> __m128i
fn cmpeq32(self, a: __m128i, b: __m128i) -> __m128i
fn cmpgts32(self, a: __m128i, b: __m128i) -> __m128i
Source§fn movemask32(self, a: __m128i) -> u32
fn movemask32(self, a: __m128i) -> u32
bit i = top bit of dword i (BYTES / 4 bits)
Source§fn shufps<const IMM: i32>(self, a: __m128i, b: __m128i) -> __m128i
fn shufps<const IMM: i32>(self, a: __m128i, b: __m128i) -> __m128i
shufps on integer registers: dwords 0, 1 from a, 2, 3 from b (per 128-bit lane)
fn srl32<const N: i32>(self, a: __m128i) -> __m128i
fn sll32<const N: i32>(self, a: __m128i) -> __m128i
fn sra32<const N: i32>(self, a: __m128i) -> __m128i
Source§fn bsll<const N: i32>(self, a: __m128i) -> __m128i
fn bsll<const N: i32>(self, a: __m128i) -> __m128i
pslldq / psrldq: byte shifts per 128-bit lane
fn bsrl<const N: i32>(self, a: __m128i) -> __m128i
fn and(self, a: __m128i, b: __m128i) -> __m128i
fn or(self, a: __m128i, b: __m128i) -> __m128i
fn xor(self, a: __m128i, b: __m128i) -> __m128i
fn cvt_i32_f32(self, a: __m128i) -> __m128i
Source§fn cvtt_f32_i32(self, a: __m128i) -> __m128i
fn cvtt_f32_i32(self, a: __m128i) -> __m128i
truncating (0x80000000 for NaN / out of range)
Source§fn cvtr_f32_i32(self, a: __m128i) -> __m128i
fn cvtr_f32_i32(self, a: __m128i) -> __m128i
rounding to nearest even (cvtps2dq)
fn addf(self, a: __m128i, b: __m128i) -> __m128i
fn subf(self, a: __m128i, b: __m128i) -> __m128i
fn mulf(self, a: __m128i, b: __m128i) -> __m128i
fn divf(self, a: __m128i, b: __m128i) -> __m128i
fn splatd(self, v: f64) -> __m128i
fn addd(self, a: __m128i, b: __m128i) -> __m128i
fn subd(self, a: __m128i, b: __m128i) -> __m128i
fn muld(self, a: __m128i, b: __m128i) -> __m128i
fn divd(self, a: __m128i, b: __m128i) -> __m128i
fn sqrtd(self, a: __m128i) -> __m128i
fn mind(self, a: __m128i, b: __m128i) -> __m128i
Source§fn cmpltd(self, a: __m128i, b: __m128i) -> __m128i
fn cmpltd(self, a: __m128i, b: __m128i) -> __m128i
cmpltpd: all ones where a < b (false when unordered)
Source§fn cvt_i32_f64(self, a: __m128i) -> __m128i
fn cvt_i32_f64(self, a: __m128i) -> __m128i
cvtdq2pd: the first BYTES / 8 i32 lanes to f64
Source§fn cvtt_f64_i32(self, a: __m128i) -> __m128i
fn cvtt_f64_i32(self, a: __m128i) -> __m128i
cvttpd2dq: f64 lanes to the first BYTES / 8 i32 lanes (truncating, 0x80000000 when
out of range), the rest 0
Source§fn store_i32_half(self, b: &mut [i32], v: __m128i)
fn store_i32_half(self, b: &mut [i32], v: __m128i)
the first BYTES / 8 i32 lanes
Source§fn sra16<const N: i32>(self, a: __m128i) -> __m128i
fn sra16<const N: i32>(self, a: __m128i) -> __m128i
psraw: arithmetic right shift of the i16 lanes
Source§fn mulhis16(self, a: __m128i, b: __m128i) -> __m128i
fn mulhis16(self, a: __m128i, b: __m128i) -> __m128i
pmulhw: high 16 bits of the signed 16-bit products
Source§fn packs16(self, a: __m128i, b: __m128i) -> __m128i
fn packs16(self, a: __m128i, b: __m128i) -> __m128i
packsswb: i16 lanes of a, then b, saturated to i8
fn store_i16(self, b: &mut [i16], v: __m128i)
Source§fn store_lanes2(self, b: &mut [u8], lo: __m128i, hi: __m128i)
fn store_lanes2(self, b: &mut [u8], lo: __m128i, hi: __m128i)
2 * BYTES bytes: per 128-bit lane k, lane k of lo then lane k of hi (SSE2: lo, hi;
AVX2: vperm2i128) – 2 x 4 pixels per lane in pixel order
Source§fn load_lanes2(self, b: &[u8]) -> (__m128i, __m128i)
fn load_lanes2(self, b: &[u8]) -> (__m128i, __m128i)
the inverse of store_lanes2: 2 * BYTES bytes -> (lo, hi)
Source§fn load_i16_lanes(self, a: &[i16], _b: &[i16]) -> __m128i
fn load_i16_lanes(self, a: &[i16], _b: &[i16]) -> __m128i
8 i16 per 128-bit lane from separate sources: lane 0 from a, lane 1 from b (SSE2: a)
Source§fn store_raw_lanes(self, a: &mut [u8], _b: &mut [u8], v: __m128i)
fn store_raw_lanes(self, a: &mut [u8], _b: &mut [u8], v: __m128i)
the low 8 bytes of every 128-bit lane to separate places: lane 0 to a, lane 1 to b
(SSE2: a)
Source§fn sadu8(self, a: __m128i, b: __m128i) -> __m128i
fn sadu8(self, a: __m128i, b: __m128i) -> __m128i
(main agent) psadbw: per 8-byte group the sum of |a - b| (u8) in its u64 lane
fn minf(self, a: __m128i, b: __m128i) -> __m128i
fn store_u16(self, b: &mut [u16], v: __m128i)
Source§fn load_u16_lo(self, b: &[u16]) -> __m128i
fn load_u16_lo(self, b: &[u16]) -> __m128i
movq: 4 u16 values into the low 64 bits (the rest 0) / the low 64 bits to 4 u16 values
fn store_u16_lo(self, b: &mut [u16], v: __m128i)
Source§fn srl16x(self, a: __m128i, n: u32) -> __m128i
fn srl16x(self, a: __m128i, n: u32) -> __m128i
psrlw with a register count: logical right shift of the 16-bit lanes by n (n > 15: 0)
fn store_f32(self, b: &mut [f32], v: __m128i)
Source§fn adds8(self, a: __m128i, b: __m128i) -> __m128i
fn adds8(self, a: __m128i, b: __m128i) -> __m128i
paddsb: signed saturating add of the i8 lanes
Source§fn subs8(self, a: __m128i, b: __m128i) -> __m128i
fn subs8(self, a: __m128i, b: __m128i) -> __m128i
psubsb: signed saturating subtract of the i8 lanes
Source§fn cmpltf(self, a: __m128i, b: __m128i) -> __m128i
fn cmpltf(self, a: __m128i, b: __m128i) -> __m128i
cmpltps: all ones where a < b (false when unordered)
Source§fn load_f32_lanes(self, a: &[f32], _b: &[f32]) -> __m128i
fn load_f32_lanes(self, a: &[f32], _b: &[f32]) -> __m128i
4 f32 per 128-bit lane from separate sources: lane 0 from a, lane 1 from b (SSE2: a)
Source§fn store_f32_lanes(self, a: &mut [f32], _b: &mut [f32], v: __m128i)
fn store_f32_lanes(self, a: &mut [f32], _b: &mut [f32], v: __m128i)
the 4 f32 of every 128-bit lane to separate places: lane 0 to a, lane 1 to b (SSE2: a)
Source§fn packssdw(self, a: __m128i, b: __m128i) -> __m128i
fn packssdw(self, a: __m128i, b: __m128i) -> __m128i
packs32 (packssdw), on AVX2 without the clamps
Source§fn packuswb_px(self, v: __m128i) -> __m128i
fn packuswb_px(self, v: __m128i) -> __m128i
pixel lanes to raw pixels: packuswb (+ vpermq 0x08 on AVX2) as in store_px, on AVX2
without the clamps; the inverse of widen_px
Source§fn ptest_raw(self, a: __m128i, b: __m128i) -> u32
fn ptest_raw(self, a: __m128i, b: __m128i) -> u32
ptest on the raw-pixel bytes (SSE2: the low 8, AVX2: the low 16): 1 when a & b == 0
(ZF), else 2 when !a & b == 0 (CF), else 0. AVX2: vptest + jz + jnc, the CF case
falls through (inline assembly: core::arch writes ptest as or-reductions, and LLVM
then often builds shuffle / reduce sequences or loses the CF test); branch on the
result, the branches thread through
Auto Trait Implementations§
impl Forget for Sse2
impl Freeze for Sse2
impl Move for Sse2
impl RefUnwindSafe for Sse2
impl Send for Sse2
impl Sync for Sse2
impl Unpin for Sse2
impl UnsafeUnpin for Sse2
impl UnwindSafe for Sse2
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
Mutably borrows from an owned value. Read more