@@ -21,22 +21,12 @@ macro_rules! simd_ty {
2121 pub ( crate ) const fn from_array( elements: [ $elem_type; $len] ) -> Self {
2222 $id( elements)
2323 }
24- // FIXME: Workaround rust@60637
24+
2525 #[ inline( always) ]
2626 pub ( crate ) fn splat( value: $elem_type) -> Self {
27- #[ derive( Copy , Clone ) ]
28- #[ repr( simd) ]
29- struct JustOne ( [ $elem_type; 1 ] ) ;
30- let one = JustOne ( [ value] ) ;
31- // SAFETY: 0 is always in-bounds because we're shuffling
32- // a simd type with exactly one element.
33- unsafe { simd_shuffle!( one, one, [ 0 ; $len] ) }
27+ $id( [ value; $len] )
3428 }
3529
36- /// Extract the element at position `index`.
37- /// `index` is not a constant so this is not efficient!
38- /// Use for testing only.
39- // FIXME: Workaround rust@60637
4030 #[ inline( always) ]
4131 pub ( crate ) fn extract( & self , index: usize ) -> $elem_type {
4232 self . as_array( ) [ index]
@@ -87,16 +77,9 @@ macro_rules! simd_m_ty {
8777 $id( [ $( Self :: bool_to_internal( $param_name) ) ,* ] )
8878 }
8979
90- // FIXME: Workaround rust@60637
9180 #[ inline( always) ]
9281 pub ( crate ) fn splat( value: bool ) -> Self {
93- #[ derive( Copy , Clone ) ]
94- #[ repr( simd) ]
95- struct JustOne ( [ $elem_type; 1 ] ) ;
96- let one = JustOne ( [ Self :: bool_to_internal( value) ] ) ;
97- // SAFETY: 0 is always in-bounds because we're shuffling
98- // a simd type with exactly one element.
99- unsafe { simd_shuffle!( one, one, [ 0 ; $len] ) }
82+ $id( [ Self :: bool_to_internal( value) ; $len] )
10083 }
10184
10285 #[ inline]
0 commit comments