features:
- ""
- "--features std"
- - "--features const_evaluatable_checked"
- - "--features std --features const_evaluatable_checked"
+ - "--features generic_const_exprs"
+ - "--features std --features generic_const_exprs"
steps:
- uses: actions/checkout@v2
license = "MIT OR Apache-2.0"
[features]
-default = ["std", "const_evaluatable_checked"]
+default = ["std", "generic_const_exprs"]
std = []
-const_evaluatable_checked = []
+generic_const_exprs = []
[target.'cfg(target_arch = "wasm32")'.dev-dependencies.wasm-bindgen]
version = "0.2"
-#![no_std]
+#![cfg_attr(not(feature = "std"), no_std)]
#![allow(incomplete_features)]
#![feature(
- const_evaluatable_checked,
+ adt_const_params,
const_fn_trait_bound,
- const_generics,
platform_intrinsics,
repr_simd,
simd_ffi,
staged_api,
stdsimd
)]
+#![cfg_attr(feature = "generic_const_exprs", feature(generic_const_exprs))]
#![warn(missing_docs)]
#![unstable(feature = "portable_simd", issue = "86656")]
//! Portable SIMD module.
mod select;
pub use select::Select;
-#[cfg(feature = "const_evaluatable_checked")]
+#[cfg(feature = "generic_const_exprs")]
mod to_bytes;
mod comparisons;
}
/// Convert this mask to a bitmask, with one bit set per lane.
+ #[cfg(feature = "generic_const_exprs")]
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
self.0.to_bitmask()
}
/// Convert a bitmask to a mask.
+ #[cfg(feature = "generic_const_exprs")]
pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
Self(mask_impl::Mask::from_bitmask(bitmask))
}
Self(core::mem::transmute_copy(&mask), PhantomData)
}
+ #[cfg(feature = "generic_const_exprs")]
#[inline]
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
// Safety: these are the same type and we are laundering the generic
unsafe { core::mem::transmute_copy(&self.0) }
}
+ #[cfg(feature = "generic_const_exprs")]
#[inline]
pub fn from_bitmask(bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
// Safety: these are the same type and we are laundering the generic
unsafe { Mask(crate::intrinsics::simd_cast(self.0)) }
}
+ #[cfg(feature = "generic_const_exprs")]
#[inline]
pub fn to_bitmask(self) -> [u8; LaneCount::<LANES>::BITMASK_LEN] {
unsafe {
}
}
+ #[cfg(feature = "generic_const_exprs")]
#[inline]
pub fn from_bitmask(mut bitmask: [u8; LaneCount::<LANES>::BITMASK_LEN]) -> Self {
unsafe {
assert_eq!(core_simd::Mask::<$type, 8>::from_int(int), mask);
}
+ #[cfg(feature = "generic_const_exprs")]
#[test]
fn roundtrip_bitmask_conversion() {
let values = [
-#![feature(portable_simd, const_generics, const_evaluatable_checked)]
+#![feature(portable_simd, generic_const_exprs, adt_const_params)]
#![allow(incomplete_features)]
-#![cfg(feature = "const_evaluatable_checked")]
+#![cfg(feature = "generic_const_exprs")]
use core_simd::Simd;