@@ -185,25 +185,7 @@ macro_rules! impl_op {
185185 {
186186 type Output = Self ;
187187 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 ) }
207189 }
208190 }
209191 }
@@ -318,7 +300,7 @@ macro_rules! impl_float_ops {
318300 impl_op! { impl Mul for $vector, $scalar }
319301 impl_op! { impl Div for $vector, $scalar }
320302 impl_op! { impl Rem for $vector, $scalar }
321- impl_op! { impl Neg for $vector, $scalar, @float }
303+ impl_op! { impl Neg for $vector, $scalar }
322304 impl_op! { impl Index for $vector, $scalar }
323305 ) *
324306 ) *
0 commit comments