1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-09 14:10:09 +00:00

Use two-argument cpuid when using recent MinGW (#172)

This commit is contained in:
Nirbheek Chauhan 2023-12-20 08:45:07 +05:30 committed by GitHub
parent a4f6d7bd78
commit a55148fc56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 20 deletions

View File

@ -28,7 +28,7 @@ inline bool XMVerifyAVXSupport()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = {-1};
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid( CPUInfo, 0 );
@ -37,7 +37,7 @@ inline bool XMVerifyAVXSupport()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1 );

View File

@ -29,7 +29,7 @@ inline bool XMVerifyAVX2Support()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = {-1};
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -38,7 +38,7 @@ inline bool XMVerifyAVX2Support()
if ( CPUInfo[0] < 7 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);

View File

@ -59,7 +59,7 @@ inline bool XMVerifySSSE3Support()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = { -1 };
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -68,7 +68,7 @@ inline bool XMVerifySSSE3Support()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);

View File

@ -29,7 +29,7 @@ inline bool XMVerifyF16CSupport()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = { -1 };
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -38,7 +38,7 @@ inline bool XMVerifyF16CSupport()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);

View File

@ -28,7 +28,7 @@ inline bool XMVerifyFMA3Support()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = {-1};
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -37,7 +37,7 @@ inline bool XMVerifyFMA3Support()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);

View File

@ -33,7 +33,7 @@ inline bool XMVerifyFMA4Support()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = {-1};
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -42,7 +42,7 @@ inline bool XMVerifyFMA4Support()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);
@ -52,7 +52,7 @@ inline bool XMVerifyFMA4Support()
if ( (CPUInfo[2] & 0x18000000) != 0x18000000 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0x80000000, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0x80000000);
@ -62,7 +62,7 @@ inline bool XMVerifyFMA4Support()
return false;
// We check for FMA4
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0x80000001, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0x80000001);

View File

@ -29,7 +29,7 @@ inline bool XMVerifySSE3Support()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = { -1 };
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -37,7 +37,7 @@ inline bool XMVerifySSE3Support()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);

View File

@ -29,7 +29,7 @@ inline bool XMVerifySSE4Support()
// See http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
int CPUInfo[4] = { -1 };
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -37,7 +37,7 @@ inline bool XMVerifySSE4Support()
if ( CPUInfo[0] < 1 )
return false;
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);

View File

@ -1973,7 +1973,7 @@ inline bool XMVerifyCPUSupport() noexcept
{
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
int CPUInfo[4] = { -1 };
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 0);
@ -1987,7 +1987,7 @@ inline bool XMVerifyCPUSupport() noexcept
return false;
#endif
#if defined(__clang__) || defined(__GNUC__)
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);
#else
__cpuid(CPUInfo, 1);