#[doc(hidden)]
#[macro_export]
#[cfg(nightly_simd)]
macro_rules! __lane_dispatch {
(plain: $s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _plain>]($($a)*) }};
(no_wide: $s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _simd>]($($a)*) }};
($s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _simd>]($($a)*) }};
}
#[doc(hidden)]
#[macro_export]
#[cfg(not(nightly_simd))]
#[cfg(feature = "dep_wide")]
macro_rules! __lane_dispatch {
(plain: $s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _plain>]($($a)*) }};
(no_wide: $s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _plain>]($($a)*) }};
($s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _wide>]($($a)*) }};
}
#[doc(hidden)]
#[macro_export]
#[cfg(not(nightly_simd))]
#[cfg(not(feature = "dep_wide"))]
macro_rules! __lane_dispatch {
(plain: $s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _plain>]($($a)*) }};
(no_wide: $s:ident, $fn:ident($($a:tt)*)) => { $crate::paste! { $s.[<$fn _plain>]($($a)*) }};
($s:ident, $fn:ident ($($a:tt)*)) => { $crate::paste! { $s.[<$fn _plain>]($($a)*) }};
}
#[doc(hidden)]
pub use __lane_dispatch;
#[doc(hidden)]
#[macro_export]
#[rustfmt::skip]
macro_rules! __simd_use {
($t:ty, $L:literal) => {
type Simd = ::core::simd::Simd<$t, $L>;
#[allow(unused_imports)]
use core::simd::{
cmp::{SimdOrd, SimdPartialEq, SimdPartialOrd},
num::{SimdFloat, SimdInt, SimdUint},
ptr::{SimdConstPtr, SimdMutPtr},
};
};
}
#[doc(hidden)]
pub use __simd_use as _simd_use;
#[doc(hidden)]
#[macro_export]
#[cfg(not(feature = "dep_wide"))]
macro_rules! _dep_wide_compile {
($($tt:tt)*) => {};
}
#[doc(hidden)]
#[macro_export]
#[cfg(feature = "dep_wide")]
macro_rules! _dep_wide_compile {
( // add, sub, mul, neg, sum, min, max, clap
for ALL_OR_ELSE $t:ty, $L:literal;
$(#[$attr:meta])*
$vis:vis fn $name:ident ( $($args:tt)* ) $( -> $ret:ty )? $body:block
else $fallback_body:block
) => {
$(#[$attr])*
#[$crate::compile(any(
all(same($L, 2), any(
same($t, f64), same($t, i64), same($t, u64) )),
all(same($L, 4), any(
same($t, f32), same($t, f64), same($t, i32), same($t, u32), same($t, i64), same($t, u64) )),
all(same($L, 8), any(
same($t, f32), same($t, f64), same($t, i16), same($t, u16), same($t, i32), same($t, u32), same($t, i64), same($t, u64) )),
all(same($L, 16), any(
same($t, f32), same($t, i8), same($t, u8), same($t, i16), same($t, u16), same($t, i32), same($t, u32) )),
all(same($L, 32), any(
same($t, i8), same($t, u8), same($t, i16), same($t, u16) ))
))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $body
$(#[$attr])*
#[$crate::compile(not(any( // negation of the above
all(same($L, 2), any(
same($t, f64), same($t, i64), same($t, u64) )),
all(same($L, 4), any(
same($t, f32), same($t, f64), same($t, i32), same($t, u32), same($t, i64), same($t, u64) )),
all(same($L, 8), any(
same($t, f32), same($t, f64), same($t, i16), same($t, u16), same($t, i32), same($t, u32), same($t, i64), same($t, u64) )),
all(same($L, 16), any(
same($t, f32), same($t, i8), same($t, u8), same($t, i16), same($t, u16), same($t, i32), same($t, u32) )),
all(same($L, 32), any(
same($t, i8), same($t, u8), same($t, i16), same($t, u16) ))
)))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $fallback_body
};
( for FLOAT $t:ty, $L:literal;
$(#[$attr:meta])*
$vis:vis fn $name:ident ( $($args:tt)* ) $( -> $ret:ty )? $body:block
) => {
$(#[$attr])*
#[$crate::compile(any(
all(same($L, 2), same($t, f64)),
all(same($L, 4), any(same($t, f32), same($t, f64))),
all(same($L, 8), any(same($t, f32), same($t, f64))),
all(same($L, 16), same($t, f32)),
))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $body
};
( for INT_OR_ELSE $t:ty, $L:literal;
$(#[$attr:meta])*
$vis:vis fn $name:ident ( $($args:tt)* ) $( -> $ret:ty )? $body:block
else $fallback_body:block
) => {
$(#[$attr])*
#[$crate::compile(any(
all(same($L, 2), any(
same($t, i64), same($t, u64) // iu32
)),
all(same($L, 4), any(
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 8), any(
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 16), any(
same($t, i8), same($t, u8), // iu8
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32) // iu32
)),
all(same($L, 32), any(
same($t, i8), same($t, u8), // iu8
same($t, i16), same($t, u16) // iu16
))
))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $body
$(#[$attr])*
#[$crate::compile(not(any( // negation of the above
all(same($L, 2), any(
same($t, i64), same($t, u64) // iu32
)),
all(same($L, 4), any(
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 8), any(
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 16), any(
same($t, i8), same($t, u8), // iu8
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32) // iu32
)),
all(same($L, 32), any(
same($t, i8), same($t, u8), // iu8
same($t, i16), same($t, u16) // iu16
))
)))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $fallback_body
};
( for SHIFT_OR_ELSE $t:ty, $L:literal;
$(#[$attr:meta])*
$vis:vis fn $name:ident ( $($args:tt)* ) $( -> $ret:ty )? $body:block
else $fallback_body:block
) => {
$(#[$attr])*
#[$crate::compile(any(
all(same($L, 2), any(
same($t, i64), same($t, u64) // iu32
)),
all(same($L, 4), any(
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 8), any(
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 16), any(
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32) // iu32
)),
all(same($L, 32), any(
same($t, i16), same($t, u16) // iu16
))
))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $body
$(#[$attr])*
#[$crate::compile(not(any( // negation of the above
all(same($L, 2), any(
same($t, i64), same($t, u64) // iu32
)),
all(same($L, 4), any(
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 8), any(
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32), // iu32
same($t, i64), same($t, u64) // iu64
)),
all(same($L, 16), any(
same($t, i16), same($t, u16), // iu16
same($t, i32), same($t, u32) // iu32
)),
all(same($L, 32), any(
same($t, i16), same($t, u16) // iu16
))
)))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "dep_wide")))]
$vis fn $name( $($args)* ) $( -> $ret )? $fallback_body
}
}
#[doc(hidden)]
pub use _dep_wide_compile;
#[doc(hidden)]
#[macro_export]
macro_rules! _dep_wide_use {
($t:ty, $L:literal) => {
#[$crate::compile(all(same($t, f64), same($L, 2)))]
use $crate::_dep::wide::f64x2 as Wide;
#[$crate::compile(all(same($t, i64), same($L, 2)))]
use $crate::_dep::wide::i64x2 as Wide;
#[$crate::compile(all(same($t, u64), same($L, 2)))]
use $crate::_dep::wide::u64x2 as Wide;
#[$crate::compile(all(same($t, f32), same($L, 4)))]
use $crate::_dep::wide::f32x4 as Wide;
#[$crate::compile(all(same($t, f64), same($L, 4)))]
use $crate::_dep::wide::f64x4 as Wide;
#[$crate::compile(all(same($t, i32), same($L, 4)))]
use $crate::_dep::wide::i32x4 as Wide;
#[$crate::compile(all(same($t, i64), same($L, 4)))]
use $crate::_dep::wide::i64x4 as Wide;
#[$crate::compile(all(same($t, u32), same($L, 4)))]
use $crate::_dep::wide::u32x4 as Wide;
#[$crate::compile(all(same($t, u64), same($L, 4)))]
use $crate::_dep::wide::u64x4 as Wide;
#[$crate::compile(all(same($t, f32), same($L, 8)))]
use $crate::_dep::wide::f32x8 as Wide;
#[$crate::compile(all(same($t, f64), same($L, 8)))]
use $crate::_dep::wide::f64x8 as Wide;
#[$crate::compile(all(same($t, i16), same($L, 8)))]
use $crate::_dep::wide::i16x8 as Wide;
#[$crate::compile(all(same($t, i32), same($L, 8)))]
use $crate::_dep::wide::i32x8 as Wide;
#[$crate::compile(all(same($t, i64), same($L, 8)))]
use $crate::_dep::wide::i64x8 as Wide;
#[$crate::compile(all(same($t, u16), same($L, 8)))]
use $crate::_dep::wide::u16x8 as Wide;
#[$crate::compile(all(same($t, u32), same($L, 8)))]
use $crate::_dep::wide::u32x8 as Wide;
#[$crate::compile(all(same($t, u64), same($L, 8)))]
use $crate::_dep::wide::u64x8 as Wide;
#[$crate::compile(all(same($t, f32), same($L, 16)))]
use $crate::_dep::wide::f32x16 as Wide;
#[$crate::compile(all(same($t, i8), same($L, 16)))]
use $crate::_dep::wide::i8x16 as Wide;
#[$crate::compile(all(same($t, i16), same($L, 16)))]
use $crate::_dep::wide::i16x16 as Wide;
#[$crate::compile(all(same($t, i32), same($L, 16)))]
use $crate::_dep::wide::i32x16 as Wide;
#[$crate::compile(all(same($t, u8), same($L, 16)))]
use $crate::_dep::wide::u8x16 as Wide;
#[$crate::compile(all(same($t, u16), same($L, 16)))]
use $crate::_dep::wide::u16x16 as Wide;
#[$crate::compile(all(same($t, u32), same($L, 16)))]
use $crate::_dep::wide::u32x16 as Wide;
#[$crate::compile(all(same($t, i8), same($L, 32)))]
use $crate::_dep::wide::i8x32 as Wide;
#[$crate::compile(all(same($t, i16), same($L, 32)))]
use $crate::_dep::wide::i16x32 as Wide;
#[$crate::compile(all(same($t, u8), same($L, 32)))]
use $crate::_dep::wide::u8x32 as Wide;
#[$crate::compile(all(same($t, u16), same($L, 32)))]
use $crate::_dep::wide::u16x32 as Wide;
#[allow(unused_imports)]
use $crate::_dep::wide::{
AlignTo as WideAlignTo, CmpEq as WideCmpEq, CmpGe as WideCmpGe, CmpGt as WideCmpGt,
CmpLe as WideCmpLe, CmpLt as WideCmpLt, CmpNe as WideCmpNe,
};
};
}
#[doc(hidden)]
pub use _dep_wide_use;