1
1
use crate :: LanesAtMost32 ;
2
2
3
3
macro_rules! implement_mask_ops {
4
- { $( $vector: ident => $mask: ident ( $inner_mask_ty : ident , $ inner_ty: ident) , ) * } => {
4
+ { $( $vector: ident => $mask: ident ( $inner_ty: ident) , ) * } => {
5
5
$(
6
6
impl <const LANES : usize > crate :: $vector<LANES >
7
7
where
8
8
crate :: $vector<LANES >: LanesAtMost32 ,
9
9
crate :: $inner_ty<LANES >: LanesAtMost32 ,
10
+ crate :: $mask<LANES >: crate :: Mask ,
10
11
{
11
12
/// Test if each lane is equal to the corresponding lane in `other`.
12
13
#[ inline]
13
14
pub fn lanes_eq( self , other: Self ) -> crate :: $mask<LANES > {
14
15
unsafe {
15
- crate :: $inner_mask_ty:: from_int_unchecked( crate :: intrinsics:: simd_eq( self , other) )
16
- . into( )
16
+ crate :: $mask:: from_int_unchecked( crate :: intrinsics:: simd_eq( self , other) )
17
17
}
18
18
}
19
19
20
20
/// Test if each lane is not equal to the corresponding lane in `other`.
21
21
#[ inline]
22
22
pub fn lanes_ne( self , other: Self ) -> crate :: $mask<LANES > {
23
23
unsafe {
24
- crate :: $inner_mask_ty:: from_int_unchecked( crate :: intrinsics:: simd_ne( self , other) )
25
- . into( )
24
+ crate :: $mask:: from_int_unchecked( crate :: intrinsics:: simd_ne( self , other) )
26
25
}
27
26
}
28
27
29
28
/// Test if each lane is less than the corresponding lane in `other`.
30
29
#[ inline]
31
30
pub fn lanes_lt( self , other: Self ) -> crate :: $mask<LANES > {
32
31
unsafe {
33
- crate :: $inner_mask_ty:: from_int_unchecked( crate :: intrinsics:: simd_lt( self , other) )
34
- . into( )
32
+ crate :: $mask:: from_int_unchecked( crate :: intrinsics:: simd_lt( self , other) )
35
33
}
36
34
}
37
35
38
36
/// Test if each lane is greater than the corresponding lane in `other`.
39
37
#[ inline]
40
38
pub fn lanes_gt( self , other: Self ) -> crate :: $mask<LANES > {
41
39
unsafe {
42
- crate :: $inner_mask_ty:: from_int_unchecked( crate :: intrinsics:: simd_gt( self , other) )
43
- . into( )
40
+ crate :: $mask:: from_int_unchecked( crate :: intrinsics:: simd_gt( self , other) )
44
41
}
45
42
}
46
43
47
44
/// Test if each lane is less than or equal to the corresponding lane in `other`.
48
45
#[ inline]
49
46
pub fn lanes_le( self , other: Self ) -> crate :: $mask<LANES > {
50
47
unsafe {
51
- crate :: $inner_mask_ty:: from_int_unchecked( crate :: intrinsics:: simd_le( self , other) )
52
- . into( )
48
+ crate :: $mask:: from_int_unchecked( crate :: intrinsics:: simd_le( self , other) )
53
49
}
54
50
}
55
51
56
52
/// Test if each lane is greater than or equal to the corresponding lane in `other`.
57
53
#[ inline]
58
54
pub fn lanes_ge( self , other: Self ) -> crate :: $mask<LANES > {
59
55
unsafe {
60
- crate :: $inner_mask_ty:: from_int_unchecked( crate :: intrinsics:: simd_ge( self , other) )
61
- . into( )
56
+ crate :: $mask:: from_int_unchecked( crate :: intrinsics:: simd_ge( self , other) )
62
57
}
63
58
}
64
59
}
@@ -67,18 +62,18 @@ macro_rules! implement_mask_ops {
67
62
}
68
63
69
64
implement_mask_ops ! {
70
- SimdI8 => Mask8 ( SimdMask8 , SimdI8 ) ,
71
- SimdI16 => Mask16 ( SimdMask16 , SimdI16 ) ,
72
- SimdI32 => Mask32 ( SimdMask32 , SimdI32 ) ,
73
- SimdI64 => Mask64 ( SimdMask64 , SimdI64 ) ,
74
- SimdIsize => MaskSize ( SimdMaskSize , SimdIsize ) ,
65
+ SimdI8 => Mask8 ( SimdI8 ) ,
66
+ SimdI16 => Mask16 ( SimdI16 ) ,
67
+ SimdI32 => Mask32 ( SimdI32 ) ,
68
+ SimdI64 => Mask64 ( SimdI64 ) ,
69
+ SimdIsize => MaskSize ( SimdIsize ) ,
75
70
76
- SimdU8 => Mask8 ( SimdMask8 , SimdI8 ) ,
77
- SimdU16 => Mask16 ( SimdMask16 , SimdI16 ) ,
78
- SimdU32 => Mask32 ( SimdMask32 , SimdI32 ) ,
79
- SimdU64 => Mask64 ( SimdMask64 , SimdI64 ) ,
80
- SimdUsize => MaskSize ( SimdMaskSize , SimdIsize ) ,
71
+ SimdU8 => Mask8 ( SimdI8 ) ,
72
+ SimdU16 => Mask16 ( SimdI16 ) ,
73
+ SimdU32 => Mask32 ( SimdI32 ) ,
74
+ SimdU64 => Mask64 ( SimdI64 ) ,
75
+ SimdUsize => MaskSize ( SimdIsize ) ,
81
76
82
- SimdF32 => Mask32 ( SimdMask32 , SimdI32 ) ,
83
- SimdF64 => Mask64 ( SimdMask64 , SimdI64 ) ,
77
+ SimdF32 => Mask32 ( SimdI32 ) ,
78
+ SimdF64 => Mask64 ( SimdI64 ) ,
84
79
}
0 commit comments