@@ -21,22 +21,12 @@ macro_rules! simd_ty {
21
21
pub ( crate ) const fn from_array( elements: [ $elem_type; $len] ) -> Self {
22
22
$id( elements)
23
23
}
24
- // FIXME: Workaround rust@60637
24
+
25
25
#[ inline( always) ]
26
26
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] )
34
28
}
35
29
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
40
30
#[ inline( always) ]
41
31
pub ( crate ) fn extract( & self , index: usize ) -> $elem_type {
42
32
self . as_array( ) [ index]
@@ -87,16 +77,9 @@ macro_rules! simd_m_ty {
87
77
$id( [ $( Self :: bool_to_internal( $param_name) ) ,* ] )
88
78
}
89
79
90
- // FIXME: Workaround rust@60637
91
80
#[ inline( always) ]
92
81
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] )
100
83
}
101
84
102
85
#[ inline]
0 commit comments