@@ -11,89 +11,33 @@ use crate::{core_arch::simd::*, hint::unreachable_unchecked, intrinsics::simd::*
1111#[ cfg( test) ]
1212use stdarch_test:: assert_instr;
1313
14- #[ unstable( feature = "stdarch_internal" , issue = "none" ) ]
1514pub ( crate ) trait AsUnsigned {
1615 type Unsigned : ?Sized ;
17- unsafe fn as_unsigned ( self ) -> Self :: Unsigned ;
16+ fn as_unsigned ( self ) -> Self :: Unsigned ;
1817}
1918
20- #[ unstable( feature = "stdarch_internal" , issue = "none" ) ]
2119pub ( crate ) trait AsSigned {
2220 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 ;
6222}
6323
6424macro_rules! impl_sign_conversions_neon {
6525 ( $( ( $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- ) ]
7426 impl AsUnsigned for $signed {
7527 type Unsigned = $unsigned;
7628
7729 #[ inline]
78- unsafe fn as_unsigned( self ) -> $unsigned {
79- crate :: mem :: transmute( self )
30+ fn as_unsigned( self ) -> $unsigned {
31+ unsafe { transmute( self ) }
8032 }
8133 }
8234
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- ) ]
9135 impl AsSigned for $unsigned {
9236 type Signed = $signed;
9337
9438 #[ inline]
95- unsafe fn as_signed( self ) -> $signed {
96- crate :: mem :: transmute( self )
39+ fn as_signed( self ) -> $signed {
40+ unsafe { transmute( self ) }
9741 }
9842 }
9943 ) * )
@@ -1121,7 +1065,7 @@ pub struct poly64x2x4_t(
11211065 pub poly64x2_t ,
11221066) ;
11231067
1124- impl_sign_conversions ! {
1068+ impl_sign_conversions_neon ! {
11251069 ( i8 , u8 )
11261070 ( i16 , u16 )
11271071 ( i32 , u32 )
@@ -1150,9 +1094,6 @@ impl_sign_conversions! {
11501094 ( uint64x2_t, int64x2_t)
11511095 ( uint8x16_t, int8x16_t)
11521096 ( uint8x8_t, int8x8_t)
1153- }
1154-
1155- impl_sign_conversions_neon ! {
11561097 ( int16x4x2_t, uint16x4x2_t)
11571098 ( int16x4x3_t, uint16x4x3_t)
11581099 ( int16x4x4_t, uint16x4x4_t)
0 commit comments