@@ -185,25 +185,7 @@ macro_rules! impl_op {
185
185
{
186
186
type Output = Self ;
187
187
fn neg( self ) -> Self :: Output {
188
- Self :: splat( 0 ) - self
189
- }
190
- }
191
- }
192
- } ;
193
-
194
- { impl Neg for $type: ident, $scalar: ty, @float } => {
195
- impl_ref_ops! {
196
- impl <const LANES : usize > core:: ops:: Neg for crate :: $type<LANES >
197
- where
198
- crate :: $type<LANES >: LanesAtMost32 ,
199
- crate :: SimdU32 <LANES >: LanesAtMost32 ,
200
- crate :: SimdU64 <LANES >: LanesAtMost32 ,
201
- {
202
- type Output = Self ;
203
- fn neg( self ) -> Self :: Output {
204
- // FIXME: Replace this with fneg intrinsic once available.
205
- // https://github.com/rust-lang/stdsimd/issues/32
206
- Self :: from_bits( Self :: splat( -0.0 ) . to_bits( ) ^ self . to_bits( ) )
188
+ unsafe { crate :: intrinsics:: simd_neg( self ) }
207
189
}
208
190
}
209
191
}
@@ -318,7 +300,7 @@ macro_rules! impl_float_ops {
318
300
impl_op! { impl Mul for $vector, $scalar }
319
301
impl_op! { impl Div for $vector, $scalar }
320
302
impl_op! { impl Rem for $vector, $scalar }
321
- impl_op! { impl Neg for $vector, $scalar, @float }
303
+ impl_op! { impl Neg for $vector, $scalar }
322
304
impl_op! { impl Index for $vector, $scalar }
323
305
) *
324
306
) *
0 commit comments