From f7ea8cc7f9a7c8036e61ba89102f957fbe31b77e Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Tue, 29 Apr 2025 15:15:34 +0100 Subject: [PATCH] Remove volatile keyword from ARM inline assembler --- arch/arm/acle_intrins.h | 16 ++++++++-------- cmake/detect-intrinsics.cmake | 6 +++--- configure | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/acle_intrins.h b/arch/arm/acle_intrins.h index 1545ef57..8335c9c6 100644 --- a/arch/arm/acle_intrins.h +++ b/arch/arm/acle_intrins.h @@ -19,43 +19,43 @@ #ifdef __aarch64__ static inline uint32_t __crc32b(uint32_t __a, uint8_t __b) { uint32_t __c; - __asm__ __volatile__("crc32b %w0, %w1, %w2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32b %w0, %w1, %w2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } static inline uint32_t __crc32h(uint32_t __a, uint16_t __b) { uint32_t __c; - __asm__ __volatile__("crc32h %w0, %w1, %w2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32h %w0, %w1, %w2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } static inline uint32_t __crc32w(uint32_t __a, uint32_t __b) { uint32_t __c; - __asm__ __volatile__("crc32w %w0, %w1, %w2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32w %w0, %w1, %w2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } static inline uint32_t __crc32d(uint32_t __a, uint64_t __b) { uint32_t __c; - __asm__ __volatile__("crc32x %w0, %w1, %x2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32x %w0, %w1, %x2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } #else static inline uint32_t __crc32b(uint32_t __a, uint8_t __b) { uint32_t __c; - __asm__ __volatile__("crc32b %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32b %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } static inline uint32_t __crc32h(uint32_t __a, uint16_t __b) { uint32_t __c; - __asm__ __volatile__("crc32h %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32h %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } static inline uint32_t __crc32w(uint32_t __a, uint32_t __b) { uint32_t __c; - __asm__ __volatile__("crc32w %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("crc32w %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } @@ -76,7 +76,7 @@ typedef uint32_t uint16x2_t; static inline uint16x2_t __uqsub16(uint16x2_t __a, uint16x2_t __b) { uint16x2_t __c; - __asm__ __volatile__("uqsub16 %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); + __asm__("uqsub16 %0, %1, %2" : "=r" (__c) : "r"(__a), "r"(__b)); return __c; } #endif diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index d9e01f69..bf8bea7e 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -31,9 +31,9 @@ macro(check_armv8_compiler_flag) "unsigned int f(unsigned int a, unsigned int b) { unsigned int c; #ifdef __aarch64__ - __asm__ __volatile__ ( \"crc32w %w0, %w1, %w2\" : \"=r\" (c) : \"r\" (a), \"r\" (b)); + __asm__( \"crc32w %w0, %w1, %w2\" : \"=r\" (c) : \"r\" (a), \"r\" (b)); #else - __asm__ __volatile__ ( \"crc32w %0, %1, %2\" : \"=r\" (c) : \"r\" (a), \"r\" (b)); + __asm__( \"crc32w %0, %1, %2\" : \"=r\" (c) : \"r\" (a), \"r\" (b)); #endif return (int)c; } @@ -75,7 +75,7 @@ macro(check_armv6_compiler_flag) check_c_source_compiles( "unsigned int f(unsigned int a, unsigned int b) { unsigned int c; - __asm__ __volatile__ ( \"uqsub16 %0, %1, %2\" : \"=r\" (c) : \"r\" (a), \"r\" (b) ); + __asm__( \"uqsub16 %0, %1, %2\" : \"=r\" (c) : \"r\" (a), \"r\" (b) ); return (int)c; } int main(void) { return f(1,2); }" diff --git a/configure b/configure index ca7e4180..4e7a12e8 100755 --- a/configure +++ b/configure @@ -1318,9 +1318,9 @@ EOF unsigned int f(unsigned int a, unsigned int b) { unsigned int c; #ifdef __aarch64__ - __asm__ __volatile__("crc32w %w0, %w1, %w2" : "=r" (c) : "r"(a), "r"(b)); + __asm__("crc32w %w0, %w1, %w2" : "=r" (c) : "r"(a), "r"(b)); #else - __asm__ __volatile__("crc32w %0, %1, %2" : "=r" (c) : "r"(a), "r"(b)); + __asm__("crc32w %0, %1, %2" : "=r" (c) : "r"(a), "r"(b)); #endif return c; } @@ -1416,7 +1416,7 @@ EOF cat > $test.c << EOF unsigned int f(unsigned int a, unsigned int b) { unsigned int c; - __asm__ __volatile__ ( "uqsub16 %0, %1, %2" : "=r" (c) : "r" (a), "r" (b) ); + __asm__("uqsub16 %0, %1, %2" : "=r" (c) : "r" (a), "r" (b)); return c; } int main(void) { return 0; } -- 2.47.2