Make asm without side-effects not optimisable-out

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-10-10 09:53:44 +01:00
parent 8ba9f42acd
commit 78d78462ac

View file

@ -202,9 +202,9 @@ static int mbedtls_a64_crypto_sha256_determine_support(void)
if (setjmp(return_from_sigill) == 0) { /* First return only */
/* If this traps, we will return a second time from setjmp() with 1 */
#if defined(MBEDTLS_ARCH_IS_ARM64)
asm ("sha256h q0, q0, v0.4s" : : : "v0");
asm volatile ("sha256h q0, q0, v0.4s" : : : "v0");
#else
asm ("sha256h.32 q0, q0, q0" : : : "q0");
asm volatile ("sha256h.32 q0, q0, q0" : : : "q0");
#endif
ret = 1;
}