@@ -11,89 +11,33 @@ use crate::{core_arch::simd::*, hint::unreachable_unchecked, intrinsics::simd::*
11
11
#[ cfg( test) ]
12
12
use stdarch_test:: assert_instr;
13
13
14
- #[ unstable( feature = "stdarch_internal" , issue = "none" ) ]
15
14
pub ( crate ) trait AsUnsigned {
16
15
type Unsigned : ?Sized ;
17
- unsafe fn as_unsigned ( self ) -> Self :: Unsigned ;
16
+ fn as_unsigned ( self ) -> Self :: Unsigned ;
18
17
}
19
18
20
- #[ unstable( feature = "stdarch_internal" , issue = "none" ) ]
21
19
pub ( crate ) trait AsSigned {
22
20
type Signed : ?Sized ;
23
- unsafe fn as_signed ( self ) -> Self :: Signed ;
24
- }
25
-
26
- macro_rules! impl_sign_conversions {
27
- ( $( ( $signed: ty, $unsigned: ty) ) * ) => ( $(
28
- #[ cfg_attr(
29
- not( target_arch = "arm" ) ,
30
- stable( feature = "neon_intrinsics" , since = "1.59.0" )
31
- ) ]
32
- #[ cfg_attr(
33
- target_arch = "arm" ,
34
- unstable( feature = "stdarch_arm_neon_intrinsics" , issue = "111800" )
35
- ) ]
36
- impl AsUnsigned for $signed {
37
- type Unsigned = $unsigned;
38
-
39
- #[ inline]
40
- unsafe fn as_unsigned( self ) -> $unsigned {
41
- crate :: mem:: transmute( self )
42
- }
43
- }
44
-
45
- #[ cfg_attr(
46
- not( target_arch = "arm" ) ,
47
- stable( feature = "neon_intrinsics" , since = "1.59.0" )
48
- ) ]
49
- #[ cfg_attr(
50
- target_arch = "arm" ,
51
- unstable( feature = "stdarch_arm_neon_intrinsics" , issue = "111800" )
52
- ) ]
53
- impl AsSigned for $unsigned {
54
- type Signed = $signed;
55
-
56
- #[ inline]
57
- unsafe fn as_signed( self ) -> $signed {
58
- crate :: mem:: transmute( self )
59
- }
60
- }
61
- ) * )
21
+ fn as_signed ( self ) -> Self :: Signed ;
62
22
}
63
23
64
24
macro_rules! impl_sign_conversions_neon {
65
25
( $( ( $signed: ty, $unsigned: ty) ) * ) => ( $(
66
- #[ cfg_attr(
67
- not( target_arch = "arm" ) ,
68
- stable( feature = "neon_intrinsics" , since = "1.59.0" )
69
- ) ]
70
- #[ cfg_attr(
71
- target_arch = "arm" ,
72
- unstable( feature = "stdarch_arm_neon_intrinsics" , issue = "111800" )
73
- ) ]
74
26
impl AsUnsigned for $signed {
75
27
type Unsigned = $unsigned;
76
28
77
29
#[ inline]
78
- unsafe fn as_unsigned( self ) -> $unsigned {
79
- crate :: mem :: transmute( self )
30
+ fn as_unsigned( self ) -> $unsigned {
31
+ unsafe { transmute( self ) }
80
32
}
81
33
}
82
34
83
- #[ cfg_attr(
84
- not( target_arch = "arm" ) ,
85
- stable( feature = "neon_intrinsics" , since = "1.59.0" )
86
- ) ]
87
- #[ cfg_attr(
88
- target_arch = "arm" ,
89
- unstable( feature = "stdarch_arm_neon_intrinsics" , issue = "111800" )
90
- ) ]
91
35
impl AsSigned for $unsigned {
92
36
type Signed = $signed;
93
37
94
38
#[ inline]
95
- unsafe fn as_signed( self ) -> $signed {
96
- crate :: mem :: transmute( self )
39
+ fn as_signed( self ) -> $signed {
40
+ unsafe { transmute( self ) }
97
41
}
98
42
}
99
43
) * )
@@ -1121,7 +1065,7 @@ pub struct poly64x2x4_t(
1121
1065
pub poly64x2_t ,
1122
1066
) ;
1123
1067
1124
- impl_sign_conversions ! {
1068
+ impl_sign_conversions_neon ! {
1125
1069
( i8 , u8 )
1126
1070
( i16 , u16 )
1127
1071
( i32 , u32 )
@@ -1150,9 +1094,6 @@ impl_sign_conversions! {
1150
1094
( uint64x2_t, int64x2_t)
1151
1095
( uint8x16_t, int8x16_t)
1152
1096
( uint8x8_t, int8x8_t)
1153
- }
1154
-
1155
- impl_sign_conversions_neon ! {
1156
1097
( int16x4x2_t, uint16x4x2_t)
1157
1098
( int16x4x3_t, uint16x4x3_t)
1158
1099
( int16x4x4_t, uint16x4x4_t)
0 commit comments