diff mbox series

[v3,05/23] aarch64: Add ACLE __chkfeat intrinsic

Message ID 20241108144816.2681175-6-yury.khrustalev@arm.com
State New
Headers show
Series aarch64: Add support for Guarded Control Stack extension | expand

Commit Message

Yury Khrustalev Nov. 8, 2024, 2:47 p.m. UTC
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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h
index ab4e7e60e04..e363587701c 100644
--- a/gcc/config/aarch64/arm_acle.h
+++ b/gcc/config/aarch64/arm_acle.h
@@ -190,8 +190,21 @@  __rint64x (double __a)
 
 #pragma GCC pop_options
 
+
 #pragma GCC push_options
+#pragma GCC target ("arch=armv8.9-a")
+
+__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