-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[ARM64EC] Fix compilation of intrin.h in ARM64EC mode. #87717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
#ifndef __INTRIN0_H | ||
#define __INTRIN0_H | ||
|
||
#ifdef __x86_64__ | ||
#if defined(__x86_64__) && !defined(__arm64ec__) | ||
#include <adcintrin.h> | ||
#endif | ||
|
||
|
@@ -27,7 +27,7 @@ unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask); | |
unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask); | ||
void _ReadWriteBarrier(void); | ||
|
||
#if defined(__aarch64__) | ||
#if defined(__aarch64__) || defined(__arm64ec__) | ||
unsigned int _CountLeadingZeros(unsigned long); | ||
unsigned int _CountLeadingZeros64(unsigned _int64); | ||
unsigned char _InterlockedCompareExchange128_acq(__int64 volatile *_Destination, | ||
|
@@ -44,7 +44,7 @@ unsigned char _InterlockedCompareExchange128_rel(__int64 volatile *_Destination, | |
__int64 *_ComparandResult); | ||
#endif | ||
|
||
#ifdef __x86_64__ | ||
#ifdef __x86_64__ && !defined(__arm64ec__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello, we found compile errors on this line:
Seems like this line forgot to change #ifdef when changed into expression There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @FreddyLeaf Curiosity how are you running clang. Since I couldn't repro the warning in my local testing due to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I don't have the reproducer, either. The scene supposed to be building V-Ray with MSbuild on Windows. |
||
unsigned __int64 _umul128(unsigned __int64, unsigned __int64, | ||
unsigned __int64 *); | ||
unsigned __int64 __shiftleft128(unsigned __int64 _LowPart, | ||
|
@@ -55,7 +55,7 @@ unsigned __int64 __shiftright128(unsigned __int64 _LowPart, | |
unsigned char _Shift); | ||
#endif | ||
|
||
#if defined(__x86_64__) || defined(__i386__) | ||
#if defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__)) | ||
void _mm_pause(void); | ||
#endif | ||
|
||
|
@@ -83,7 +83,7 @@ __int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask); | |
__int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask); | ||
#endif | ||
|
||
#if defined(__arm__) || defined(__aarch64__) | ||
#if defined(__arm__) || defined(__aarch64__) || defined(__arm64ec__) | ||
/*----------------------------------------------------------------------------*\ | ||
|* Interlocked Exchange Add | ||
\*----------------------------------------------------------------------------*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. We should probably also ifdef these function declarations near the top of this file.
https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/intrin.h#L96
https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/intrin.h#L126
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That chunk of declarations near the top of the file needs a lot of work to match the actual implementation; I'd prefer to just leave it for now.