1717#error DirectX Math requires C++
1818#endif
1919
20- #define DIRECTX_MATH_VERSION 303
20+ #define DIRECTX_MATH_VERSION 304
2121
2222#if !defined(_XM_BIGENDIAN_) && !defined(_XM_LITTLEENDIAN_)
23- #if defined(_M_AMD64 ) || defined(_M_IX86) || defined(_M_ARM)
23+ #if defined(_M_X64 ) || defined(_M_IX86) || defined(_M_ARM)
2424#define _XM_LITTLEENDIAN_
2525#elif defined(_M_PPCBE)
2626#define _XM_BIGENDIAN_
3232
3333
3434#if !defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_SSE_INTRINSICS_) && !defined(_XM_VMX128_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
35- #if defined(_M_IX86) || defined(_M_AMD64 )
35+ #if defined(_M_IX86) || defined(_M_X64 )
3636#define _XM_SSE_INTRINSICS_
3737#elif defined(_M_PPCBE)
3838#define _XM_VMX128_INTRINSICS_
@@ -204,7 +204,7 @@ struct __vector4
204204#endif // _XM_NO_INTRINSICS_
205205
206206// ------------------------------------------------------------------------------
207- #if (defined (_M_IX86) || defined(_M_AMD64 ) || defined(_M_ARM)) && defined(_XM_NO_INTRINSICS_)
207+ #if (defined (_M_IX86) || defined(_M_X64 ) || defined(_M_ARM)) && defined(_XM_NO_INTRINSICS_)
208208typedef uint32_t __vector4i[4 ];
209209#else
210210typedef __declspec (align(16 )) uint32_t __vector4i[4];
@@ -338,7 +338,7 @@ typedef const XMMATRIX CXMMATRIX;
338338typedef const XMMATRIX& CXMMATRIX;
339339#endif
340340
341- #if (defined(_M_IX86) || defined(_M_AMD64 ) || defined(_M_ARM)) && defined(_XM_NO_INTRINSICS_)
341+ #if (defined(_M_IX86) || defined(_M_X64 ) || defined(_M_ARM)) && defined(_XM_NO_INTRINSICS_)
342342struct XMMATRIX
343343#else
344344__declspec (align(16 )) struct XMMATRIX
@@ -775,16 +775,31 @@ void XMStoreUInt3(_Out_ XMUINT3* pDestination, _In_ FXMVECTOR V);
775775
776776void XMStoreInt4 (_Out_writes_(4 ) uint32_t* pDestination, _In_ FXMVECTOR V);
777777void XMStoreInt4A (_Out_writes_(4 ) uint32_t* pDestination, _In_ FXMVECTOR V);
778+ // /begin_xbox360
779+ void XMStoreInt4NC (_Out_writes_(4 ) uint32_t* pDestination, _In_ FXMVECTOR V);
780+ // /end_xbox360
778781void XMStoreFloat4 (_Out_ XMFLOAT4* pDestination, _In_ FXMVECTOR V);
779782void XMStoreFloat4A (_Out_ XMFLOAT4A* pDestination, _In_ FXMVECTOR V);
783+ // /begin_xbox360
784+ void XMStoreFloat4NC (_Out_ XMFLOAT4* pDestination, _In_ FXMVECTOR V);
785+ // /end_xbox360
780786void XMStoreSInt4 (_Out_ XMINT4* pDestination, _In_ FXMVECTOR V);
781787void XMStoreUInt4 (_Out_ XMUINT4* pDestination, _In_ FXMVECTOR V);
782788
783789void XMStoreFloat3x3 (_Out_ XMFLOAT3X3* pDestination, _In_ CXMMATRIX M);
790+ // /begin_xbox360
791+ void XMStoreFloat3x3NC (_Out_ XMFLOAT3X3* pDestination, _In_ CXMMATRIX M);
792+ // /end_xbox360
784793void XMStoreFloat4x3 (_Out_ XMFLOAT4X3* pDestination, _In_ CXMMATRIX M);
785794void XMStoreFloat4x3A (_Out_ XMFLOAT4X3A* pDestination, _In_ CXMMATRIX M);
795+ // /begin_xbox360
796+ void XMStoreFloat4x3NC (_Out_ XMFLOAT4X3* pDestination, _In_ CXMMATRIX M);
797+ // /end_xbox360
786798void XMStoreFloat4x4 (_Out_ XMFLOAT4X4* pDestination, _In_ CXMMATRIX M);
787799void XMStoreFloat4x4A (_Out_ XMFLOAT4X4A* pDestination, _In_ CXMMATRIX M);
800+ // /begin_xbox360
801+ void XMStoreFloat4x4NC (_Out_ XMFLOAT4X4* pDestination, _In_ CXMMATRIX M);
802+ // /end_xbox360
788803
789804/* ***************************************************************************
790805 *
@@ -933,8 +948,21 @@ XMVECTOR XMVectorSqrtEst(FXMVECTOR V);
933948XMVECTOR XMVectorSqrt (FXMVECTOR V);
934949XMVECTOR XMVectorReciprocalSqrtEst (FXMVECTOR V);
935950XMVECTOR XMVectorReciprocalSqrt (FXMVECTOR V);
951+ // /begin_xbox360
952+ XMVECTOR XMVectorExpEst (FXMVECTOR V);
953+ // /end_xbox360
954+ XMVECTOR XMVectorExp2 (FXMVECTOR V);
955+ XMVECTOR XMVectorExpE (FXMVECTOR V);
936956XMVECTOR XMVectorExp (FXMVECTOR V);
957+ // /begin_xbox360
958+ XMVECTOR XMVectorLogEst (FXMVECTOR V);
959+ // /end_xbox360
960+ XMVECTOR XMVectorLog2 (FXMVECTOR V);
961+ XMVECTOR XMVectorLogE (FXMVECTOR V);
937962XMVECTOR XMVectorLog (FXMVECTOR V);
963+ // /begin_xbox360
964+ XMVECTOR XMVectorPowEst (FXMVECTOR V1, FXMVECTOR V2);
965+ // /end_xbox360
938966XMVECTOR XMVectorPow (FXMVECTOR V1, FXMVECTOR V2);
939967XMVECTOR XMVectorAbs (FXMVECTOR V);
940968XMVECTOR XMVectorMod (FXMVECTOR V1, FXMVECTOR V2);
@@ -948,8 +976,17 @@ void XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, _I
948976XMVECTOR XMVectorTan (FXMVECTOR V);
949977XMVECTOR XMVectorTanEst (FXMVECTOR V);
950978XMVECTOR XMVectorSinH (FXMVECTOR V);
979+ // /begin_xbox360
980+ XMVECTOR XMVectorSinHEst (FXMVECTOR V);
981+ // /end_xbox360
951982XMVECTOR XMVectorCosH (FXMVECTOR V);
983+ // /begin_xbox360
984+ XMVECTOR XMVectorCosHEst (FXMVECTOR V);
985+ // /end_xbox360
952986XMVECTOR XMVectorTanH (FXMVECTOR V);
987+ // /begin_xbox360
988+ XMVECTOR XMVectorTanHEst (FXMVECTOR V);
989+ // /end_xbox360
953990XMVECTOR XMVectorASin (FXMVECTOR V);
954991XMVECTOR XMVectorASinEst (FXMVECTOR V);
955992XMVECTOR XMVectorACos (FXMVECTOR V);
@@ -987,6 +1024,9 @@ uint32_t XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
9871024bool XMVector2Less (FXMVECTOR V1, FXMVECTOR V2);
9881025bool XMVector2LessOrEqual (FXMVECTOR V1, FXMVECTOR V2);
9891026bool XMVector2InBounds (FXMVECTOR V, FXMVECTOR Bounds);
1027+ // /begin_xbox360
1028+ uint32_t XMVector2InBoundsR (FXMVECTOR V, FXMVECTOR Bounds);
1029+ // /end_xbox360
9901030
9911031bool XMVector2IsNaN (FXMVECTOR V);
9921032bool XMVector2IsInfinite (FXMVECTOR V);
@@ -1016,6 +1056,12 @@ XMFLOAT4* XMVector2TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4)+Out
10161056 _In_ size_t OutputStride,
10171057 _In_reads_bytes_(sizeof (XMFLOAT2)+InputStride*(VectorCount-1 )) const XMFLOAT2* pInputStream,
10181058 _In_ size_t InputStride, _In_ size_t VectorCount, _In_ CXMMATRIX M);
1059+ // /begin_xbox360
1060+ XMFLOAT4* XMVector2TransformStreamNC (_Out_writes_bytes_(sizeof (XMFLOAT4)+OutputStride*(VectorCount-1 )) XMFLOAT4* pOutputStream,
1061+ _In_ size_t OutputStride,
1062+ _In_reads_bytes_(sizeof (XMFLOAT2)+InputStride*(VectorCount-1 )) const XMFLOAT2* pInputStream,
1063+ _In_ size_t InputStride, _In_ size_t VectorCount, _In_ CXMMATRIX M);
1064+ // /end_xbox360
10191065XMVECTOR XMVector2TransformCoord (FXMVECTOR V, CXMMATRIX M);
10201066XMFLOAT2* XMVector2TransformCoordStream (_Out_writes_bytes_(sizeof (XMFLOAT2)+OutputStride*(VectorCount-1 )) XMFLOAT2* pOutputStream,
10211067 _In_ size_t OutputStride,
@@ -1047,6 +1093,9 @@ uint32_t XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
10471093bool XMVector3Less (FXMVECTOR V1, FXMVECTOR V2);
10481094bool XMVector3LessOrEqual (FXMVECTOR V1, FXMVECTOR V2);
10491095bool XMVector3InBounds (FXMVECTOR V, FXMVECTOR Bounds);
1096+ // /begin_xbox360
1097+ uint32_t XMVector3InBoundsR (FXMVECTOR V, FXMVECTOR Bounds);
1098+ // /end_xbox360
10501099
10511100bool XMVector3IsNaN (FXMVECTOR V);
10521101bool XMVector3IsInfinite (FXMVECTOR V);
@@ -1078,6 +1127,12 @@ XMFLOAT4* XMVector3TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4)+Out
10781127 _In_ size_t OutputStride,
10791128 _In_reads_bytes_(sizeof (XMFLOAT3)+InputStride*(VectorCount-1 )) const XMFLOAT3* pInputStream,
10801129 _In_ size_t InputStride, _In_ size_t VectorCount, _In_ CXMMATRIX M);
1130+ // /begin_xbox360
1131+ XMFLOAT4* XMVector3TransformStreamNC (_Out_writes_bytes_(sizeof (XMFLOAT4)+OutputStride*(VectorCount-1 )) XMFLOAT4* pOutputStream,
1132+ _In_ size_t OutputStride,
1133+ _In_reads_bytes_(sizeof (XMFLOAT3)+InputStride*(VectorCount-1 )) const XMFLOAT3* pInputStream,
1134+ _In_ size_t InputStride, _In_ size_t VectorCount, _In_ CXMMATRIX M);
1135+ // /end_xbox360
10811136XMVECTOR XMVector3TransformCoord (FXMVECTOR V, CXMMATRIX M);
10821137XMFLOAT3* XMVector3TransformCoordStream (_Out_writes_bytes_(sizeof (XMFLOAT3)+OutputStride*(VectorCount-1 )) XMFLOAT3* pOutputStream,
10831138 _In_ size_t OutputStride,
@@ -1125,6 +1180,9 @@ uint32_t XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
11251180bool XMVector4Less (FXMVECTOR V1, FXMVECTOR V2);
11261181bool XMVector4LessOrEqual (FXMVECTOR V1, FXMVECTOR V2);
11271182bool XMVector4InBounds (FXMVECTOR V, FXMVECTOR Bounds);
1183+ // /begin_xbox360
1184+ uint32_t XMVector4InBoundsR (FXMVECTOR V, FXMVECTOR Bounds);
1185+ // /end_xbox360
11281186
11291187bool XMVector4IsNaN (FXMVECTOR V);
11301188bool XMVector4IsInfinite (FXMVECTOR V);
@@ -1368,6 +1426,12 @@ template<class T> inline T XMMax(T a, T b) { return (a > b) ? a : b; }
13681426
13691427#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
13701428
1429+ #if defined(_XM_NO_MOVNT_)
1430+ #define XM_STREAM_PS ( p, a ) _mm_store_ps( p, a )
1431+ #else
1432+ #define XM_STREAM_PS ( p, a ) _mm_stream_ps( p, a )
1433+ #endif
1434+
13711435#define XM_PERMUTE_PS ( v, c ) _mm_shuffle_ps( v, v, c )
13721436
13731437// PermuteHelper internal template (SSE only)
@@ -1452,6 +1516,7 @@ template<uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t Permu
14521516template <> inline XMVECTOR XMVectorPermute<0 ,1 ,2 ,3 >(FXMVECTOR V1, FXMVECTOR V2) { (V2); return V1; }
14531517template <> inline XMVECTOR XMVectorPermute<4 ,5 ,6 ,7 >(FXMVECTOR V1, FXMVECTOR V2) { (V1); return V2; }
14541518
1519+
14551520#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
14561521
14571522// If the indices are all in the range 0-3 or 4-7, then use XMVectorSwizzle instead
@@ -1705,6 +1770,24 @@ XMGLOBALCONST XMVECTORI32 g_XMFlipW = {0,0,0,0x80000000};
17051770XMGLOBALCONST XMVECTORI32 g_XMFlipYZ = {0 ,0x80000000 ,0x80000000 ,0 };
17061771XMGLOBALCONST XMVECTORI32 g_XMFlipZW = {0 ,0 ,0x80000000 ,0x80000000 };
17071772XMGLOBALCONST XMVECTORI32 g_XMFlipYW = {0 ,0x80000000 ,0 ,0x80000000 };
1773+ // /begin_xbox360
1774+ XMGLOBALCONST XMVECTORI32 g_XMMaskHenD3 = {0x7FF ,0x7ff <<11 ,0x3FF <<22 ,0 };
1775+ XMGLOBALCONST XMVECTORI32 g_XMMaskDHen3 = {0x3FF ,0x7ff <<10 ,0x7FF <<21 ,0 };
1776+ XMGLOBALCONST XMVECTORF32 g_XMAddUHenD3 = {0 ,0 ,32768 .0f *65536 .0f ,0 };
1777+ XMGLOBALCONST XMVECTORF32 g_XMAddHenD3 = {-1024 .0f ,-1024 .0f *2048 .0f ,0 ,0 };
1778+ XMGLOBALCONST XMVECTORF32 g_XMAddDHen3 = {-512 .0f ,-1024 .0f *1024 .0f ,0 ,0 };
1779+ XMGLOBALCONST XMVECTORF32 g_XMMulHenD3 = {1 .0f ,1 .0f /2048 .0f ,1 .0f /(2048 .0f *2048 .0f ),0 };
1780+ XMGLOBALCONST XMVECTORF32 g_XMMulDHen3 = {1 .0f ,1 .0f /1024 .0f ,1 .0f /(1024 .0f *2048 .0f ),0 };
1781+ XMGLOBALCONST XMVECTORI32 g_XMXorHenD3 = {0x400 ,0x400 <<11 ,0 ,0 };
1782+ XMGLOBALCONST XMVECTORI32 g_XMXorDHen3 = {0x200 ,0x400 <<10 ,0 ,0 };
1783+ XMGLOBALCONST XMVECTORI32 g_XMMaskIco4 = {0xFFFFF ,0xFFFFF000 ,0xFFFFF ,0xF0000000 };
1784+ XMGLOBALCONST XMVECTORI32 g_XMXorXIco4 = {0x80000 ,0 ,0x80000 ,0x80000000 };
1785+ XMGLOBALCONST XMVECTORI32 g_XMXorIco4 = {0x80000 ,0 ,0x80000 ,0 };
1786+ XMGLOBALCONST XMVECTORF32 g_XMAddXIco4 = {-8 .0f *65536 .0f ,0 ,-8 .0f *65536 .0f ,32768 .0f *65536 .0f };
1787+ XMGLOBALCONST XMVECTORF32 g_XMAddUIco4 = {0 ,32768 .0f *65536 .0f ,0 ,32768 .0f *65536 .0f };
1788+ XMGLOBALCONST XMVECTORF32 g_XMAddIco4 = {-8 .0f *65536 .0f ,0 ,-8 .0f *65536 .0f ,0 };
1789+ XMGLOBALCONST XMVECTORF32 g_XMMulIco4 = {1 .0f ,1 .0f /4096 .0f ,1 .0f ,1 .0f /(4096 .0f *65536 .0f )};
1790+ // /end_xbox360
17081791XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = {0x3FF ,0x3FF <<10 ,0x3FF <<20 ,0x3 <<30 };
17091792XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = {0x200 ,0x200 <<10 ,0x200 <<20 ,0 };
17101793XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = {0 ,0 ,0 ,32768 .0f *65536 .0f };
@@ -1720,6 +1803,15 @@ XMGLOBALCONST XMVECTORF32 g_XMUnsignedFix = {32768.0f*65536.0f,32768.0f*65
17201803XMGLOBALCONST XMVECTORF32 g_XMsrgbScale = { 12 .92f , 12 .92f , 12 .92f , 1 .0f };
17211804XMGLOBALCONST XMVECTORF32 g_XMsrgbA = { 0 .055f , 0 .055f , 0 .055f , 0 .0f };
17221805XMGLOBALCONST XMVECTORF32 g_XMsrgbA1 = { 1 .055f , 1 .055f , 1 .055f , 1 .0f };
1806+ XMGLOBALCONST XMVECTORI32 g_XMExponentBias = {127 , 127 , 127 , 127 };
1807+ XMGLOBALCONST XMVECTORI32 g_XMSubnormalExponent = {-126 , -126 , -126 , -126 };
1808+ XMGLOBALCONST XMVECTORI32 g_XMNumTrailing = {23 , 23 , 23 , 23 };
1809+ XMGLOBALCONST XMVECTORI32 g_XMMinNormal = {0x00800000 , 0x00800000 , 0x00800000 , 0x00800000 };
1810+ XMGLOBALCONST XMVECTORI32 g_XMNegInfinity = {0xFF800000 , 0xFF800000 , 0xFF800000 , 0xFF800000 };
1811+ XMGLOBALCONST XMVECTORI32 g_XMNegQNaN = {0xFFC00000 , 0xFFC00000 , 0xFFC00000 , 0xFFC00000 };
1812+ XMGLOBALCONST XMVECTORI32 g_XMBin128 = {0x43000000 , 0x43000000 , 0x43000000 , 0x43000000 };
1813+ XMGLOBALCONST XMVECTORI32 g_XMBinNeg150 = {0xC3160000 , 0xC3160000 , 0xC3160000 , 0xC3160000 };
1814+ XMGLOBALCONST XMVECTORI32 g_XM253 = {253 , 253 , 253 , 253 };
17231815
17241816/* ***************************************************************************
17251817 *
0 commit comments