From 5728e501676b900fac8f75bbde2647a3ab5e9e77 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Fri, 19 Dec 2025 18:53:18 -0500 Subject: [PATCH 1/2] Change `simd_from` argument order to match others --- fearless_simd/src/generated/avx2.rs | 24 +-- fearless_simd/src/generated/neon.rs | 72 ++++---- fearless_simd/src/generated/simd_types.rs | 192 +++++++++++----------- fearless_simd/src/generated/sse4_2.rs | 24 +-- fearless_simd/src/generated/wasm.rs | 24 +-- fearless_simd/src/traits.rs | 6 +- fearless_simd_gen/src/level.rs | 2 +- fearless_simd_gen/src/mk_simd_types.rs | 4 +- fearless_simd_gen/src/types.rs | 6 +- 9 files changed, 177 insertions(+), 177 deletions(-) diff --git a/fearless_simd/src/generated/avx2.rs b/fearless_simd/src/generated/avx2.rs index 045d473c..bab26fde 100644 --- a/fearless_simd/src/generated/avx2.rs +++ b/fearless_simd/src/generated/avx2.rs @@ -7009,7 +7009,7 @@ impl Simd for Avx2 { } impl SimdFrom<__m256, S> for f32x8 { #[inline(always)] - fn simd_from(arch: __m256, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7024,7 +7024,7 @@ impl From> for __m256 { } impl SimdFrom<__m256i, S> for i8x32 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7039,7 +7039,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for u8x32 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7054,7 +7054,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for mask8x32 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7069,7 +7069,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for i16x16 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7084,7 +7084,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for u16x16 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7099,7 +7099,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for mask16x16 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7114,7 +7114,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for i32x8 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7129,7 +7129,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for u32x8 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7144,7 +7144,7 @@ impl From> for __m256i { } impl SimdFrom<__m256i, S> for mask32x8 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7159,7 +7159,7 @@ impl From> for __m256i { } impl SimdFrom<__m256d, S> for f64x4 { #[inline(always)] - fn simd_from(arch: __m256d, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256d) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7174,7 +7174,7 @@ impl From> for __m256d { } impl SimdFrom<__m256i, S> for mask64x4 { #[inline(always)] - fn simd_from(arch: __m256i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m256i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, diff --git a/fearless_simd/src/generated/neon.rs b/fearless_simd/src/generated/neon.rs index 62f7c69d..8e432c59 100644 --- a/fearless_simd/src/generated/neon.rs +++ b/fearless_simd/src/generated/neon.rs @@ -6752,7 +6752,7 @@ impl Simd for Neon { } impl SimdFrom for f32x4 { #[inline(always)] - fn simd_from(arch: float32x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: float32x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6767,7 +6767,7 @@ impl From> for float32x4_t { } impl SimdFrom for i8x16 { #[inline(always)] - fn simd_from(arch: int8x16_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int8x16_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6782,7 +6782,7 @@ impl From> for int8x16_t { } impl SimdFrom for u8x16 { #[inline(always)] - fn simd_from(arch: uint8x16_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint8x16_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6797,7 +6797,7 @@ impl From> for uint8x16_t { } impl SimdFrom for mask8x16 { #[inline(always)] - fn simd_from(arch: int8x16_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int8x16_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6812,7 +6812,7 @@ impl From> for int8x16_t { } impl SimdFrom for i16x8 { #[inline(always)] - fn simd_from(arch: int16x8_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int16x8_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6827,7 +6827,7 @@ impl From> for int16x8_t { } impl SimdFrom for u16x8 { #[inline(always)] - fn simd_from(arch: uint16x8_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint16x8_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6842,7 +6842,7 @@ impl From> for uint16x8_t { } impl SimdFrom for mask16x8 { #[inline(always)] - fn simd_from(arch: int16x8_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int16x8_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6857,7 +6857,7 @@ impl From> for int16x8_t { } impl SimdFrom for i32x4 { #[inline(always)] - fn simd_from(arch: int32x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int32x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6872,7 +6872,7 @@ impl From> for int32x4_t { } impl SimdFrom for u32x4 { #[inline(always)] - fn simd_from(arch: uint32x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint32x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6887,7 +6887,7 @@ impl From> for uint32x4_t { } impl SimdFrom for mask32x4 { #[inline(always)] - fn simd_from(arch: int32x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int32x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6902,7 +6902,7 @@ impl From> for int32x4_t { } impl SimdFrom for f64x2 { #[inline(always)] - fn simd_from(arch: float64x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: float64x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6917,7 +6917,7 @@ impl From> for float64x2_t { } impl SimdFrom for mask64x2 { #[inline(always)] - fn simd_from(arch: int64x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int64x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6932,7 +6932,7 @@ impl From> for int64x2_t { } impl SimdFrom for f32x8 { #[inline(always)] - fn simd_from(arch: float32x4x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: float32x4x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6947,7 +6947,7 @@ impl From> for float32x4x2_t { } impl SimdFrom for i8x32 { #[inline(always)] - fn simd_from(arch: int8x16x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int8x16x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6962,7 +6962,7 @@ impl From> for int8x16x2_t { } impl SimdFrom for u8x32 { #[inline(always)] - fn simd_from(arch: uint8x16x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint8x16x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6977,7 +6977,7 @@ impl From> for uint8x16x2_t { } impl SimdFrom for mask8x32 { #[inline(always)] - fn simd_from(arch: int8x16x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int8x16x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -6992,7 +6992,7 @@ impl From> for int8x16x2_t { } impl SimdFrom for i16x16 { #[inline(always)] - fn simd_from(arch: int16x8x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int16x8x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7007,7 +7007,7 @@ impl From> for int16x8x2_t { } impl SimdFrom for u16x16 { #[inline(always)] - fn simd_from(arch: uint16x8x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint16x8x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7022,7 +7022,7 @@ impl From> for uint16x8x2_t { } impl SimdFrom for mask16x16 { #[inline(always)] - fn simd_from(arch: int16x8x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int16x8x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7037,7 +7037,7 @@ impl From> for int16x8x2_t { } impl SimdFrom for i32x8 { #[inline(always)] - fn simd_from(arch: int32x4x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int32x4x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7052,7 +7052,7 @@ impl From> for int32x4x2_t { } impl SimdFrom for u32x8 { #[inline(always)] - fn simd_from(arch: uint32x4x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint32x4x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7067,7 +7067,7 @@ impl From> for uint32x4x2_t { } impl SimdFrom for mask32x8 { #[inline(always)] - fn simd_from(arch: int32x4x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int32x4x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7082,7 +7082,7 @@ impl From> for int32x4x2_t { } impl SimdFrom for f64x4 { #[inline(always)] - fn simd_from(arch: float64x2x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: float64x2x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7097,7 +7097,7 @@ impl From> for float64x2x2_t { } impl SimdFrom for mask64x4 { #[inline(always)] - fn simd_from(arch: int64x2x2_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int64x2x2_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7112,7 +7112,7 @@ impl From> for int64x2x2_t { } impl SimdFrom for f32x16 { #[inline(always)] - fn simd_from(arch: float32x4x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: float32x4x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7127,7 +7127,7 @@ impl From> for float32x4x4_t { } impl SimdFrom for i8x64 { #[inline(always)] - fn simd_from(arch: int8x16x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int8x16x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7142,7 +7142,7 @@ impl From> for int8x16x4_t { } impl SimdFrom for u8x64 { #[inline(always)] - fn simd_from(arch: uint8x16x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint8x16x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7157,7 +7157,7 @@ impl From> for uint8x16x4_t { } impl SimdFrom for mask8x64 { #[inline(always)] - fn simd_from(arch: int8x16x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int8x16x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7172,7 +7172,7 @@ impl From> for int8x16x4_t { } impl SimdFrom for i16x32 { #[inline(always)] - fn simd_from(arch: int16x8x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int16x8x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7187,7 +7187,7 @@ impl From> for int16x8x4_t { } impl SimdFrom for u16x32 { #[inline(always)] - fn simd_from(arch: uint16x8x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint16x8x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7202,7 +7202,7 @@ impl From> for uint16x8x4_t { } impl SimdFrom for mask16x32 { #[inline(always)] - fn simd_from(arch: int16x8x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int16x8x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7217,7 +7217,7 @@ impl From> for int16x8x4_t { } impl SimdFrom for i32x16 { #[inline(always)] - fn simd_from(arch: int32x4x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int32x4x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7232,7 +7232,7 @@ impl From> for int32x4x4_t { } impl SimdFrom for u32x16 { #[inline(always)] - fn simd_from(arch: uint32x4x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: uint32x4x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7247,7 +7247,7 @@ impl From> for uint32x4x4_t { } impl SimdFrom for mask32x16 { #[inline(always)] - fn simd_from(arch: int32x4x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int32x4x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7262,7 +7262,7 @@ impl From> for int32x4x4_t { } impl SimdFrom for f64x8 { #[inline(always)] - fn simd_from(arch: float64x2x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: float64x2x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7277,7 +7277,7 @@ impl From> for float64x2x4_t { } impl SimdFrom for mask64x8 { #[inline(always)] - fn simd_from(arch: int64x2x4_t, simd: S) -> Self { + fn simd_from(simd: S, arch: int64x2x4_t) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, diff --git a/fearless_simd/src/generated/simd_types.rs b/fearless_simd/src/generated/simd_types.rs index 2dc44f55..e9f37172 100644 --- a/fearless_simd/src/generated/simd_types.rs +++ b/fearless_simd/src/generated/simd_types.rs @@ -4,7 +4,7 @@ // This file is autogenerated by fearless_simd_gen use crate::{Bytes, Select, Simd, SimdBase, SimdCvtFloat, SimdCvtTruncate, SimdFrom, SimdInto}; -#[doc = "A SIMD vector of 4 [`f32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f32x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f32x4::splat(simd, 1.0);\n let b = f32x4::simd_from(1.0, simd);\n\n // From a slice:\n let c = f32x4::from_slice(simd, &[1.0, 2.0, 3.0, 4.0]);\n\n // From an array:\n let d = f32x4::simd_from([1.0, 2.0, 3.0, 4.0], simd);\n\n // From an element-wise function:\n let e = f32x4::from_fn(simd, |i| i as f32);\n}\n```"] +#[doc = "A SIMD vector of 4 [`f32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f32x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f32x4::splat(simd, 1.0);\n let b = f32x4::simd_from(simd, 1.0);\n\n // From a slice:\n let c = f32x4::from_slice(simd, &[1.0, 2.0, 3.0, 4.0]);\n\n // From an array:\n let d = f32x4::simd_from(simd, [1.0, 2.0, 3.0, 4.0]);\n\n // From an element-wise function:\n let e = f32x4::from_fn(simd, |i| i as f32);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct f32x4 { @@ -13,7 +13,7 @@ pub struct f32x4 { } impl SimdFrom<[f32; 4], S> for f32x4 { #[inline(always)] - fn simd_from(val: [f32; 4], simd: S) -> Self { + fn simd_from(simd: S, val: [f32; 4]) -> Self { simd.load_array_f32x4(val) } } @@ -43,7 +43,7 @@ impl core::fmt::Debug for f32x4 { } impl SimdFrom for f32x4 { #[inline(always)] - fn simd_from(value: f32, simd: S) -> Self { + fn simd_from(simd: S, value: f32) -> Self { simd.splat_f32x4(value) } } @@ -229,7 +229,7 @@ impl crate::SimdCombine for f32x4 { self.simd.combine_f32x4(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 16 [`i8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i8x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i8x16::splat(simd, 1);\n let b = i8x16::simd_from(1, simd);\n\n // From a slice:\n let c = i8x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = i8x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd);\n\n // From an element-wise function:\n let e = i8x16::from_fn(simd, |i| i as i8);\n}\n```"] +#[doc = "A SIMD vector of 16 [`i8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i8x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i8x16::splat(simd, 1);\n let b = i8x16::simd_from(simd, 1);\n\n // From a slice:\n let c = i8x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = i8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an element-wise function:\n let e = i8x16::from_fn(simd, |i| i as i8);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct i8x16 { @@ -238,7 +238,7 @@ pub struct i8x16 { } impl SimdFrom<[i8; 16], S> for i8x16 { #[inline(always)] - fn simd_from(val: [i8; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [i8; 16]) -> Self { simd.load_array_i8x16(val) } } @@ -268,7 +268,7 @@ impl core::fmt::Debug for i8x16 { } impl SimdFrom for i8x16 { #[inline(always)] - fn simd_from(value: i8, simd: S) -> Self { + fn simd_from(simd: S, value: i8) -> Self { simd.splat_i8x16(value) } } @@ -390,7 +390,7 @@ impl crate::SimdCombine for i8x16 { self.simd.combine_i8x16(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 16 [`u8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u8x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u8x16::splat(simd, 1);\n let b = u8x16::simd_from(1, simd);\n\n // From a slice:\n let c = u8x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = u8x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd);\n\n // From an element-wise function:\n let e = u8x16::from_fn(simd, |i| i as u8);\n}\n```"] +#[doc = "A SIMD vector of 16 [`u8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u8x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u8x16::splat(simd, 1);\n let b = u8x16::simd_from(simd, 1);\n\n // From a slice:\n let c = u8x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = u8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an element-wise function:\n let e = u8x16::from_fn(simd, |i| i as u8);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct u8x16 { @@ -399,7 +399,7 @@ pub struct u8x16 { } impl SimdFrom<[u8; 16], S> for u8x16 { #[inline(always)] - fn simd_from(val: [u8; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [u8; 16]) -> Self { simd.load_array_u8x16(val) } } @@ -429,7 +429,7 @@ impl core::fmt::Debug for u8x16 { } impl SimdFrom for u8x16 { #[inline(always)] - fn simd_from(value: u8, simd: S) -> Self { + fn simd_from(simd: S, value: u8) -> Self { simd.splat_u8x16(value) } } @@ -560,7 +560,7 @@ pub struct mask8x16 { } impl SimdFrom<[i8; 16], S> for mask8x16 { #[inline(always)] - fn simd_from(val: [i8; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [i8; 16]) -> Self { simd.load_array_mask8x16(val) } } @@ -595,7 +595,7 @@ impl core::fmt::Debug for mask8x16 { } impl SimdFrom for mask8x16 { #[inline(always)] - fn simd_from(value: i8, simd: S) -> Self { + fn simd_from(simd: S, value: i8) -> Self { simd.splat_mask8x16(value) } } @@ -693,7 +693,7 @@ impl crate::SimdCombine for mask8x16 { self.simd.combine_mask8x16(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 8 [`i16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i16x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i16x8::splat(simd, 1);\n let b = i16x8::simd_from(1, simd);\n\n // From a slice:\n let c = i16x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = i16x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd);\n\n // From an element-wise function:\n let e = i16x8::from_fn(simd, |i| i as i16);\n}\n```"] +#[doc = "A SIMD vector of 8 [`i16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i16x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i16x8::splat(simd, 1);\n let b = i16x8::simd_from(simd, 1);\n\n // From a slice:\n let c = i16x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = i16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an element-wise function:\n let e = i16x8::from_fn(simd, |i| i as i16);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct i16x8 { @@ -702,7 +702,7 @@ pub struct i16x8 { } impl SimdFrom<[i16; 8], S> for i16x8 { #[inline(always)] - fn simd_from(val: [i16; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [i16; 8]) -> Self { simd.load_array_i16x8(val) } } @@ -732,7 +732,7 @@ impl core::fmt::Debug for i16x8 { } impl SimdFrom for i16x8 { #[inline(always)] - fn simd_from(value: i16, simd: S) -> Self { + fn simd_from(simd: S, value: i16) -> Self { simd.splat_i16x8(value) } } @@ -854,7 +854,7 @@ impl crate::SimdCombine for i16x8 { self.simd.combine_i16x8(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 8 [`u16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u16x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u16x8::splat(simd, 1);\n let b = u16x8::simd_from(1, simd);\n\n // From a slice:\n let c = u16x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = u16x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd);\n\n // From an element-wise function:\n let e = u16x8::from_fn(simd, |i| i as u16);\n}\n```"] +#[doc = "A SIMD vector of 8 [`u16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u16x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u16x8::splat(simd, 1);\n let b = u16x8::simd_from(simd, 1);\n\n // From a slice:\n let c = u16x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = u16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an element-wise function:\n let e = u16x8::from_fn(simd, |i| i as u16);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct u16x8 { @@ -863,7 +863,7 @@ pub struct u16x8 { } impl SimdFrom<[u16; 8], S> for u16x8 { #[inline(always)] - fn simd_from(val: [u16; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [u16; 8]) -> Self { simd.load_array_u16x8(val) } } @@ -893,7 +893,7 @@ impl core::fmt::Debug for u16x8 { } impl SimdFrom for u16x8 { #[inline(always)] - fn simd_from(value: u16, simd: S) -> Self { + fn simd_from(simd: S, value: u16) -> Self { simd.splat_u16x8(value) } } @@ -1024,7 +1024,7 @@ pub struct mask16x8 { } impl SimdFrom<[i16; 8], S> for mask16x8 { #[inline(always)] - fn simd_from(val: [i16; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [i16; 8]) -> Self { simd.load_array_mask16x8(val) } } @@ -1059,7 +1059,7 @@ impl core::fmt::Debug for mask16x8 { } impl SimdFrom for mask16x8 { #[inline(always)] - fn simd_from(value: i16, simd: S) -> Self { + fn simd_from(simd: S, value: i16) -> Self { simd.splat_mask16x8(value) } } @@ -1157,7 +1157,7 @@ impl crate::SimdCombine for mask16x8 { self.simd.combine_mask16x8(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 4 [`i32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i32x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i32x4::splat(simd, 1);\n let b = i32x4::simd_from(1, simd);\n\n // From a slice:\n let c = i32x4::from_slice(simd, &[1, 2, 3, 4]);\n\n // From an array:\n let d = i32x4::simd_from([1, 2, 3, 4], simd);\n\n // From an element-wise function:\n let e = i32x4::from_fn(simd, |i| i as i32);\n}\n```"] +#[doc = "A SIMD vector of 4 [`i32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i32x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i32x4::splat(simd, 1);\n let b = i32x4::simd_from(simd, 1);\n\n // From a slice:\n let c = i32x4::from_slice(simd, &[1, 2, 3, 4]);\n\n // From an array:\n let d = i32x4::simd_from(simd, [1, 2, 3, 4]);\n\n // From an element-wise function:\n let e = i32x4::from_fn(simd, |i| i as i32);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct i32x4 { @@ -1166,7 +1166,7 @@ pub struct i32x4 { } impl SimdFrom<[i32; 4], S> for i32x4 { #[inline(always)] - fn simd_from(val: [i32; 4], simd: S) -> Self { + fn simd_from(simd: S, val: [i32; 4]) -> Self { simd.load_array_i32x4(val) } } @@ -1196,7 +1196,7 @@ impl core::fmt::Debug for i32x4 { } impl SimdFrom for i32x4 { #[inline(always)] - fn simd_from(value: i32, simd: S) -> Self { + fn simd_from(simd: S, value: i32) -> Self { simd.splat_i32x4(value) } } @@ -1330,7 +1330,7 @@ impl crate::SimdCombine for i32x4 { self.simd.combine_i32x4(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 4 [`u32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u32x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u32x4::splat(simd, 1);\n let b = u32x4::simd_from(1, simd);\n\n // From a slice:\n let c = u32x4::from_slice(simd, &[1, 2, 3, 4]);\n\n // From an array:\n let d = u32x4::simd_from([1, 2, 3, 4], simd);\n\n // From an element-wise function:\n let e = u32x4::from_fn(simd, |i| i as u32);\n}\n```"] +#[doc = "A SIMD vector of 4 [`u32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u32x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u32x4::splat(simd, 1);\n let b = u32x4::simd_from(simd, 1);\n\n // From a slice:\n let c = u32x4::from_slice(simd, &[1, 2, 3, 4]);\n\n // From an array:\n let d = u32x4::simd_from(simd, [1, 2, 3, 4]);\n\n // From an element-wise function:\n let e = u32x4::from_fn(simd, |i| i as u32);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct u32x4 { @@ -1339,7 +1339,7 @@ pub struct u32x4 { } impl SimdFrom<[u32; 4], S> for u32x4 { #[inline(always)] - fn simd_from(val: [u32; 4], simd: S) -> Self { + fn simd_from(simd: S, val: [u32; 4]) -> Self { simd.load_array_u32x4(val) } } @@ -1369,7 +1369,7 @@ impl core::fmt::Debug for u32x4 { } impl SimdFrom for u32x4 { #[inline(always)] - fn simd_from(value: u32, simd: S) -> Self { + fn simd_from(simd: S, value: u32) -> Self { simd.splat_u32x4(value) } } @@ -1512,7 +1512,7 @@ pub struct mask32x4 { } impl SimdFrom<[i32; 4], S> for mask32x4 { #[inline(always)] - fn simd_from(val: [i32; 4], simd: S) -> Self { + fn simd_from(simd: S, val: [i32; 4]) -> Self { simd.load_array_mask32x4(val) } } @@ -1547,7 +1547,7 @@ impl core::fmt::Debug for mask32x4 { } impl SimdFrom for mask32x4 { #[inline(always)] - fn simd_from(value: i32, simd: S) -> Self { + fn simd_from(simd: S, value: i32) -> Self { simd.splat_mask32x4(value) } } @@ -1645,7 +1645,7 @@ impl crate::SimdCombine for mask32x4 { self.simd.combine_mask32x4(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 2 [`f64`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f64x2};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f64x2::splat(simd, 1.0);\n let b = f64x2::simd_from(1.0, simd);\n\n // From a slice:\n let c = f64x2::from_slice(simd, &[1.0, 2.0]);\n\n // From an array:\n let d = f64x2::simd_from([1.0, 2.0], simd);\n\n // From an element-wise function:\n let e = f64x2::from_fn(simd, |i| i as f64);\n}\n```"] +#[doc = "A SIMD vector of 2 [`f64`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f64x2};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f64x2::splat(simd, 1.0);\n let b = f64x2::simd_from(simd, 1.0);\n\n // From a slice:\n let c = f64x2::from_slice(simd, &[1.0, 2.0]);\n\n // From an array:\n let d = f64x2::simd_from(simd, [1.0, 2.0]);\n\n // From an element-wise function:\n let e = f64x2::from_fn(simd, |i| i as f64);\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(16))] pub struct f64x2 { @@ -1654,7 +1654,7 @@ pub struct f64x2 { } impl SimdFrom<[f64; 2], S> for f64x2 { #[inline(always)] - fn simd_from(val: [f64; 2], simd: S) -> Self { + fn simd_from(simd: S, val: [f64; 2]) -> Self { simd.load_array_f64x2(val) } } @@ -1684,7 +1684,7 @@ impl core::fmt::Debug for f64x2 { } impl SimdFrom for f64x2 { #[inline(always)] - fn simd_from(value: f64, simd: S) -> Self { + fn simd_from(simd: S, value: f64) -> Self { simd.splat_f64x2(value) } } @@ -1865,7 +1865,7 @@ pub struct mask64x2 { } impl SimdFrom<[i64; 2], S> for mask64x2 { #[inline(always)] - fn simd_from(val: [i64; 2], simd: S) -> Self { + fn simd_from(simd: S, val: [i64; 2]) -> Self { simd.load_array_mask64x2(val) } } @@ -1900,7 +1900,7 @@ impl core::fmt::Debug for mask64x2 { } impl SimdFrom for mask64x2 { #[inline(always)] - fn simd_from(value: i64, simd: S) -> Self { + fn simd_from(simd: S, value: i64) -> Self { simd.splat_mask64x2(value) } } @@ -1998,7 +1998,7 @@ impl crate::SimdCombine for mask64x2 { self.simd.combine_mask64x2(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 8 [`f32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f32x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f32x8::splat(simd, 1.0);\n let b = f32x8::simd_from(1.0, simd);\n\n // From a slice:\n let c = f32x8::from_slice(simd, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);\n\n // From an array:\n let d = f32x8::simd_from([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], simd);\n\n // From an element-wise function:\n let e = f32x8::from_fn(simd, |i| i as f32);\n # use fearless_simd::f32x4;\n // From `Self::Block`:\n let f = f32x8::block_splat(f32x4::simd_from([1.0, 2.0, 3.0, 4.0], simd));\n}\n```"] +#[doc = "A SIMD vector of 8 [`f32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f32x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f32x8::splat(simd, 1.0);\n let b = f32x8::simd_from(simd, 1.0);\n\n // From a slice:\n let c = f32x8::from_slice(simd, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);\n\n // From an array:\n let d = f32x8::simd_from(simd, [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);\n\n // From an element-wise function:\n let e = f32x8::from_fn(simd, |i| i as f32);\n # use fearless_simd::f32x4;\n // From `Self::Block`:\n let f = f32x8::block_splat(f32x4::simd_from(simd, [1.0, 2.0, 3.0, 4.0]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct f32x8 { @@ -2007,7 +2007,7 @@ pub struct f32x8 { } impl SimdFrom<[f32; 8], S> for f32x8 { #[inline(always)] - fn simd_from(val: [f32; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [f32; 8]) -> Self { simd.load_array_f32x8(val) } } @@ -2037,7 +2037,7 @@ impl core::fmt::Debug for f32x8 { } impl SimdFrom for f32x8 { #[inline(always)] - fn simd_from(value: f32, simd: S) -> Self { + fn simd_from(simd: S, value: f32) -> Self { simd.splat_f32x8(value) } } @@ -2230,7 +2230,7 @@ impl crate::SimdCombine for f32x8 { self.simd.combine_f32x8(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 32 [`i8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i8x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i8x32::splat(simd, 1);\n let b = i8x32::simd_from(1, simd);\n\n // From a slice:\n let c = i8x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = i8x32::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], simd);\n\n // From an element-wise function:\n let e = i8x32::from_fn(simd, |i| i as i8);\n # use fearless_simd::i8x16;\n // From `Self::Block`:\n let f = i8x32::block_splat(i8x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd));\n}\n```"] +#[doc = "A SIMD vector of 32 [`i8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i8x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i8x32::splat(simd, 1);\n let b = i8x32::simd_from(simd, 1);\n\n // From a slice:\n let c = i8x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = i8x32::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an element-wise function:\n let e = i8x32::from_fn(simd, |i| i as i8);\n # use fearless_simd::i8x16;\n // From `Self::Block`:\n let f = i8x32::block_splat(i8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct i8x32 { @@ -2239,7 +2239,7 @@ pub struct i8x32 { } impl SimdFrom<[i8; 32], S> for i8x32 { #[inline(always)] - fn simd_from(val: [i8; 32], simd: S) -> Self { + fn simd_from(simd: S, val: [i8; 32]) -> Self { simd.load_array_i8x32(val) } } @@ -2269,7 +2269,7 @@ impl core::fmt::Debug for i8x32 { } impl SimdFrom for i8x32 { #[inline(always)] - fn simd_from(value: i8, simd: S) -> Self { + fn simd_from(simd: S, value: i8) -> Self { simd.splat_i8x32(value) } } @@ -2398,7 +2398,7 @@ impl crate::SimdCombine for i8x32 { self.simd.combine_i8x32(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 32 [`u8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u8x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u8x32::splat(simd, 1);\n let b = u8x32::simd_from(1, simd);\n\n // From a slice:\n let c = u8x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = u8x32::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], simd);\n\n // From an element-wise function:\n let e = u8x32::from_fn(simd, |i| i as u8);\n # use fearless_simd::u8x16;\n // From `Self::Block`:\n let f = u8x32::block_splat(u8x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd));\n}\n```"] +#[doc = "A SIMD vector of 32 [`u8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u8x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u8x32::splat(simd, 1);\n let b = u8x32::simd_from(simd, 1);\n\n // From a slice:\n let c = u8x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = u8x32::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an element-wise function:\n let e = u8x32::from_fn(simd, |i| i as u8);\n # use fearless_simd::u8x16;\n // From `Self::Block`:\n let f = u8x32::block_splat(u8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct u8x32 { @@ -2407,7 +2407,7 @@ pub struct u8x32 { } impl SimdFrom<[u8; 32], S> for u8x32 { #[inline(always)] - fn simd_from(val: [u8; 32], simd: S) -> Self { + fn simd_from(simd: S, val: [u8; 32]) -> Self { simd.load_array_u8x32(val) } } @@ -2437,7 +2437,7 @@ impl core::fmt::Debug for u8x32 { } impl SimdFrom for u8x32 { #[inline(always)] - fn simd_from(value: u8, simd: S) -> Self { + fn simd_from(simd: S, value: u8) -> Self { simd.splat_u8x32(value) } } @@ -2575,7 +2575,7 @@ pub struct mask8x32 { } impl SimdFrom<[i8; 32], S> for mask8x32 { #[inline(always)] - fn simd_from(val: [i8; 32], simd: S) -> Self { + fn simd_from(simd: S, val: [i8; 32]) -> Self { simd.load_array_mask8x32(val) } } @@ -2610,7 +2610,7 @@ impl core::fmt::Debug for mask8x32 { } impl SimdFrom for mask8x32 { #[inline(always)] - fn simd_from(value: i8, simd: S) -> Self { + fn simd_from(simd: S, value: i8) -> Self { simd.splat_mask8x32(value) } } @@ -2715,7 +2715,7 @@ impl crate::SimdCombine for mask8x32 { self.simd.combine_mask8x32(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 16 [`i16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i16x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i16x16::splat(simd, 1);\n let b = i16x16::simd_from(1, simd);\n\n // From a slice:\n let c = i16x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = i16x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd);\n\n // From an element-wise function:\n let e = i16x16::from_fn(simd, |i| i as i16);\n # use fearless_simd::i16x8;\n // From `Self::Block`:\n let f = i16x16::block_splat(i16x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd));\n}\n```"] +#[doc = "A SIMD vector of 16 [`i16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i16x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i16x16::splat(simd, 1);\n let b = i16x16::simd_from(simd, 1);\n\n // From a slice:\n let c = i16x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = i16x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an element-wise function:\n let e = i16x16::from_fn(simd, |i| i as i16);\n # use fearless_simd::i16x8;\n // From `Self::Block`:\n let f = i16x16::block_splat(i16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct i16x16 { @@ -2724,7 +2724,7 @@ pub struct i16x16 { } impl SimdFrom<[i16; 16], S> for i16x16 { #[inline(always)] - fn simd_from(val: [i16; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [i16; 16]) -> Self { simd.load_array_i16x16(val) } } @@ -2759,7 +2759,7 @@ impl core::fmt::Debug for i16x16 { } impl SimdFrom for i16x16 { #[inline(always)] - fn simd_from(value: i16, simd: S) -> Self { + fn simd_from(simd: S, value: i16) -> Self { simd.splat_i16x16(value) } } @@ -2888,7 +2888,7 @@ impl crate::SimdCombine for i16x16 { self.simd.combine_i16x16(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 16 [`u16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u16x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u16x16::splat(simd, 1);\n let b = u16x16::simd_from(1, simd);\n\n // From a slice:\n let c = u16x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = u16x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd);\n\n // From an element-wise function:\n let e = u16x16::from_fn(simd, |i| i as u16);\n # use fearless_simd::u16x8;\n // From `Self::Block`:\n let f = u16x16::block_splat(u16x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd));\n}\n```"] +#[doc = "A SIMD vector of 16 [`u16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u16x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u16x16::splat(simd, 1);\n let b = u16x16::simd_from(simd, 1);\n\n // From a slice:\n let c = u16x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = u16x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an element-wise function:\n let e = u16x16::from_fn(simd, |i| i as u16);\n # use fearless_simd::u16x8;\n // From `Self::Block`:\n let f = u16x16::block_splat(u16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct u16x16 { @@ -2897,7 +2897,7 @@ pub struct u16x16 { } impl SimdFrom<[u16; 16], S> for u16x16 { #[inline(always)] - fn simd_from(val: [u16; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [u16; 16]) -> Self { simd.load_array_u16x16(val) } } @@ -2932,7 +2932,7 @@ impl core::fmt::Debug for u16x16 { } impl SimdFrom for u16x16 { #[inline(always)] - fn simd_from(value: u16, simd: S) -> Self { + fn simd_from(simd: S, value: u16) -> Self { simd.splat_u16x16(value) } } @@ -3070,7 +3070,7 @@ pub struct mask16x16 { } impl SimdFrom<[i16; 16], S> for mask16x16 { #[inline(always)] - fn simd_from(val: [i16; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [i16; 16]) -> Self { simd.load_array_mask16x16(val) } } @@ -3105,7 +3105,7 @@ impl core::fmt::Debug for mask16x16 { } impl SimdFrom for mask16x16 { #[inline(always)] - fn simd_from(value: i16, simd: S) -> Self { + fn simd_from(simd: S, value: i16) -> Self { simd.splat_mask16x16(value) } } @@ -3210,7 +3210,7 @@ impl crate::SimdCombine for mask16x16 { self.simd.combine_mask16x16(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 8 [`i32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i32x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i32x8::splat(simd, 1);\n let b = i32x8::simd_from(1, simd);\n\n // From a slice:\n let c = i32x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = i32x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd);\n\n // From an element-wise function:\n let e = i32x8::from_fn(simd, |i| i as i32);\n # use fearless_simd::i32x4;\n // From `Self::Block`:\n let f = i32x8::block_splat(i32x4::simd_from([1, 2, 3, 4], simd));\n}\n```"] +#[doc = "A SIMD vector of 8 [`i32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i32x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i32x8::splat(simd, 1);\n let b = i32x8::simd_from(simd, 1);\n\n // From a slice:\n let c = i32x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = i32x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an element-wise function:\n let e = i32x8::from_fn(simd, |i| i as i32);\n # use fearless_simd::i32x4;\n // From `Self::Block`:\n let f = i32x8::block_splat(i32x4::simd_from(simd, [1, 2, 3, 4]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct i32x8 { @@ -3219,7 +3219,7 @@ pub struct i32x8 { } impl SimdFrom<[i32; 8], S> for i32x8 { #[inline(always)] - fn simd_from(val: [i32; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [i32; 8]) -> Self { simd.load_array_i32x8(val) } } @@ -3249,7 +3249,7 @@ impl core::fmt::Debug for i32x8 { } impl SimdFrom for i32x8 { #[inline(always)] - fn simd_from(value: i32, simd: S) -> Self { + fn simd_from(simd: S, value: i32) -> Self { simd.splat_i32x8(value) } } @@ -3390,7 +3390,7 @@ impl crate::SimdCombine for i32x8 { self.simd.combine_i32x8(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 8 [`u32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u32x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u32x8::splat(simd, 1);\n let b = u32x8::simd_from(1, simd);\n\n // From a slice:\n let c = u32x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = u32x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd);\n\n // From an element-wise function:\n let e = u32x8::from_fn(simd, |i| i as u32);\n # use fearless_simd::u32x4;\n // From `Self::Block`:\n let f = u32x8::block_splat(u32x4::simd_from([1, 2, 3, 4], simd));\n}\n```"] +#[doc = "A SIMD vector of 8 [`u32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u32x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u32x8::splat(simd, 1);\n let b = u32x8::simd_from(simd, 1);\n\n // From a slice:\n let c = u32x8::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an array:\n let d = u32x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]);\n\n // From an element-wise function:\n let e = u32x8::from_fn(simd, |i| i as u32);\n # use fearless_simd::u32x4;\n // From `Self::Block`:\n let f = u32x8::block_splat(u32x4::simd_from(simd, [1, 2, 3, 4]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct u32x8 { @@ -3399,7 +3399,7 @@ pub struct u32x8 { } impl SimdFrom<[u32; 8], S> for u32x8 { #[inline(always)] - fn simd_from(val: [u32; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [u32; 8]) -> Self { simd.load_array_u32x8(val) } } @@ -3429,7 +3429,7 @@ impl core::fmt::Debug for u32x8 { } impl SimdFrom for u32x8 { #[inline(always)] - fn simd_from(value: u32, simd: S) -> Self { + fn simd_from(simd: S, value: u32) -> Self { simd.splat_u32x8(value) } } @@ -3579,7 +3579,7 @@ pub struct mask32x8 { } impl SimdFrom<[i32; 8], S> for mask32x8 { #[inline(always)] - fn simd_from(val: [i32; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [i32; 8]) -> Self { simd.load_array_mask32x8(val) } } @@ -3614,7 +3614,7 @@ impl core::fmt::Debug for mask32x8 { } impl SimdFrom for mask32x8 { #[inline(always)] - fn simd_from(value: i32, simd: S) -> Self { + fn simd_from(simd: S, value: i32) -> Self { simd.splat_mask32x8(value) } } @@ -3719,7 +3719,7 @@ impl crate::SimdCombine for mask32x8 { self.simd.combine_mask32x8(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 4 [`f64`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f64x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f64x4::splat(simd, 1.0);\n let b = f64x4::simd_from(1.0, simd);\n\n // From a slice:\n let c = f64x4::from_slice(simd, &[1.0, 2.0, 3.0, 4.0]);\n\n // From an array:\n let d = f64x4::simd_from([1.0, 2.0, 3.0, 4.0], simd);\n\n // From an element-wise function:\n let e = f64x4::from_fn(simd, |i| i as f64);\n # use fearless_simd::f64x2;\n // From `Self::Block`:\n let f = f64x4::block_splat(f64x2::simd_from([1.0, 2.0], simd));\n}\n```"] +#[doc = "A SIMD vector of 4 [`f64`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f64x4};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f64x4::splat(simd, 1.0);\n let b = f64x4::simd_from(simd, 1.0);\n\n // From a slice:\n let c = f64x4::from_slice(simd, &[1.0, 2.0, 3.0, 4.0]);\n\n // From an array:\n let d = f64x4::simd_from(simd, [1.0, 2.0, 3.0, 4.0]);\n\n // From an element-wise function:\n let e = f64x4::from_fn(simd, |i| i as f64);\n # use fearless_simd::f64x2;\n // From `Self::Block`:\n let f = f64x4::block_splat(f64x2::simd_from(simd, [1.0, 2.0]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(32))] pub struct f64x4 { @@ -3728,7 +3728,7 @@ pub struct f64x4 { } impl SimdFrom<[f64; 4], S> for f64x4 { #[inline(always)] - fn simd_from(val: [f64; 4], simd: S) -> Self { + fn simd_from(simd: S, val: [f64; 4]) -> Self { simd.load_array_f64x4(val) } } @@ -3758,7 +3758,7 @@ impl core::fmt::Debug for f64x4 { } impl SimdFrom for f64x4 { #[inline(always)] - fn simd_from(value: f64, simd: S) -> Self { + fn simd_from(simd: S, value: f64) -> Self { simd.splat_f64x4(value) } } @@ -3946,7 +3946,7 @@ pub struct mask64x4 { } impl SimdFrom<[i64; 4], S> for mask64x4 { #[inline(always)] - fn simd_from(val: [i64; 4], simd: S) -> Self { + fn simd_from(simd: S, val: [i64; 4]) -> Self { simd.load_array_mask64x4(val) } } @@ -3981,7 +3981,7 @@ impl core::fmt::Debug for mask64x4 { } impl SimdFrom for mask64x4 { #[inline(always)] - fn simd_from(value: i64, simd: S) -> Self { + fn simd_from(simd: S, value: i64) -> Self { simd.splat_mask64x4(value) } } @@ -4086,7 +4086,7 @@ impl crate::SimdCombine for mask64x4 { self.simd.combine_mask64x4(self, rhs.simd_into(self.simd)) } } -#[doc = "A SIMD vector of 16 [`f32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f32x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f32x16::splat(simd, 1.0);\n let b = f32x16::simd_from(1.0, simd);\n\n // From a slice:\n let c = f32x16::from_slice(simd, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]);\n\n // From an array:\n let d = f32x16::simd_from([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0], simd);\n\n // From an element-wise function:\n let e = f32x16::from_fn(simd, |i| i as f32);\n # use fearless_simd::f32x4;\n // From `Self::Block`:\n let f = f32x16::block_splat(f32x4::simd_from([1.0, 2.0, 3.0, 4.0], simd));\n}\n```"] +#[doc = "A SIMD vector of 16 [`f32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f32x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f32x16::splat(simd, 1.0);\n let b = f32x16::simd_from(simd, 1.0);\n\n // From a slice:\n let c = f32x16::from_slice(simd, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]);\n\n // From an array:\n let d = f32x16::simd_from(simd, [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0]);\n\n // From an element-wise function:\n let e = f32x16::from_fn(simd, |i| i as f32);\n # use fearless_simd::f32x4;\n // From `Self::Block`:\n let f = f32x16::block_splat(f32x4::simd_from(simd, [1.0, 2.0, 3.0, 4.0]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct f32x16 { @@ -4095,7 +4095,7 @@ pub struct f32x16 { } impl SimdFrom<[f32; 16], S> for f32x16 { #[inline(always)] - fn simd_from(val: [f32; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [f32; 16]) -> Self { simd.load_array_f32x16(val) } } @@ -4130,7 +4130,7 @@ impl core::fmt::Debug for f32x16 { } impl SimdFrom for f32x16 { #[inline(always)] - fn simd_from(value: f32, simd: S) -> Self { + fn simd_from(simd: S, value: f32) -> Self { simd.splat_f32x16(value) } } @@ -4317,7 +4317,7 @@ impl crate::SimdSplit for f32x16 { self.simd.split_f32x16(self) } } -#[doc = "A SIMD vector of 64 [`i8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i8x64};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i8x64::splat(simd, 1);\n let b = i8x64::simd_from(1, simd);\n\n // From a slice:\n let c = i8x64::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]);\n\n // From an array:\n let d = i8x64::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64], simd);\n\n // From an element-wise function:\n let e = i8x64::from_fn(simd, |i| i as i8);\n # use fearless_simd::i8x16;\n // From `Self::Block`:\n let f = i8x64::block_splat(i8x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd));\n}\n```"] +#[doc = "A SIMD vector of 64 [`i8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i8x64};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i8x64::splat(simd, 1);\n let b = i8x64::simd_from(simd, 1);\n\n // From a slice:\n let c = i8x64::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]);\n\n // From an array:\n let d = i8x64::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]);\n\n // From an element-wise function:\n let e = i8x64::from_fn(simd, |i| i as i8);\n # use fearless_simd::i8x16;\n // From `Self::Block`:\n let f = i8x64::block_splat(i8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct i8x64 { @@ -4326,7 +4326,7 @@ pub struct i8x64 { } impl SimdFrom<[i8; 64], S> for i8x64 { #[inline(always)] - fn simd_from(val: [i8; 64], simd: S) -> Self { + fn simd_from(simd: S, val: [i8; 64]) -> Self { simd.load_array_i8x64(val) } } @@ -4356,7 +4356,7 @@ impl core::fmt::Debug for i8x64 { } impl SimdFrom for i8x64 { #[inline(always)] - fn simd_from(value: i8, simd: S) -> Self { + fn simd_from(simd: S, value: i8) -> Self { simd.splat_i8x64(value) } } @@ -4479,7 +4479,7 @@ impl crate::SimdSplit for i8x64 { self.simd.split_i8x64(self) } } -#[doc = "A SIMD vector of 64 [`u8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u8x64};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u8x64::splat(simd, 1);\n let b = u8x64::simd_from(1, simd);\n\n // From a slice:\n let c = u8x64::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]);\n\n // From an array:\n let d = u8x64::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64], simd);\n\n // From an element-wise function:\n let e = u8x64::from_fn(simd, |i| i as u8);\n # use fearless_simd::u8x16;\n // From `Self::Block`:\n let f = u8x64::block_splat(u8x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd));\n}\n```"] +#[doc = "A SIMD vector of 64 [`u8`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u8x64};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u8x64::splat(simd, 1);\n let b = u8x64::simd_from(simd, 1);\n\n // From a slice:\n let c = u8x64::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]);\n\n // From an array:\n let d = u8x64::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64]);\n\n // From an element-wise function:\n let e = u8x64::from_fn(simd, |i| i as u8);\n # use fearless_simd::u8x16;\n // From `Self::Block`:\n let f = u8x64::block_splat(u8x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct u8x64 { @@ -4488,7 +4488,7 @@ pub struct u8x64 { } impl SimdFrom<[u8; 64], S> for u8x64 { #[inline(always)] - fn simd_from(val: [u8; 64], simd: S) -> Self { + fn simd_from(simd: S, val: [u8; 64]) -> Self { simd.load_array_u8x64(val) } } @@ -4518,7 +4518,7 @@ impl core::fmt::Debug for u8x64 { } impl SimdFrom for u8x64 { #[inline(always)] - fn simd_from(value: u8, simd: S) -> Self { + fn simd_from(simd: S, value: u8) -> Self { simd.splat_u8x64(value) } } @@ -4650,7 +4650,7 @@ pub struct mask8x64 { } impl SimdFrom<[i8; 64], S> for mask8x64 { #[inline(always)] - fn simd_from(val: [i8; 64], simd: S) -> Self { + fn simd_from(simd: S, val: [i8; 64]) -> Self { simd.load_array_mask8x64(val) } } @@ -4685,7 +4685,7 @@ impl core::fmt::Debug for mask8x64 { } impl SimdFrom for mask8x64 { #[inline(always)] - fn simd_from(value: i8, simd: S) -> Self { + fn simd_from(simd: S, value: i8) -> Self { simd.splat_mask8x64(value) } } @@ -4784,7 +4784,7 @@ impl crate::SimdSplit for mask8x64 { self.simd.split_mask8x64(self) } } -#[doc = "A SIMD vector of 32 [`i16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i16x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i16x32::splat(simd, 1);\n let b = i16x32::simd_from(1, simd);\n\n // From a slice:\n let c = i16x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = i16x32::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], simd);\n\n // From an element-wise function:\n let e = i16x32::from_fn(simd, |i| i as i16);\n # use fearless_simd::i16x8;\n // From `Self::Block`:\n let f = i16x32::block_splat(i16x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd));\n}\n```"] +#[doc = "A SIMD vector of 32 [`i16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i16x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i16x32::splat(simd, 1);\n let b = i16x32::simd_from(simd, 1);\n\n // From a slice:\n let c = i16x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = i16x32::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an element-wise function:\n let e = i16x32::from_fn(simd, |i| i as i16);\n # use fearless_simd::i16x8;\n // From `Self::Block`:\n let f = i16x32::block_splat(i16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct i16x32 { @@ -4793,7 +4793,7 @@ pub struct i16x32 { } impl SimdFrom<[i16; 32], S> for i16x32 { #[inline(always)] - fn simd_from(val: [i16; 32], simd: S) -> Self { + fn simd_from(simd: S, val: [i16; 32]) -> Self { simd.load_array_i16x32(val) } } @@ -4828,7 +4828,7 @@ impl core::fmt::Debug for i16x32 { } impl SimdFrom for i16x32 { #[inline(always)] - fn simd_from(value: i16, simd: S) -> Self { + fn simd_from(simd: S, value: i16) -> Self { simd.splat_i16x32(value) } } @@ -4951,7 +4951,7 @@ impl crate::SimdSplit for i16x32 { self.simd.split_i16x32(self) } } -#[doc = "A SIMD vector of 32 [`u16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u16x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u16x32::splat(simd, 1);\n let b = u16x32::simd_from(1, simd);\n\n // From a slice:\n let c = u16x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = u16x32::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], simd);\n\n // From an element-wise function:\n let e = u16x32::from_fn(simd, |i| i as u16);\n # use fearless_simd::u16x8;\n // From `Self::Block`:\n let f = u16x32::block_splat(u16x8::simd_from([1, 2, 3, 4, 5, 6, 7, 8], simd));\n}\n```"] +#[doc = "A SIMD vector of 32 [`u16`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u16x32};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u16x32::splat(simd, 1);\n let b = u16x32::simd_from(simd, 1);\n\n // From a slice:\n let c = u16x32::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an array:\n let d = u16x32::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]);\n\n // From an element-wise function:\n let e = u16x32::from_fn(simd, |i| i as u16);\n # use fearless_simd::u16x8;\n // From `Self::Block`:\n let f = u16x32::block_splat(u16x8::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct u16x32 { @@ -4960,7 +4960,7 @@ pub struct u16x32 { } impl SimdFrom<[u16; 32], S> for u16x32 { #[inline(always)] - fn simd_from(val: [u16; 32], simd: S) -> Self { + fn simd_from(simd: S, val: [u16; 32]) -> Self { simd.load_array_u16x32(val) } } @@ -4995,7 +4995,7 @@ impl core::fmt::Debug for u16x32 { } impl SimdFrom for u16x32 { #[inline(always)] - fn simd_from(value: u16, simd: S) -> Self { + fn simd_from(simd: S, value: u16) -> Self { simd.splat_u16x32(value) } } @@ -5127,7 +5127,7 @@ pub struct mask16x32 { } impl SimdFrom<[i16; 32], S> for mask16x32 { #[inline(always)] - fn simd_from(val: [i16; 32], simd: S) -> Self { + fn simd_from(simd: S, val: [i16; 32]) -> Self { simd.load_array_mask16x32(val) } } @@ -5162,7 +5162,7 @@ impl core::fmt::Debug for mask16x32 { } impl SimdFrom for mask16x32 { #[inline(always)] - fn simd_from(value: i16, simd: S) -> Self { + fn simd_from(simd: S, value: i16) -> Self { simd.splat_mask16x32(value) } } @@ -5261,7 +5261,7 @@ impl crate::SimdSplit for mask16x32 { self.simd.split_mask16x32(self) } } -#[doc = "A SIMD vector of 16 [`i32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i32x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i32x16::splat(simd, 1);\n let b = i32x16::simd_from(1, simd);\n\n // From a slice:\n let c = i32x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = i32x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd);\n\n // From an element-wise function:\n let e = i32x16::from_fn(simd, |i| i as i32);\n # use fearless_simd::i32x4;\n // From `Self::Block`:\n let f = i32x16::block_splat(i32x4::simd_from([1, 2, 3, 4], simd));\n}\n```"] +#[doc = "A SIMD vector of 16 [`i32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, i32x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = i32x16::splat(simd, 1);\n let b = i32x16::simd_from(simd, 1);\n\n // From a slice:\n let c = i32x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = i32x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an element-wise function:\n let e = i32x16::from_fn(simd, |i| i as i32);\n # use fearless_simd::i32x4;\n // From `Self::Block`:\n let f = i32x16::block_splat(i32x4::simd_from(simd, [1, 2, 3, 4]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct i32x16 { @@ -5270,7 +5270,7 @@ pub struct i32x16 { } impl SimdFrom<[i32; 16], S> for i32x16 { #[inline(always)] - fn simd_from(val: [i32; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [i32; 16]) -> Self { simd.load_array_i32x16(val) } } @@ -5305,7 +5305,7 @@ impl core::fmt::Debug for i32x16 { } impl SimdFrom for i32x16 { #[inline(always)] - fn simd_from(value: i32, simd: S) -> Self { + fn simd_from(simd: S, value: i32) -> Self { simd.splat_i32x16(value) } } @@ -5440,7 +5440,7 @@ impl crate::SimdSplit for i32x16 { self.simd.split_i32x16(self) } } -#[doc = "A SIMD vector of 16 [`u32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u32x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u32x16::splat(simd, 1);\n let b = u32x16::simd_from(1, simd);\n\n // From a slice:\n let c = u32x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = u32x16::simd_from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], simd);\n\n // From an element-wise function:\n let e = u32x16::from_fn(simd, |i| i as u32);\n # use fearless_simd::u32x4;\n // From `Self::Block`:\n let f = u32x16::block_splat(u32x4::simd_from([1, 2, 3, 4], simd));\n}\n```"] +#[doc = "A SIMD vector of 16 [`u32`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, u32x16};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = u32x16::splat(simd, 1);\n let b = u32x16::simd_from(simd, 1);\n\n // From a slice:\n let c = u32x16::from_slice(simd, &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an array:\n let d = u32x16::simd_from(simd, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);\n\n // From an element-wise function:\n let e = u32x16::from_fn(simd, |i| i as u32);\n # use fearless_simd::u32x4;\n // From `Self::Block`:\n let f = u32x16::block_splat(u32x4::simd_from(simd, [1, 2, 3, 4]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct u32x16 { @@ -5449,7 +5449,7 @@ pub struct u32x16 { } impl SimdFrom<[u32; 16], S> for u32x16 { #[inline(always)] - fn simd_from(val: [u32; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [u32; 16]) -> Self { simd.load_array_u32x16(val) } } @@ -5484,7 +5484,7 @@ impl core::fmt::Debug for u32x16 { } impl SimdFrom for u32x16 { #[inline(always)] - fn simd_from(value: u32, simd: S) -> Self { + fn simd_from(simd: S, value: u32) -> Self { simd.splat_u32x16(value) } } @@ -5628,7 +5628,7 @@ pub struct mask32x16 { } impl SimdFrom<[i32; 16], S> for mask32x16 { #[inline(always)] - fn simd_from(val: [i32; 16], simd: S) -> Self { + fn simd_from(simd: S, val: [i32; 16]) -> Self { simd.load_array_mask32x16(val) } } @@ -5663,7 +5663,7 @@ impl core::fmt::Debug for mask32x16 { } impl SimdFrom for mask32x16 { #[inline(always)] - fn simd_from(value: i32, simd: S) -> Self { + fn simd_from(simd: S, value: i32) -> Self { simd.splat_mask32x16(value) } } @@ -5762,7 +5762,7 @@ impl crate::SimdSplit for mask32x16 { self.simd.split_mask32x16(self) } } -#[doc = "A SIMD vector of 8 [`f64`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f64x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f64x8::splat(simd, 1.0);\n let b = f64x8::simd_from(1.0, simd);\n\n // From a slice:\n let c = f64x8::from_slice(simd, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);\n\n // From an array:\n let d = f64x8::simd_from([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], simd);\n\n // From an element-wise function:\n let e = f64x8::from_fn(simd, |i| i as f64);\n # use fearless_simd::f64x2;\n // From `Self::Block`:\n let f = f64x8::block_splat(f64x2::simd_from([1.0, 2.0], simd));\n}\n```"] +#[doc = "A SIMD vector of 8 [`f64`] elements.\n\nYou may construct this vector type using the [`Self::splat`], [`Self::from_slice`], [`Self::simd_from`], [`Self::from_fn`], and [`Self::block_splat`] methods.\n\n```rust\n# use fearless_simd::{prelude::*, f64x8};\nfn construct_simd(simd: S) {\n // From a single scalar value:\n let a = f64x8::splat(simd, 1.0);\n let b = f64x8::simd_from(simd, 1.0);\n\n // From a slice:\n let c = f64x8::from_slice(simd, &[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);\n\n // From an array:\n let d = f64x8::simd_from(simd, [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]);\n\n // From an element-wise function:\n let e = f64x8::from_fn(simd, |i| i as f64);\n # use fearless_simd::f64x2;\n // From `Self::Block`:\n let f = f64x8::block_splat(f64x2::simd_from(simd, [1.0, 2.0]));\n}\n```"] #[derive(Clone, Copy)] #[repr(C, align(64))] pub struct f64x8 { @@ -5771,7 +5771,7 @@ pub struct f64x8 { } impl SimdFrom<[f64; 8], S> for f64x8 { #[inline(always)] - fn simd_from(val: [f64; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [f64; 8]) -> Self { simd.load_array_f64x8(val) } } @@ -5801,7 +5801,7 @@ impl core::fmt::Debug for f64x8 { } impl SimdFrom for f64x8 { #[inline(always)] - fn simd_from(value: f64, simd: S) -> Self { + fn simd_from(simd: S, value: f64) -> Self { simd.splat_f64x8(value) } } @@ -5983,7 +5983,7 @@ pub struct mask64x8 { } impl SimdFrom<[i64; 8], S> for mask64x8 { #[inline(always)] - fn simd_from(val: [i64; 8], simd: S) -> Self { + fn simd_from(simd: S, val: [i64; 8]) -> Self { simd.load_array_mask64x8(val) } } @@ -6018,7 +6018,7 @@ impl core::fmt::Debug for mask64x8 { } impl SimdFrom for mask64x8 { #[inline(always)] - fn simd_from(value: i64, simd: S) -> Self { + fn simd_from(simd: S, value: i64) -> Self { simd.splat_mask64x8(value) } } diff --git a/fearless_simd/src/generated/sse4_2.rs b/fearless_simd/src/generated/sse4_2.rs index 8f0ebda3..58843ad5 100644 --- a/fearless_simd/src/generated/sse4_2.rs +++ b/fearless_simd/src/generated/sse4_2.rs @@ -7351,7 +7351,7 @@ impl Simd for Sse4_2 { } impl SimdFrom<__m128, S> for f32x4 { #[inline(always)] - fn simd_from(arch: __m128, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7366,7 +7366,7 @@ impl From> for __m128 { } impl SimdFrom<__m128i, S> for i8x16 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7381,7 +7381,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for u8x16 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7396,7 +7396,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for mask8x16 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7411,7 +7411,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for i16x8 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7426,7 +7426,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for u16x8 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7441,7 +7441,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for mask16x8 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7456,7 +7456,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for i32x4 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7471,7 +7471,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for u32x4 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7486,7 +7486,7 @@ impl From> for __m128i { } impl SimdFrom<__m128i, S> for mask32x4 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7501,7 +7501,7 @@ impl From> for __m128i { } impl SimdFrom<__m128d, S> for f64x2 { #[inline(always)] - fn simd_from(arch: __m128d, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128d) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7516,7 +7516,7 @@ impl From> for __m128d { } impl SimdFrom<__m128i, S> for mask64x2 { #[inline(always)] - fn simd_from(arch: __m128i, simd: S) -> Self { + fn simd_from(simd: S, arch: __m128i) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, diff --git a/fearless_simd/src/generated/wasm.rs b/fearless_simd/src/generated/wasm.rs index b8550602..2c76d0fc 100644 --- a/fearless_simd/src/generated/wasm.rs +++ b/fearless_simd/src/generated/wasm.rs @@ -7291,7 +7291,7 @@ impl Simd for WasmSimd128 { } impl SimdFrom for f32x4 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7306,7 +7306,7 @@ impl From> for v128 { } impl SimdFrom for i8x16 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7321,7 +7321,7 @@ impl From> for v128 { } impl SimdFrom for u8x16 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7336,7 +7336,7 @@ impl From> for v128 { } impl SimdFrom for mask8x16 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7351,7 +7351,7 @@ impl From> for v128 { } impl SimdFrom for i16x8 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7366,7 +7366,7 @@ impl From> for v128 { } impl SimdFrom for u16x8 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7381,7 +7381,7 @@ impl From> for v128 { } impl SimdFrom for mask16x8 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7396,7 +7396,7 @@ impl From> for v128 { } impl SimdFrom for i32x4 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7411,7 +7411,7 @@ impl From> for v128 { } impl SimdFrom for u32x4 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7426,7 +7426,7 @@ impl From> for v128 { } impl SimdFrom for mask32x4 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7441,7 +7441,7 @@ impl From> for v128 { } impl SimdFrom for f64x2 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, @@ -7456,7 +7456,7 @@ impl From> for v128 { } impl SimdFrom for mask64x2 { #[inline(always)] - fn simd_from(arch: v128, simd: S) -> Self { + fn simd_from(simd: S, arch: v128) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd, diff --git a/fearless_simd/src/traits.rs b/fearless_simd/src/traits.rs index 28474edf..76e7039f 100644 --- a/fearless_simd/src/traits.rs +++ b/fearless_simd/src/traits.rs @@ -66,7 +66,7 @@ pub(crate) mod seal { /// /// The [`SimdInto`] trait is also provided for convenience. pub trait SimdFrom { - fn simd_from(value: T, simd: S) -> Self; + fn simd_from(simd: S, value: T) -> Self; } /// Value conversion, adding a SIMD blessing. @@ -82,12 +82,12 @@ pub trait SimdInto { impl, S: Simd> SimdInto for F { fn simd_into(self, simd: S) -> T { - SimdFrom::simd_from(self, simd) + SimdFrom::simd_from(simd, self) } } impl SimdFrom for T { - fn simd_from(value: T, _simd: S) -> Self { + fn simd_from(_simd: S, value: T) -> Self { value } } diff --git a/fearless_simd_gen/src/level.rs b/fearless_simd_gen/src/level.rs index e867e448..7043a578 100644 --- a/fearless_simd_gen/src/level.rs +++ b/fearless_simd_gen/src/level.rs @@ -178,7 +178,7 @@ pub(crate) trait Level { result.push(quote! { impl SimdFrom<#arch, S> for #simd { #[inline(always)] - fn simd_from(arch: #arch, simd: S) -> Self { + fn simd_from(simd: S, arch: #arch) -> Self { Self { val: unsafe { core::mem::transmute_copy(&arch) }, simd diff --git a/fearless_simd_gen/src/mk_simd_types.rs b/fearless_simd_gen/src/mk_simd_types.rs index ed0e9fac..a1be080d 100644 --- a/fearless_simd_gen/src/mk_simd_types.rs +++ b/fearless_simd_gen/src/mk_simd_types.rs @@ -40,7 +40,7 @@ pub(crate) fn mk_simd_types() -> TokenStream { quote! { impl SimdFrom<#rust_scalar, S> for #name { #[inline(always)] - fn simd_from(value: #rust_scalar, simd: S) -> Self { + fn simd_from(simd: S, value: #rust_scalar) -> Self { simd.#splat(value) } } @@ -172,7 +172,7 @@ pub(crate) fn mk_simd_types() -> TokenStream { impl SimdFrom<[#rust_scalar; #len], S> for #name { #[inline(always)] - fn simd_from(val: [#rust_scalar; #len], simd: S) -> Self { + fn simd_from(simd: S, val: [#rust_scalar; #len]) -> Self { simd.#from_array_op(val) } } diff --git a/fearless_simd_gen/src/types.rs b/fearless_simd_gen/src/types.rs index 0f12c8b9..6467206f 100644 --- a/fearless_simd_gen/src/types.rs +++ b/fearless_simd_gen/src/types.rs @@ -212,7 +212,7 @@ impl VecType { " # use fearless_simd::{block_name}; // From `Self::Block`: - let f = {rust_name}::block_splat({block_name}::simd_from([{block_example}], simd));" + let f = {rust_name}::block_splat({block_name}::simd_from(simd, [{block_example}]));" ) } else { String::new() @@ -226,13 +226,13 @@ impl VecType { fn construct_simd(simd: S) {{ // From a single scalar value: let a = {rust_name}::splat(simd, {splat_example}); - let b = {rust_name}::simd_from({splat_example}, simd); + let b = {rust_name}::simd_from(simd, {splat_example}); // From a slice: let c = {rust_name}::from_slice(simd, &[{many_example}]); // From an array: - let d = {rust_name}::simd_from([{many_example}], simd); + let d = {rust_name}::simd_from(simd, [{many_example}]); // From an element-wise function: let e = {rust_name}::from_fn(simd, |i| i as {scalar_name});\ From ee2f4e85fac18198b981627c6254070105f25d0a Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sat, 20 Dec 2025 05:20:58 -0500 Subject: [PATCH 2/2] Add to changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca97198..6567c727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,7 +65,8 @@ This release has an [MSRV][] of 1.88. ([#158][] by [@Shnatsel][]) - Breaking change: the `val` field on SIMD vector types is now private, and vector types are no longer represented as arrays internally. To access a vector type's elements, you can use the `Into` or `Deref` traits to obtain an array, or the `as_slice`/`as_mut_slice` methods to obtain a slice. ([#159][] by [@valadaptive][]) - Breaking change: the `Element` type on the `SimdBase` trait is now an associated type instead of a type parameter. This should make it more pleasant to write code that's generic over different vector types. ([#170][] by [@valadaptive][]) -= The `WasmSimd128` token type now wraps the new `crate::core_arch::wasm32::WasmSimd128` type. This doesn't expose any new functionality as WASM SIMD128 can only be enabled statically, but matches all the other backend tokens. ([#176][] by [@valadaptive][]) +- The `WasmSimd128` token type now wraps the new `crate::core_arch::wasm32::WasmSimd128` type. This doesn't expose any new functionality as WASM SIMD128 can only be enabled statically, but matches all the other backend tokens. ([#176][] by [@valadaptive][]) +- Breaking change: the `SimdFrom::simd_from` method now takes the SIMD token as the first argument instead of the second. This matches the argument order of the `from_slice`, `splat`, and `from_fn` methods on `SimdBase`. ([#180][] by [@valadaptive][]) ### Removed @@ -164,6 +165,7 @@ No changelog was kept for this release. [#168]: https://github.com/linebender/fearless_simd/pull/168 [#170]: https://github.com/linebender/fearless_simd/pull/170 [#176]: https://github.com/linebender/fearless_simd/pull/176 +[#180]: https://github.com/linebender/fearless_simd/pull/180 [Unreleased]: https://github.com/linebender/fearless_simd/compare/v0.3.0...HEAD [0.3.0]: https://github.com/linebender/fearless_simd/compare/v0.3.0...v0.2.0