-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for checking that MSVC intrinsics are actually available f…
…rom C.
- Loading branch information
1 parent
c705ee2
commit 3f7788e
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// LINK: | ||
// REQUIRED_ARGS: -os=windows | ||
// PERMUTE_ARGS: -i -betterC | ||
// Checking that the MSVC intrinsics reimplemented for ImportC are actually available from C. | ||
|
||
#if defined(_M_AMD64) | ||
unsigned long long multiplyU128(unsigned long long a, unsigned long long b, unsigned long long* high) | ||
{ | ||
return _umul128(a, b, high); | ||
} | ||
#elif defined(_M_IX86) | ||
int interlockedAddLarge(long long *target, int value) | ||
{ | ||
return _InterlockedAddLargeStatistic(target, value); | ||
} | ||
#elif defined(_M_ARM64) | ||
unsigned long long multiplyUHigh64(unsigned long long a, unsigned long long b) | ||
{ | ||
return __umulh(a, b); | ||
} | ||
#elif defined(_M_ARM) | ||
void dmb(void) | ||
{ | ||
__dmb(11); | ||
} | ||
#endif | ||
|
||
int main(void) | ||
{ | ||
return 0; | ||
} |