From 7ac1920198ebb7d0192e6d2c3581e15b38a6e0e5 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 13 Feb 2026 07:29:27 -0700 Subject: [PATCH] keccak: ARMv8 `asm!` cleanups (#101) We pass in `state.as_mut_ptr()` as `x0`, which was previously marked as `in`. However, it's modified in the `asm!`, e.g.: sub x0, x0, #192 Note: it's also post-incremented by `ld1.1d` as state is loaded. Since it's modified, it needs to be `inout`. This marks it as such, using the `=> _` syntax to discard the result, then it's reset, then modified as state is written). Similar mutations were occurring with `x1` and `x8` as well, which have been modified accordingly. --- keccak/src/armv8.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keccak/src/armv8.rs b/keccak/src/armv8.rs index 427c916..226e8f1 100644 --- a/keccak/src/armv8.rs +++ b/keccak/src/armv8.rs @@ -124,9 +124,9 @@ pub unsafe fn p1600_armv8_sha3_asm(state: &mut [u64; 25], round_count: usize) { st1.1d {{v20-v23}}, [x0], #32 st1.1d {{v24}}, [x0] ", - in("x0") state.as_mut_ptr(), - in("x1") crate::RC[24-round_count..].as_ptr(), - in("x8") round_count, + inout("x0") state.as_mut_ptr() => _, + inout("x1") crate::RC[24-round_count..].as_ptr() => _, + inout("x8") round_count => _, clobber_abi("C"), options(nostack) );