https://github.com/sivan-shani updated https://github.com/llvm/llvm-project/pull/136850
>From a3cc71ef731e08d9e0963db767e190a231f75260 Mon Sep 17 00:00:00 2001 From: Sivan Shani <sivan.sh...@arm.com> Date: Wed, 23 Apr 2025 12:39:05 +0100 Subject: [PATCH 1/2] [AArch64] Update __gcsss intrinsic to match revised ACLE specification The original __gcsss intrinsic was implemented based on: https://github.com/ARM-software/acle/pull/260 with the signature: const void *__gcsss(const void *) Per the updated specification in: https://github.com/ARM-software/acle/pull/364 both const qualifiers have been removed. This commit updates the signature accordingly to: void *__gcsss(void *) This aligns the implementation with the latest ACLE definition. --- clang/include/clang/Basic/BuiltinsAArch64.def | 2 +- clang/lib/Headers/arm_acle.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/Basic/BuiltinsAArch64.def b/clang/include/clang/Basic/BuiltinsAArch64.def index 19fa7215b5000..8867a9fe09fb9 100644 --- a/clang/include/clang/Basic/BuiltinsAArch64.def +++ b/clang/include/clang/Basic/BuiltinsAArch64.def @@ -137,7 +137,7 @@ TARGET_BUILTIN(__builtin_arm_st64bv0, "WUiv*WUiC*", "n", "ls64") // Armv9.3-A Guarded Control Stack TARGET_BUILTIN(__builtin_arm_gcspopm, "WUiWUi", "n", "gcs") -TARGET_BUILTIN(__builtin_arm_gcsss, "vC*vC*", "n", "gcs") +TARGET_BUILTIN(__builtin_arm_gcsss, "v*v*", "n", "gcs") TARGET_HEADER_BUILTIN(_BitScanForward, "UcUNi*UNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(_BitScanReverse, "UcUNi*UNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "") diff --git a/clang/lib/Headers/arm_acle.h b/clang/lib/Headers/arm_acle.h index 89db5dc2d7aaa..5cfa3d023a7d5 100644 --- a/clang/lib/Headers/arm_acle.h +++ b/clang/lib/Headers/arm_acle.h @@ -841,8 +841,9 @@ __gcspopm() { return __builtin_arm_gcspopm(0); } -static __inline__ const void * __attribute__((__always_inline__, __nodebug__, target("gcs"))) -__gcsss(const void *__stack) { +static __inline__ void *__attribute__((__always_inline__, __nodebug__, + target("gcs"))) +__gcsss(void *__stack) { return __builtin_arm_gcsss(__stack); } #endif >From dfbb1c22204032b359a5fc0c14853300b0b0e330 Mon Sep 17 00:00:00 2001 From: Sivan Shani <sivan.sh...@arm.com> Date: Wed, 23 Apr 2025 17:18:21 +0100 Subject: [PATCH 2/2] update test file (remove const) --- clang/test/CodeGen/AArch64/gcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/test/CodeGen/AArch64/gcs.c b/clang/test/CodeGen/AArch64/gcs.c index 767b1b8bfaf2d..64785be2af623 100644 --- a/clang/test/CodeGen/AArch64/gcs.c +++ b/clang/test/CodeGen/AArch64/gcs.c @@ -1,4 +1,4 @@ -// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2 +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --clang-args ['-target-feature', '+gcs'] --version 2 // RUN: %clang_cc1 -triple aarch64-eabi -target-feature +gcs -emit-llvm %s -o - | FileCheck %s #include <arm_acle.h> @@ -51,6 +51,6 @@ uint64_t test_gcspopm() { // CHECK-NEXT: [[TMP2:%.*]] = call ptr @llvm.aarch64.gcsss(ptr [[TMP1]]) // CHECK-NEXT: ret ptr [[TMP2]] // -const void *test_gcsss(const void *p) { +void *test_gcsss(void *p) { return __gcsss(p); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits