#[allow(deprecated)]
use crate::tokens::Has128BitSimd;
use crate::tokens::SimdToken;
#[derive(Clone, Copy, Debug)]
pub struct Wasm128Token {
_private: (),
}
impl crate::tokens::Sealed for Wasm128Token {}
impl SimdToken for Wasm128Token {
const NAME: &'static str = "WASM SIMD128";
const TARGET_FEATURES: &'static str = "simd128";
const ENABLE_TARGET_FEATURES: &'static str = "-Ctarget-feature=+simd128";
const DISABLE_TARGET_FEATURES: &'static str = "-Ctarget-feature=-simd128";
#[inline]
fn compiled_with() -> Option<bool> {
Some(false) }
#[inline]
fn summon() -> Option<Self> {
None }
}
#[cfg(feature = "forge-token-api")]
impl Wasm128Token {
#[deprecated(
since = "0.5.0",
note = "Pass tokens through from summon() instead of forging"
)]
#[inline(always)]
pub unsafe fn forge_token_dangerously() -> Self {
Self { _private: () }
}
}
impl Wasm128Token {
pub fn dangerously_disable_token_process_wide(
_disabled: bool,
) -> Result<(), crate::tokens::CompileTimeGuaranteedError> {
Err(crate::tokens::CompileTimeGuaranteedError {
token_name: Self::NAME,
target_features: Self::TARGET_FEATURES,
disable_flags: Self::DISABLE_TARGET_FEATURES,
})
}
pub fn manually_disabled() -> Result<bool, crate::tokens::CompileTimeGuaranteedError> {
Err(crate::tokens::CompileTimeGuaranteedError {
token_name: Self::NAME,
target_features: Self::TARGET_FEATURES,
disable_flags: Self::DISABLE_TARGET_FEATURES,
})
}
}
#[derive(Clone, Copy, Debug)]
pub struct Wasm128RelaxedToken {
_private: (),
}
impl crate::tokens::Sealed for Wasm128RelaxedToken {}
impl SimdToken for Wasm128RelaxedToken {
const NAME: &'static str = "WASM Relaxed SIMD";
const TARGET_FEATURES: &'static str = "simd128,relaxed-simd";
const ENABLE_TARGET_FEATURES: &'static str = "-Ctarget-feature=+simd128,+relaxed-simd";
const DISABLE_TARGET_FEATURES: &'static str = "-Ctarget-feature=-simd128,-relaxed-simd";
#[inline]
fn compiled_with() -> Option<bool> {
Some(false) }
#[inline]
fn summon() -> Option<Self> {
None }
}
#[cfg(feature = "forge-token-api")]
impl Wasm128RelaxedToken {
#[deprecated(
since = "0.5.0",
note = "Pass tokens through from summon() instead of forging"
)]
#[inline(always)]
pub unsafe fn forge_token_dangerously() -> Self {
Self { _private: () }
}
}
impl Wasm128RelaxedToken {
pub fn dangerously_disable_token_process_wide(
_disabled: bool,
) -> Result<(), crate::tokens::CompileTimeGuaranteedError> {
Err(crate::tokens::CompileTimeGuaranteedError {
token_name: Self::NAME,
target_features: Self::TARGET_FEATURES,
disable_flags: Self::DISABLE_TARGET_FEATURES,
})
}
pub fn manually_disabled() -> Result<bool, crate::tokens::CompileTimeGuaranteedError> {
Err(crate::tokens::CompileTimeGuaranteedError {
token_name: Self::NAME,
target_features: Self::TARGET_FEATURES,
disable_flags: Self::DISABLE_TARGET_FEATURES,
})
}
}
#[allow(deprecated)]
impl Has128BitSimd for Wasm128Token {}
#[allow(deprecated)]
impl Has128BitSimd for Wasm128RelaxedToken {}