File tree 5 files changed +12
-2
lines changed 5 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
- #![ no_std]
1
+ #![ cfg_attr ( not ( feature = "std" ) , no_std) ]
2
2
#![ allow( incomplete_features) ]
3
3
#![ feature(
4
- const_evaluatable_checked,
5
4
const_fn_trait_bound,
6
5
const_generics,
7
6
platform_intrinsics,
10
9
staged_api,
11
10
stdsimd
12
11
) ]
12
+ #![ cfg_attr(
13
+ feature = "const_evaluatable_checked" ,
14
+ feature( const_evaluatable_checked)
15
+ ) ]
13
16
#![ warn( missing_docs) ]
14
17
#![ unstable( feature = "portable_simd" , issue = "86656" ) ]
15
18
//! Portable SIMD module.
Original file line number Diff line number Diff line change @@ -178,11 +178,13 @@ where
178
178
}
179
179
180
180
/// Convert this mask to a bitmask, with one bit set per lane.
181
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
181
182
pub fn to_bitmask ( self ) -> [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] {
182
183
self . 0 . to_bitmask ( )
183
184
}
184
185
185
186
/// Convert a bitmask to a mask.
187
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
186
188
pub fn from_bitmask ( bitmask : [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] ) -> Self {
187
189
Self ( mask_impl:: Mask :: from_bitmask ( bitmask) )
188
190
}
Original file line number Diff line number Diff line change @@ -119,12 +119,14 @@ where
119
119
Self ( core:: mem:: transmute_copy ( & mask) , PhantomData )
120
120
}
121
121
122
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
122
123
#[ inline]
123
124
pub fn to_bitmask ( self ) -> [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] {
124
125
// Safety: these are the same type and we are laundering the generic
125
126
unsafe { core:: mem:: transmute_copy ( & self . 0 ) }
126
127
}
127
128
129
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
128
130
#[ inline]
129
131
pub fn from_bitmask ( bitmask : [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] ) -> Self {
130
132
// Safety: these are the same type and we are laundering the generic
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ where
101
101
unsafe { Mask ( crate :: intrinsics:: simd_cast ( self . 0 ) ) }
102
102
}
103
103
104
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
104
105
#[ inline]
105
106
pub fn to_bitmask ( self ) -> [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] {
106
107
unsafe {
@@ -127,6 +128,7 @@ where
127
128
}
128
129
}
129
130
131
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
130
132
#[ inline]
131
133
pub fn from_bitmask ( mut bitmask : [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] ) -> Self {
132
134
unsafe {
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ macro_rules! test_mask_api {
68
68
assert_eq!( core_simd:: Mask :: <$type, 8 >:: from_int( int) , mask) ;
69
69
}
70
70
71
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
71
72
#[ test]
72
73
fn roundtrip_bitmask_conversion( ) {
73
74
let values = [
You can’t perform that action at this time.
0 commit comments