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_generics,
6
5
platform_intrinsics,
7
6
repr_simd,
8
7
simd_ffi,
9
8
staged_api,
10
9
stdsimd
11
10
) ]
11
+ #![ cfg_attr(
12
+ feature = "const_evaluatable_checked" ,
13
+ feature( const_evaluatable_checked)
14
+ ) ]
12
15
#![ warn( missing_docs) ]
13
16
#![ unstable( feature = "portable_simd" , issue = "86656" ) ]
14
17
//! Portable SIMD module.
Original file line number Diff line number Diff line change @@ -160,11 +160,13 @@ macro_rules! define_opaque_mask {
160
160
}
161
161
162
162
/// Convert this mask to a bitmask, with one bit set per lane.
163
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
163
164
pub fn to_bitmask( self ) -> [ u8 ; crate :: LaneCount :: <LANES >:: BITMASK_LEN ] {
164
165
self . 0 . to_bitmask( )
165
166
}
166
167
167
168
/// Convert a bitmask to a mask.
169
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
168
170
pub fn from_bitmask( bitmask: [ u8 ; crate :: LaneCount :: <LANES >:: BITMASK_LEN ] ) -> Self {
169
171
Self ( <$inner_ty>:: from_bitmask( bitmask) )
170
172
}
Original file line number Diff line number Diff line change @@ -127,12 +127,14 @@ where
127
127
Self ( core:: mem:: transmute_copy ( & mask) )
128
128
}
129
129
130
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
130
131
#[ inline]
131
132
pub fn to_bitmask ( self ) -> [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] {
132
133
// Safety: these are the same type and we are laundering the generic
133
134
unsafe { core:: mem:: transmute_copy ( & self . 0 ) }
134
135
}
135
136
137
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
136
138
#[ inline]
137
139
pub fn from_bitmask ( bitmask : [ u8 ; LaneCount :: < LANES > :: BITMASK_LEN ] ) -> Self {
138
140
// Safety: these are the same type and we are laundering the generic
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ macro_rules! define_mask {
102
102
Self ( value)
103
103
}
104
104
105
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
105
106
#[ inline]
106
107
pub fn to_bitmask( self ) -> [ u8 ; crate :: LaneCount :: <LANES >:: BITMASK_LEN ] {
107
108
unsafe {
@@ -126,6 +127,7 @@ macro_rules! define_mask {
126
127
}
127
128
}
128
129
130
+ #[ cfg( feature = "const_evaluatable_checked" ) ]
129
131
#[ inline]
130
132
pub fn from_bitmask( mut bitmask: [ u8 ; crate :: LaneCount :: <LANES >:: BITMASK_LEN ] ) -> Self {
131
133
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:: $name:: <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