Skip to content

Commit 08e1265

Browse files
sdesmalen-armAlexisPerry
authored andcommitted
[Clang][AArch64] Use 'uint64_t*' for _arm_get_sme_state builtin. (llvm#95982)
Depending on the platform, the parameter for __arm_get_sme_state requires a `unsigned long long*` instead of a `unsigned long*`. From ASTContext.cpp: case 'W': // This modifier represents int64 type.
1 parent 832547f commit 08e1265

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ TARGET_BUILTIN(__builtin_arm_stg, "vv*", "t", "mte")
7272
TARGET_BUILTIN(__builtin_arm_subp, "Uiv*v*", "t", "mte")
7373

7474
// SME state function
75-
BUILTIN(__builtin_arm_get_sme_state, "vULi*ULi*", "n")
75+
BUILTIN(__builtin_arm_get_sme_state, "vWUi*WUi*", "n")
7676

7777
// Memory Operations
7878
TARGET_BUILTIN(__builtin_arm_mops_memset_tag, "v*v*iz", "", "mte,mops")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// REQUIRES: aarch64-registered-target
2+
// RUN: %clang_cc1 -triple aarch64-linux -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
3+
// RUN: %clang_cc1 -triple aarch64-windows -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
4+
// RUN: %clang_cc1 -triple aarch64-darwin -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
5+
6+
#include <stdint.h>
7+
8+
// Ensure that the builtin is defined to take a uint64_t * rather than relying
9+
// on the size of 'unsigned long' which may have different meanings on different
10+
// targets depending on LP64/LLP64.
11+
void test_sme_state_builtin(uint64_t *a,
12+
uint64_t *b) __arm_streaming_compatible {
13+
__builtin_arm_get_sme_state(a, b);
14+
}

0 commit comments

Comments
 (0)