pub struct Neon128;Expand description
NEON: 128-bit registers (the ARM64 baseline)
Trait Implementations§
impl Copy for Neon128
Source§impl Simd for Neon128
impl Simd for Neon128
type V = uint8x16_t
fn zero(self) -> uint8x16_t
fn splat8(self, v: u8) -> uint8x16_t
fn splat16(self, v: u16) -> uint8x16_t
fn splat32(self, v: u32) -> uint8x16_t
fn splat64(self, v: u64) -> uint8x16_t
fn splatf(self, v: f32) -> uint8x16_t
Source§fn load(self, b: &[u8]) -> uint8x16_t
fn load(self, b: &[u8]) -> uint8x16_t
BYTES bytes
fn store(self, b: &mut [u8], v: uint8x16_t)
Source§fn load_px(self, b: &[u8]) -> uint8x16_t
fn load_px(self, b: &[u8]) -> uint8x16_t
4 * PX bytes (PX pixels) zero-extended to pixel lanes
Source§fn store_px(self, b: &mut [u8], v: uint8x16_t)
fn store_px(self, b: &mut [u8], v: uint8x16_t)
pixel lanes saturated to bytes (packuswb), 4 * PX bytes
Source§fn bcast_px(self, b: &[u8]) -> uint8x16_t
fn bcast_px(self, b: &[u8]) -> uint8x16_t
PX bytes, byte i to the 4 u16 lanes of pixel i
Source§fn load_raw(self, b: &[u8]) -> uint8x16_t
fn load_raw(self, b: &[u8]) -> uint8x16_t
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: uint8x16_t)
Source§fn widen_px(self, v: uint8x16_t) -> uint8x16_t
fn widen_px(self, v: uint8x16_t) -> uint8x16_t
raw pixels to pixel lanes
Source§fn load_lane32(self, b: &[u8]) -> uint8x16_t
fn load_lane32(self, b: &[u8]) -> uint8x16_t
4 bytes into the low dword of every 128-bit lane (BYTES / 4 bytes), the rest 0
Source§fn load_i32(self, b: &[i32]) -> uint8x16_t
fn load_i32(self, b: &[i32]) -> uint8x16_t
BYTES / 4 i32 values
fn store_i32(self, b: &mut [i32], v: uint8x16_t)
Source§fn from_i32(self, v: i32) -> uint8x16_t
fn from_i32(self, v: i32) -> uint8x16_t
movd: v in dword 0, the rest 0 / dword 0 of v
fn to_i32(self, v: uint8x16_t) -> i32
fn add8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn sub8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn addus8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn subus8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn maxu8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn minu8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpeq8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn avgu8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
Source§fn movemask8(self, a: uint8x16_t) -> u32
fn movemask8(self, a: uint8x16_t) -> u32
bit i = top bit of byte i (BYTES bits)
fn unpacklo8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn unpackhi8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn packus16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn add16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn sub16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn subus16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn mullo16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn mulhiu16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn mins16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn maxs16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpeq16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpgts16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn srl16<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
fn sll16<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
Source§fn shuf16<const IMM: i32>(self, a: uint8x16_t) -> uint8x16_t
fn shuf16<const IMM: i32>(self, a: uint8x16_t) -> uint8x16_t
pshuflw + pshufhw with the same immediate (per 64-bit half)
fn unpacklo16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn unpackhi16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn packs32(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
Source§fn madd16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn madd16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
pmaddwd: i32 lanes = a0 * b0 + a1 * b1 of the signed 16-bit pairs
fn add32(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn sub32(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpeq32(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpgts32(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
Source§fn movemask32(self, a: uint8x16_t) -> u32
fn movemask32(self, a: uint8x16_t) -> u32
bit i = top bit of dword i (BYTES / 4 bits)
Source§fn shuf32<const IMM: i32>(self, a: uint8x16_t) -> uint8x16_t
fn shuf32<const IMM: i32>(self, a: uint8x16_t) -> uint8x16_t
pshufd (per 128-bit lane)
Source§fn shufps<const IMM: i32>(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn shufps<const IMM: i32>(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
shufps on integer registers: dwords 0, 1 from a, 2, 3 from b (per 128-bit lane)
fn srl32<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
fn sll32<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
fn sra32<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
Source§fn bsll<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
fn bsll<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
pslldq / psrldq: byte shifts per 128-bit lane
fn bsrl<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
fn and(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
Source§fn andnot(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn andnot(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
!a & b (pandn)
fn or(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn xor(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cvt_i32_f32(self, a: uint8x16_t) -> uint8x16_t
Source§fn cvtt_f32_i32(self, a: uint8x16_t) -> uint8x16_t
fn cvtt_f32_i32(self, a: uint8x16_t) -> uint8x16_t
truncating (0x80000000 for NaN / out of range)
Source§fn cvtr_f32_i32(self, a: uint8x16_t) -> uint8x16_t
fn cvtr_f32_i32(self, a: uint8x16_t) -> uint8x16_t
rounding to nearest even (cvtps2dq)
fn addf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn subf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn mulf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn divf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn splatd(self, v: f64) -> uint8x16_t
fn addd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn subd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn muld(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn divd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn sqrtd(self, a: uint8x16_t) -> uint8x16_t
Source§fn maxd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn maxd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
maxpd / minpd: b when unordered
fn mind(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
Source§fn cmpltd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpltd(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
cmpltpd: all ones where a < b (false when unordered)
Source§fn cvt_i32_f64(self, a: uint8x16_t) -> uint8x16_t
fn cvt_i32_f64(self, a: uint8x16_t) -> uint8x16_t
cvtdq2pd: the first BYTES / 8 i32 lanes to f64
Source§fn cvtt_f64_i32(self, a: uint8x16_t) -> uint8x16_t
fn cvtt_f64_i32(self, a: uint8x16_t) -> uint8x16_t
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: uint8x16_t)
fn store_i32_half(self, b: &mut [i32], v: uint8x16_t)
the first BYTES / 8 i32 lanes
Source§fn sra16<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
fn sra16<const N: i32>(self, a: uint8x16_t) -> uint8x16_t
psraw: arithmetic right shift of the i16 lanes
Source§fn mulhis16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn mulhis16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
pmulhw: high 16 bits of the signed 16-bit products
Source§fn packs16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn packs16(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
packsswb: i16 lanes of a, then b, saturated to i8
Source§fn load_i16(self, b: &[i16]) -> uint8x16_t
fn load_i16(self, b: &[i16]) -> uint8x16_t
BYTES / 2 i16 values
fn store_i16(self, b: &mut [i16], v: uint8x16_t)
Source§fn store_lanes2(self, b: &mut [u8], lo: uint8x16_t, hi: uint8x16_t)
fn store_lanes2(self, b: &mut [u8], lo: uint8x16_t, hi: uint8x16_t)
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]) -> (uint8x16_t, uint8x16_t)
fn load_lanes2(self, b: &[u8]) -> (uint8x16_t, uint8x16_t)
the inverse of store_lanes2: 2 * BYTES bytes -> (lo, hi)
Source§fn load_i16_lanes(self, a: &[i16], _b: &[i16]) -> uint8x16_t
fn load_i16_lanes(self, a: &[i16], _b: &[i16]) -> uint8x16_t
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: uint8x16_t)
fn store_raw_lanes(self, a: &mut [u8], _b: &mut [u8], v: uint8x16_t)
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: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn sadu8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
(main agent) psadbw: per 8-byte group the sum of |a - b| (u8) in its u64 lane
Source§fn add64(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn add64(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
(main agent) u64 lanes
Source§fn maxf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn maxf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
maxps / minps: b when unordered
fn minf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
Source§fn sqrtf(self, a: uint8x16_t) -> uint8x16_t
fn sqrtf(self, a: uint8x16_t) -> uint8x16_t
sqrtps
Source§fn load_u16(self, b: &[u16]) -> uint8x16_t
fn load_u16(self, b: &[u16]) -> uint8x16_t
BYTES / 2 u16 values
fn store_u16(self, b: &mut [u16], v: uint8x16_t)
Source§fn load_u16_lo(self, b: &[u16]) -> uint8x16_t
fn load_u16_lo(self, b: &[u16]) -> uint8x16_t
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: uint8x16_t)
Source§fn srl16x(self, a: uint8x16_t, n: u32) -> uint8x16_t
fn srl16x(self, a: uint8x16_t, n: u32) -> uint8x16_t
psrlw with a register count: logical right shift of the 16-bit lanes by n (n > 15: 0)
Source§fn load_f32(self, b: &[f32]) -> uint8x16_t
fn load_f32(self, b: &[f32]) -> uint8x16_t
BYTES / 4 f32 values
fn store_f32(self, b: &mut [f32], v: uint8x16_t)
Source§fn adds8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn adds8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
paddsb: signed saturating add of the i8 lanes
Source§fn subs8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn subs8(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
psubsb: signed saturating subtract of the i8 lanes
Source§fn cmpltf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn cmpltf(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
cmpltps: all ones where a < b (false when unordered)
Source§fn load_f32_lanes(self, a: &[f32], _b: &[f32]) -> uint8x16_t
fn load_f32_lanes(self, a: &[f32], _b: &[f32]) -> uint8x16_t
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: uint8x16_t)
fn store_f32_lanes(self, a: &mut [f32], _b: &mut [f32], v: uint8x16_t)
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: uint8x16_t, b: uint8x16_t) -> uint8x16_t
fn packssdw(self, a: uint8x16_t, b: uint8x16_t) -> uint8x16_t
packs32 (packssdw), on AVX2 without the clamps
Source§fn packuswb_px(self, v: uint8x16_t) -> uint8x16_t
fn packuswb_px(self, v: uint8x16_t) -> uint8x16_t
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: uint8x16_t, b: uint8x16_t) -> u32
fn ptest_raw(self, a: uint8x16_t, b: uint8x16_t) -> 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
Source§fn ptestz_raw(self, a: uint8x16_t, b: uint8x16_t) -> bool
fn ptestz_raw(self, a: uint8x16_t, b: uint8x16_t) -> bool
ptest ZF on the raw-pixel bytes: a & b == 0 (AVX2: vptest + jz)
Auto Trait Implementations§
impl Forget for Neon128
impl Freeze for Neon128
impl Move for Neon128
impl RefUnwindSafe for Neon128
impl Send for Neon128
impl Sync for Neon128
impl Unpin for Neon128
impl UnsafeUnpin for Neon128
impl UnwindSafe for Neon128
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