]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Remove volatile keyword from ARM inline assembler
authorCameron Cawley <ccawley2011@gmail.com>
Tue, 29 Apr 2025 14:15:34 +0000 (15:15 +0100)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 11 Jul 2025 14:10:38 +0000 (16:10 +0200)
arch/arm/acle_intrins.h
cmake/detect-intrinsics.cmake
configure

index 1545ef5757e49db474abf1cd3ac171a8cdaa33dd..8335c9c6aaa042b7082ae67a04d4ef6361e8cd3c 100644 (file)
 #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
index d9e01f6962609bc8849b8dab2fdea8464e69cea3..bf8bea7e9ce094612545e25ba6e385922a8dd355 100644 (file)
@@ -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); }"
index ca7e4180d6fc1053cbaea61e24680b8ae09802ce..4e7a12e88649bf398bedf9ba7d49260b40a08fa5 100755 (executable)
--- 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; }