]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Add ACLE __chkfeat intrinsic
authorYury Khrustalev <yury.khrustalev@arm.com>
Thu, 14 Nov 2024 16:15:05 +0000 (16:15 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 14 Nov 2024 16:15:05 +0000 (16:15 +0000)
Note that compared to __builtin_aarch64_chkfeat (x) the ACLE __chkfeat(x)
flips the bits to be more intuitive (xor the input to output).

gcc/ChangeLog:
* config/aarch64/arm_acle.h (__chkfeat): New.

gcc/config/aarch64/arm_acle.h

index ab4e7e60e046a9e9c81237de2ca5463c3d4f96ca..ca9aabf8ebb9ce648be084abfd688bc20049ec72 100644 (file)
@@ -190,8 +190,21 @@ __rint64x (double __a)
 
 #pragma GCC pop_options
 
+
 #pragma GCC push_options
+#pragma GCC target ("+nothing")
+
+__extension__ extern __inline uint64_t
+__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
+__chkfeat (uint64_t __feat)
+{
+  return __builtin_aarch64_chkfeat (__feat) ^ __feat;
+}
 
+#pragma GCC pop_options
+
+
+#pragma GCC push_options
 #pragma GCC target ("+nothing+crc")
 
 __extension__ extern __inline uint32_t