Skip to content

Commit be04497

Browse files
authored
[AArch64] Update __gcsss intrinsic to match revised ACLE specification (#136850)
The original __gcsss intrinsic was implemented based on: ARM-software/acle#260 with the signature: const void *__gcsss(const void *) Per the updated specification in: ARM-software/acle#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.
1 parent 3883b27 commit be04497

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ TARGET_BUILTIN(__builtin_arm_st64bv0, "WUiv*WUiC*", "n", "ls64")
137137

138138
// Armv9.3-A Guarded Control Stack
139139
TARGET_BUILTIN(__builtin_arm_gcspopm, "WUiWUi", "n", "gcs")
140-
TARGET_BUILTIN(__builtin_arm_gcsss, "vC*vC*", "n", "gcs")
140+
TARGET_BUILTIN(__builtin_arm_gcsss, "v*v*", "n", "gcs")
141141

142142
TARGET_HEADER_BUILTIN(_BitScanForward, "UcUNi*UNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
143143
TARGET_HEADER_BUILTIN(_BitScanReverse, "UcUNi*UNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")

clang/lib/Headers/arm_acle.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,9 @@ __gcspopm() {
841841
return __builtin_arm_gcspopm(0);
842842
}
843843

844-
static __inline__ const void * __attribute__((__always_inline__, __nodebug__, target("gcs")))
845-
__gcsss(const void *__stack) {
844+
static __inline__ void *__attribute__((__always_inline__, __nodebug__,
845+
target("gcs")))
846+
__gcsss(void *__stack) {
846847
return __builtin_arm_gcsss(__stack);
847848
}
848849
#endif

clang/test/CodeGen/AArch64/gcs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --clang-args ['-target-feature', '+gcs'] --version 2
22
// RUN: %clang_cc1 -triple aarch64-eabi -target-feature +gcs -emit-llvm %s -o - | FileCheck %s
33

44
#include <arm_acle.h>
@@ -51,6 +51,6 @@ uint64_t test_gcspopm() {
5151
// CHECK-NEXT: [[TMP2:%.*]] = call ptr @llvm.aarch64.gcsss(ptr [[TMP1]])
5252
// CHECK-NEXT: ret ptr [[TMP2]]
5353
//
54-
const void *test_gcsss(const void *p) {
54+
void *test_gcsss(void *p) {
5555
return __gcsss(p);
5656
}

0 commit comments

Comments
 (0)