use simd_neg in the impl crate::ops::Neg

on s390x I had some problems with the old implementation not combining
with other instructions well, and using the purpose-built intrinsic is
just clearer.
This commit is contained in:
Folkert de Vries 2025-02-22 21:27:45 +01:00 committed by Amanieu d'Antras
parent 2dbc1e9b25
commit b75bc77065

View file

@ -298,8 +298,7 @@ macro_rules! impl_neg {
impl crate::ops::Neg for s_t_l!($s) {
type Output = s_t_l!($s);
fn neg(self) -> Self::Output {
let zero = $s::splat($zero);
unsafe { transmute(simd_sub(zero, transmute(self))) }
unsafe { simd_neg(self) }
}
}
};