Skip to content

Commit 53b9048

Browse files
authored
[MSVC, ARM64] Fix signature for __prefetch (#93235)
#67174 added the `__prefetch` intrinsic, however it used the wrong signature: the argument should be `const void*`, not `void*`. Docs: https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170#:~:text=__prefetch Unfortunately, this can't be backported (there are no more 18.x releases, and this change is a breaking change), so I'll see if I can get a workaround added on MSVC's side for Clang 18.
1 parent 82a5d0d commit 53b9048

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ TARGET_HEADER_BUILTIN(_CountLeadingZeros64, "UiULLi", "nh", INTRIN_H, ALL_MS_LAN
290290
TARGET_HEADER_BUILTIN(_CountOneBits, "UiUNi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
291291
TARGET_HEADER_BUILTIN(_CountOneBits64, "UiULLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
292292

293-
TARGET_HEADER_BUILTIN(__prefetch, "vv*", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
293+
TARGET_HEADER_BUILTIN(__prefetch, "vvC*", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
294294

295295
#undef BUILTIN
296296
#undef LANGBUILTIN

clang/lib/Headers/intrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ unsigned int _CountLeadingSigns64(__int64);
378378
unsigned int _CountOneBits(unsigned long);
379379
unsigned int _CountOneBits64(unsigned __int64);
380380

381-
void __cdecl __prefetch(void *);
381+
void __cdecl __prefetch(const void *);
382382
#endif
383383

384384
/*----------------------------------------------------------------------------*\

0 commit comments

Comments
 (0)