1
1
//! Masks that take up full SIMD vector registers.
2
2
3
- use crate :: simd:: intrinsics;
4
3
use crate :: simd:: { LaneCount , MaskElement , Simd , SupportedLaneCount } ;
5
4
6
5
#[ repr( transparent) ]
@@ -138,7 +137,7 @@ where
138
137
U : MaskElement ,
139
138
{
140
139
// Safety: masks are simply integer vectors of 0 and -1, and we can cast the element type.
141
- unsafe { Mask ( intrinsics:: simd_cast ( self . 0 ) ) }
140
+ unsafe { Mask ( core :: intrinsics:: simd :: simd_cast ( self . 0 ) ) }
142
141
}
143
142
144
143
#[ inline]
@@ -150,7 +149,7 @@ where
150
149
unsafe {
151
150
// Compute the bitmask
152
151
let mut bytes: <LaneCount < N > as SupportedLaneCount >:: BitMask =
153
- intrinsics:: simd_bitmask ( self . 0 ) ;
152
+ core :: intrinsics:: simd :: simd_bitmask ( self . 0 ) ;
154
153
155
154
// LLVM assumes bit order should match endianness
156
155
if cfg ! ( target_endian = "big" ) {
@@ -183,7 +182,7 @@ where
183
182
}
184
183
185
184
// Compute the regular mask
186
- Self :: from_int_unchecked ( intrinsics:: simd_select_bitmask (
185
+ Self :: from_int_unchecked ( core :: intrinsics:: simd :: simd_select_bitmask (
187
186
bytes,
188
187
Self :: splat ( true ) . to_int ( ) ,
189
188
Self :: splat ( false ) . to_int ( ) ,
@@ -199,7 +198,7 @@ where
199
198
let resized = self . to_int ( ) . resize :: < M > ( T :: FALSE ) ;
200
199
201
200
// Safety: `resized` is an integer vector with length M, which must match T
202
- let bitmask: U = unsafe { intrinsics:: simd_bitmask ( resized) } ;
201
+ let bitmask: U = unsafe { core :: intrinsics:: simd :: simd_bitmask ( resized) } ;
203
202
204
203
// LLVM assumes bit order should match endianness
205
204
if cfg ! ( target_endian = "big" ) {
@@ -223,7 +222,7 @@ where
223
222
224
223
// SAFETY: `mask` is the correct bitmask type for a u64 bitmask
225
224
let mask: Simd < T , M > = unsafe {
226
- intrinsics:: simd_select_bitmask (
225
+ core :: intrinsics:: simd :: simd_select_bitmask (
227
226
bitmask,
228
227
Simd :: < T , M > :: splat ( T :: TRUE ) ,
229
228
Simd :: < T , M > :: splat ( T :: FALSE ) ,
@@ -274,14 +273,14 @@ where
274
273
#[ must_use = "method returns a new bool and does not mutate the original value" ]
275
274
pub fn any ( self ) -> bool {
276
275
// Safety: use `self` as an integer vector
277
- unsafe { intrinsics:: simd_reduce_any ( self . to_int ( ) ) }
276
+ unsafe { core :: intrinsics:: simd :: simd_reduce_any ( self . to_int ( ) ) }
278
277
}
279
278
280
279
#[ inline]
281
280
#[ must_use = "method returns a new vector and does not mutate the original value" ]
282
281
pub fn all ( self ) -> bool {
283
282
// Safety: use `self` as an integer vector
284
- unsafe { intrinsics:: simd_reduce_all ( self . to_int ( ) ) }
283
+ unsafe { core :: intrinsics:: simd :: simd_reduce_all ( self . to_int ( ) ) }
285
284
}
286
285
}
287
286
@@ -306,7 +305,7 @@ where
306
305
#[ must_use = "method returns a new mask and does not mutate the original value" ]
307
306
fn bitand ( self , rhs : Self ) -> Self {
308
307
// Safety: `self` is an integer vector
309
- unsafe { Self ( intrinsics:: simd_and ( self . 0 , rhs. 0 ) ) }
308
+ unsafe { Self ( core :: intrinsics:: simd :: simd_and ( self . 0 , rhs. 0 ) ) }
310
309
}
311
310
}
312
311
@@ -320,7 +319,7 @@ where
320
319
#[ must_use = "method returns a new mask and does not mutate the original value" ]
321
320
fn bitor ( self , rhs : Self ) -> Self {
322
321
// Safety: `self` is an integer vector
323
- unsafe { Self ( intrinsics:: simd_or ( self . 0 , rhs. 0 ) ) }
322
+ unsafe { Self ( core :: intrinsics:: simd :: simd_or ( self . 0 , rhs. 0 ) ) }
324
323
}
325
324
}
326
325
@@ -334,7 +333,7 @@ where
334
333
#[ must_use = "method returns a new mask and does not mutate the original value" ]
335
334
fn bitxor ( self , rhs : Self ) -> Self {
336
335
// Safety: `self` is an integer vector
337
- unsafe { Self ( intrinsics:: simd_xor ( self . 0 , rhs. 0 ) ) }
336
+ unsafe { Self ( core :: intrinsics:: simd :: simd_xor ( self . 0 , rhs. 0 ) ) }
338
337
}
339
338
}
340
339
0 commit comments