[directxmath] Add support for powerpc64 (#50424)

Co-authored-by: Timothy Pearson <tpearson@raptorcs.com>
This commit is contained in:
Timothy Pearson 2026-03-13 02:08:00 -05:00 committed by GitHub
parent 48cfe1e0e9
commit 17ceb84125
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 2 deletions

View File

@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
MinGW-fix.patch
Linux-SHMath-SAL.patch
powerpc64le.patch
)
vcpkg_check_features(

View File

@ -0,0 +1,32 @@
--- a/Inc/DirectXMath.h
+++ b/Inc/DirectXMath.h
@@ -82,7 +82,7 @@
#endif
#if !defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
-#if (defined(_M_IX86) || defined(_M_X64) || __i386__ || __x86_64__) && !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC)
+#if (defined(_M_IX86) || defined(_M_X64) || __i386__ || __x86_64__ || __powerpc64__) && !defined(_M_HYBRID_X86_ARM64) && !defined(_M_ARM64EC)
#define _XM_SSE_INTRINSICS_
#elif defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
#define _XM_ARM_NEON_INTRINSICS_
@@ -213,7 +213,7 @@
#define XM_PERMUTE_PS( v, c ) _mm_shuffle_ps((v), (v), c )
#endif
-#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 11)
+#if (defined(__GNUC__) && !defined(__clang__) && (__GNUC__ < 11)) || defined(__powerpc64__)
#define XM_LOADU_SI16( p ) _mm_cvtsi32_si128(*reinterpret_cast<unsigned short const*>(p))
#else
#define XM_LOADU_SI16( p ) _mm_loadu_si16(p)
--- a/Inc/DirectXMathMisc.inl
+++ b/Inc/DirectXMathMisc.inl
@@ -1971,7 +1971,7 @@
inline bool XMVerifyCPUSupport() noexcept
{
-#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
+#if defined(_XM_SSE_INTRINSICS_) && !defined(__powerpc64__) && !defined(_XM_NO_INTRINSICS_)
int CPUInfo[4] = { -1 };
#if (defined(__clang__) || defined(__GNUC__)) && defined(__cpuid)
__cpuid(0, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]);

View File

@ -1,6 +1,6 @@
{
"name": "directxmath",
"version-date": "2025-04-03",
"version-date": "2026-03-12",
"description": "DirectXMath SIMD C++ math library",
"homepage": "https://github.com/Microsoft/DirectXMath",
"documentation": "https://docs.microsoft.com/windows/win32/dxmath/directxmath-portal",

View File

@ -2481,7 +2481,7 @@
"port-version": 0
},
"directxmath": {
"baseline": "2025-04-03",
"baseline": "2026-03-12",
"port-version": 0
},
"directxmesh": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "28b3a14bbce32017e2f630c0558ddbdd23fb4c85",
"version-date": "2026-03-12",
"port-version": 0
},
{
"git-tree": "b199edaeaf0b2b92a634dfeb1289879ea5eeae7f",
"version-date": "2025-04-03",