From 7005f46752abff5083f52778768edf6645ae39e1 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 22 Mar 2024 23:49:41 +0100 Subject: [PATCH] Fix RhpLockCmpXchg64 FCall on win-x86 (#100155) --- src/coreclr/nativeaot/Runtime/CommonMacros.h | 7 +++++++ src/coreclr/nativeaot/Runtime/MiscHelpers.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/coreclr/nativeaot/Runtime/CommonMacros.h b/src/coreclr/nativeaot/Runtime/CommonMacros.h index e9e62638813ba..27f14f09eae4f 100644 --- a/src/coreclr/nativeaot/Runtime/CommonMacros.h +++ b/src/coreclr/nativeaot/Runtime/CommonMacros.h @@ -255,6 +255,10 @@ typedef uint8_t CODE_LOCATION; FCIMPL_RENAME_ARGSIZE(_rettype, _method, 24) \ EXTERN_C _rettype F_CALL_CONV _method##_FCall (c, b, a) \ { +#define FCIMPL3_ILL(_rettype, _method, a, b, c) \ + FCIMPL_RENAME_ARGSIZE(_rettype, _method, 20) \ + EXTERN_C _rettype F_CALL_CONV _method##_FCall (a, c, b) \ + { #else @@ -289,6 +293,9 @@ typedef uint8_t CODE_LOCATION; #define FCIMPL3_DDD(_rettype, _method, a, b, c) \ EXTERN_C _rettype F_CALL_CONV _method (a, b, c) \ { +#define FCIMPL3_ILL(_rettype, _method, a, b, c) \ + EXTERN_C _rettype F_CALL_CONV _method (a, b, c) \ + { #endif diff --git a/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp b/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp index d6c734bc0118a..c5bbcc2284277 100644 --- a/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/MiscHelpers.cpp @@ -423,7 +423,7 @@ FCIMPL3(int32_t, RhpLockCmpXchg32, int32_t * location, int32_t value, int32_t co } FCIMPLEND -FCIMPL3(int64_t, RhpLockCmpXchg64, int64_t * location, int64_t value, int64_t comparand) +FCIMPL3_ILL(int64_t, RhpLockCmpXchg64, int64_t * location, int64_t value, int64_t comparand) { return PalInterlockedCompareExchange64(location, value, comparand); }