17
17
#error DirectX Math requires C++
18
18
#endif
19
19
20
- #define DIRECTX_MATH_VERSION 303
20
+ #define DIRECTX_MATH_VERSION 304
21
21
22
22
#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)
24
24
#define _XM_LITTLEENDIAN_
25
25
#elif defined(_M_PPCBE)
26
26
#define _XM_BIGENDIAN_
32
32
33
33
34
34
#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 )
36
36
#define _XM_SSE_INTRINSICS_
37
37
#elif defined(_M_PPCBE)
38
38
#define _XM_VMX128_INTRINSICS_
@@ -204,7 +204,7 @@ struct __vector4
204
204
#endif // _XM_NO_INTRINSICS_
205
205
206
206
// ------------------------------------------------------------------------------
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_)
208
208
typedef uint32_t __vector4i[4 ];
209
209
#else
210
210
typedef __declspec (align(16 )) uint32_t __vector4i[4];
@@ -338,7 +338,7 @@ typedef const XMMATRIX CXMMATRIX;
338
338
typedef const XMMATRIX& CXMMATRIX;
339
339
#endif
340
340
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_)
342
342
struct XMMATRIX
343
343
#else
344
344
__declspec (align(16 )) struct XMMATRIX
@@ -775,16 +775,31 @@ void XMStoreUInt3(_Out_ XMUINT3* pDestination, _In_ FXMVECTOR V);
775
775
776
776
void XMStoreInt4 (_Out_writes_(4 ) uint32_t* pDestination, _In_ FXMVECTOR V);
777
777
void 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
778
781
void XMStoreFloat4 (_Out_ XMFLOAT4* pDestination, _In_ FXMVECTOR V);
779
782
void XMStoreFloat4A (_Out_ XMFLOAT4A* pDestination, _In_ FXMVECTOR V);
783
+ // /begin_xbox360
784
+ void XMStoreFloat4NC (_Out_ XMFLOAT4* pDestination, _In_ FXMVECTOR V);
785
+ // /end_xbox360
780
786
void XMStoreSInt4 (_Out_ XMINT4* pDestination, _In_ FXMVECTOR V);
781
787
void XMStoreUInt4 (_Out_ XMUINT4* pDestination, _In_ FXMVECTOR V);
782
788
783
789
void XMStoreFloat3x3 (_Out_ XMFLOAT3X3* pDestination, _In_ CXMMATRIX M);
790
+ // /begin_xbox360
791
+ void XMStoreFloat3x3NC (_Out_ XMFLOAT3X3* pDestination, _In_ CXMMATRIX M);
792
+ // /end_xbox360
784
793
void XMStoreFloat4x3 (_Out_ XMFLOAT4X3* pDestination, _In_ CXMMATRIX M);
785
794
void XMStoreFloat4x3A (_Out_ XMFLOAT4X3A* pDestination, _In_ CXMMATRIX M);
795
+ // /begin_xbox360
796
+ void XMStoreFloat4x3NC (_Out_ XMFLOAT4X3* pDestination, _In_ CXMMATRIX M);
797
+ // /end_xbox360
786
798
void XMStoreFloat4x4 (_Out_ XMFLOAT4X4* pDestination, _In_ CXMMATRIX M);
787
799
void XMStoreFloat4x4A (_Out_ XMFLOAT4X4A* pDestination, _In_ CXMMATRIX M);
800
+ // /begin_xbox360
801
+ void XMStoreFloat4x4NC (_Out_ XMFLOAT4X4* pDestination, _In_ CXMMATRIX M);
802
+ // /end_xbox360
788
803
789
804
/* ***************************************************************************
790
805
*
@@ -933,8 +948,21 @@ XMVECTOR XMVectorSqrtEst(FXMVECTOR V);
933
948
XMVECTOR XMVectorSqrt (FXMVECTOR V);
934
949
XMVECTOR XMVectorReciprocalSqrtEst (FXMVECTOR V);
935
950
XMVECTOR XMVectorReciprocalSqrt (FXMVECTOR V);
951
+ // /begin_xbox360
952
+ XMVECTOR XMVectorExpEst (FXMVECTOR V);
953
+ // /end_xbox360
954
+ XMVECTOR XMVectorExp2 (FXMVECTOR V);
955
+ XMVECTOR XMVectorExpE (FXMVECTOR V);
936
956
XMVECTOR XMVectorExp (FXMVECTOR V);
957
+ // /begin_xbox360
958
+ XMVECTOR XMVectorLogEst (FXMVECTOR V);
959
+ // /end_xbox360
960
+ XMVECTOR XMVectorLog2 (FXMVECTOR V);
961
+ XMVECTOR XMVectorLogE (FXMVECTOR V);
937
962
XMVECTOR XMVectorLog (FXMVECTOR V);
963
+ // /begin_xbox360
964
+ XMVECTOR XMVectorPowEst (FXMVECTOR V1, FXMVECTOR V2);
965
+ // /end_xbox360
938
966
XMVECTOR XMVectorPow (FXMVECTOR V1, FXMVECTOR V2);
939
967
XMVECTOR XMVectorAbs (FXMVECTOR V);
940
968
XMVECTOR XMVectorMod (FXMVECTOR V1, FXMVECTOR V2);
@@ -948,8 +976,17 @@ void XMVectorSinCosEst(_Out_ XMVECTOR* pSin, _Out_ XMVECTOR* pCos, _I
948
976
XMVECTOR XMVectorTan (FXMVECTOR V);
949
977
XMVECTOR XMVectorTanEst (FXMVECTOR V);
950
978
XMVECTOR XMVectorSinH (FXMVECTOR V);
979
+ // /begin_xbox360
980
+ XMVECTOR XMVectorSinHEst (FXMVECTOR V);
981
+ // /end_xbox360
951
982
XMVECTOR XMVectorCosH (FXMVECTOR V);
983
+ // /begin_xbox360
984
+ XMVECTOR XMVectorCosHEst (FXMVECTOR V);
985
+ // /end_xbox360
952
986
XMVECTOR XMVectorTanH (FXMVECTOR V);
987
+ // /begin_xbox360
988
+ XMVECTOR XMVectorTanHEst (FXMVECTOR V);
989
+ // /end_xbox360
953
990
XMVECTOR XMVectorASin (FXMVECTOR V);
954
991
XMVECTOR XMVectorASinEst (FXMVECTOR V);
955
992
XMVECTOR XMVectorACos (FXMVECTOR V);
@@ -987,6 +1024,9 @@ uint32_t XMVector2GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
987
1024
bool XMVector2Less (FXMVECTOR V1, FXMVECTOR V2);
988
1025
bool XMVector2LessOrEqual (FXMVECTOR V1, FXMVECTOR V2);
989
1026
bool XMVector2InBounds (FXMVECTOR V, FXMVECTOR Bounds);
1027
+ // /begin_xbox360
1028
+ uint32_t XMVector2InBoundsR (FXMVECTOR V, FXMVECTOR Bounds);
1029
+ // /end_xbox360
990
1030
991
1031
bool XMVector2IsNaN (FXMVECTOR V);
992
1032
bool XMVector2IsInfinite (FXMVECTOR V);
@@ -1016,6 +1056,12 @@ XMFLOAT4* XMVector2TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4)+Out
1016
1056
_In_ size_t OutputStride,
1017
1057
_In_reads_bytes_(sizeof (XMFLOAT2)+InputStride*(VectorCount-1 )) const XMFLOAT2* pInputStream,
1018
1058
_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
1019
1065
XMVECTOR XMVector2TransformCoord (FXMVECTOR V, CXMMATRIX M);
1020
1066
XMFLOAT2* XMVector2TransformCoordStream (_Out_writes_bytes_(sizeof (XMFLOAT2)+OutputStride*(VectorCount-1 )) XMFLOAT2* pOutputStream,
1021
1067
_In_ size_t OutputStride,
@@ -1047,6 +1093,9 @@ uint32_t XMVector3GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
1047
1093
bool XMVector3Less (FXMVECTOR V1, FXMVECTOR V2);
1048
1094
bool XMVector3LessOrEqual (FXMVECTOR V1, FXMVECTOR V2);
1049
1095
bool XMVector3InBounds (FXMVECTOR V, FXMVECTOR Bounds);
1096
+ // /begin_xbox360
1097
+ uint32_t XMVector3InBoundsR (FXMVECTOR V, FXMVECTOR Bounds);
1098
+ // /end_xbox360
1050
1099
1051
1100
bool XMVector3IsNaN (FXMVECTOR V);
1052
1101
bool XMVector3IsInfinite (FXMVECTOR V);
@@ -1078,6 +1127,12 @@ XMFLOAT4* XMVector3TransformStream(_Out_writes_bytes_(sizeof(XMFLOAT4)+Out
1078
1127
_In_ size_t OutputStride,
1079
1128
_In_reads_bytes_(sizeof (XMFLOAT3)+InputStride*(VectorCount-1 )) const XMFLOAT3* pInputStream,
1080
1129
_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
1081
1136
XMVECTOR XMVector3TransformCoord (FXMVECTOR V, CXMMATRIX M);
1082
1137
XMFLOAT3* XMVector3TransformCoordStream (_Out_writes_bytes_(sizeof (XMFLOAT3)+OutputStride*(VectorCount-1 )) XMFLOAT3* pOutputStream,
1083
1138
_In_ size_t OutputStride,
@@ -1125,6 +1180,9 @@ uint32_t XMVector4GreaterOrEqualR(FXMVECTOR V1, FXMVECTOR V2);
1125
1180
bool XMVector4Less (FXMVECTOR V1, FXMVECTOR V2);
1126
1181
bool XMVector4LessOrEqual (FXMVECTOR V1, FXMVECTOR V2);
1127
1182
bool XMVector4InBounds (FXMVECTOR V, FXMVECTOR Bounds);
1183
+ // /begin_xbox360
1184
+ uint32_t XMVector4InBoundsR (FXMVECTOR V, FXMVECTOR Bounds);
1185
+ // /end_xbox360
1128
1186
1129
1187
bool XMVector4IsNaN (FXMVECTOR V);
1130
1188
bool XMVector4IsInfinite (FXMVECTOR V);
@@ -1368,6 +1426,12 @@ template<class T> inline T XMMax(T a, T b) { return (a > b) ? a : b; }
1368
1426
1369
1427
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
1370
1428
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
+
1371
1435
#define XM_PERMUTE_PS ( v, c ) _mm_shuffle_ps( v, v, c )
1372
1436
1373
1437
// PermuteHelper internal template (SSE only)
@@ -1452,6 +1516,7 @@ template<uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t Permu
1452
1516
template <> inline XMVECTOR XMVectorPermute<0 ,1 ,2 ,3 >(FXMVECTOR V1, FXMVECTOR V2) { (V2); return V1; }
1453
1517
template <> inline XMVECTOR XMVectorPermute<4 ,5 ,6 ,7 >(FXMVECTOR V1, FXMVECTOR V2) { (V1); return V2; }
1454
1518
1519
+
1455
1520
#if defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
1456
1521
1457
1522
// 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};
1705
1770
XMGLOBALCONST XMVECTORI32 g_XMFlipYZ = {0 ,0x80000000 ,0x80000000 ,0 };
1706
1771
XMGLOBALCONST XMVECTORI32 g_XMFlipZW = {0 ,0 ,0x80000000 ,0x80000000 };
1707
1772
XMGLOBALCONST 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
1708
1791
XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = {0x3FF ,0x3FF <<10 ,0x3FF <<20 ,0x3 <<30 };
1709
1792
XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = {0x200 ,0x200 <<10 ,0x200 <<20 ,0 };
1710
1793
XMGLOBALCONST 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
1720
1803
XMGLOBALCONST XMVECTORF32 g_XMsrgbScale = { 12 .92f , 12 .92f , 12 .92f , 1 .0f };
1721
1804
XMGLOBALCONST XMVECTORF32 g_XMsrgbA = { 0 .055f , 0 .055f , 0 .055f , 0 .0f };
1722
1805
XMGLOBALCONST 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 };
1723
1815
1724
1816
/* ***************************************************************************
1725
1817
*
0 commit comments