From b75bc770651abf286d2a99d19cfbc40f930977a6 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 22 Feb 2025 21:27:45 +0100 Subject: [PATCH] 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. --- library/stdarch/crates/core_arch/src/powerpc/macros.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/stdarch/crates/core_arch/src/powerpc/macros.rs b/library/stdarch/crates/core_arch/src/powerpc/macros.rs index 4dcf55891997..af47494e8fb4 100644 --- a/library/stdarch/crates/core_arch/src/powerpc/macros.rs +++ b/library/stdarch/crates/core_arch/src/powerpc/macros.rs @@ -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) } } } };