Skip to content

Commit 0d82178

Browse files
authored
October 2024 (#214)
1 parent c477795 commit 0d82178

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Release available for download on [GitHub](https://github.com/microsoft/DirectXM
66

77
## Release History
88

9+
### October 2024 (3.20)
10+
* Fixed close-to-zero bug in the implementation of `TriangleTests::Intersects`
11+
* Renamed implementation namespace from `DirectX::Internal` to `DirectX::MathInternal` to avoid some conformance issues with other libraries
12+
* CMake project updates including support for ARM64EC
13+
* Added GitHub Actions YAML files
14+
915
### February 2024 (3.19)
1016
* Fix to address MinGW issue with ``__cpuid`` in cpuid.h vs. intrin.h
1117
* Additional updates for clang/LLVM and GNUC

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
cmake_minimum_required (VERSION 3.20)
55

6-
set(DIRECTXMATH_VERSION 3.19)
6+
set(DIRECTXMATH_VERSION 3.20)
77

88
project(DirectXMath
99
VERSION ${DIRECTXMATH_VERSION}

Inc/DirectXMath.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#error DirectX Math requires C++
1414
#endif
1515

16-
#define DIRECTX_MATH_VERSION 319
16+
#define DIRECTX_MATH_VERSION 320
1717

1818
#if defined(_MSC_VER) && (_MSC_VER < 1910)
1919
#error DirectX Math requires Visual C++ 2017 or later.
@@ -338,7 +338,7 @@ namespace DirectX
338338
*
339339
****************************************************************************/
340340

341-
#ifdef _MSC_VER
341+
#ifdef _MSC_VER
342342
#pragma warning(push)
343343
#pragma warning(disable:4068 4201 4365 4324 4820)
344344
// C4068: ignore unknown pragmas
@@ -2156,15 +2156,15 @@ namespace DirectX
21562156
*
21572157
****************************************************************************/
21582158

2159-
#ifdef _MSC_VER
2159+
#ifdef _MSC_VER
21602160
#pragma warning(push)
21612161
#pragma warning(disable:4068 4214 4204 4365 4616 4640 6001 6101)
21622162
// C4068/4616: ignore unknown pragmas
21632163
// C4214/4204: nonstandard extension used
21642164
// C4365/4640: Off by default noise
21652165
// C6001/6101: False positives
21662166
#endif
2167-
2167+
21682168
#ifdef _PREFAST_
21692169
#pragma prefast(push)
21702170
#pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes")
@@ -2281,7 +2281,7 @@ namespace DirectX
22812281
#ifdef _PREFAST_
22822282
#pragma prefast(pop)
22832283
#endif
2284-
#ifdef _MSC_VER
2284+
#ifdef _MSC_VER
22852285
#pragma warning(pop)
22862286
#endif
22872287

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://github.com/Microsoft/DirectXMath
66

77
Copyright (c) Microsoft Corporation.
88

9-
**February 2024**
9+
**October 2024**
1010

1111
This package contains the DirectXMath library, an all inline SIMD C++ linear algebra library for use in games and graphics apps.
1212

XDSP/XDSP.h

+16-14
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace XDSP
4141
using CXMVECTOR = DirectX::CXMVECTOR;
4242
using XMFLOAT4A = DirectX::XMFLOAT4A;
4343

44-
inline bool ISPOWEROF2(size_t n) { return (((n)&((n)-1)) == 0 && (n) != 0); }
44+
constexpr bool ISPOWEROF2(size_t n) { return (((n)&((n)-1)) == 0 && (n) != 0); }
4545

4646
// Parallel multiplication of four complex numbers, assuming real and imaginary values are stored in separate vectors.
4747
inline void XM_CALLCONV vmulComplex(
@@ -457,42 +457,44 @@ namespace XDSP
457457
// pUnityTable[0 to uLength*4-1] contains real components for current FFT length
458458
// pUnityTable[uLength*4 to uLength*8-1] contains imaginary components for current FFT length
459459
static const XMVECTORF32 vXM0123 = { { { 0.0f, 1.0f, 2.0f, 3.0f } } };
460-
uLength >>= 2;
461-
XMVECTOR vlStep = XMVectorReplicate(XM_PIDIV2 / float(uLength));
460+
461+
size_t len = uLength;
462+
len >>= 2;
463+
XMVECTOR vlStep = XMVectorReplicate(XM_PIDIV2 / float(len));
462464
do
463465
{
464-
uLength >>= 2;
466+
len >>= 2;
465467
XMVECTOR vJP = vXM0123;
466-
for (size_t j = 0; j < uLength; ++j)
468+
for (size_t j = 0; j < len; ++j)
467469
{
468470
XMVECTOR vSin, vCos;
469471
XMVECTOR viJP, vlS;
470472

471473
pUnityTable[j] = g_XMOne;
472-
pUnityTable[j + uLength * 4] = XMVectorZero();
474+
pUnityTable[j + len * 4] = XMVectorZero();
473475

474476
vlS = XMVectorMultiply(vJP, vlStep);
475477
XMVectorSinCos(&vSin, &vCos, vlS);
476-
pUnityTable[j + uLength] = vCos;
477-
pUnityTable[j + uLength * 5] = XMVectorMultiply(vSin, g_XMNegativeOne);
478+
pUnityTable[j + len] = vCos;
479+
pUnityTable[j + len * 5] = XMVectorMultiply(vSin, g_XMNegativeOne);
478480

479481
viJP = XMVectorAdd(vJP, vJP);
480482
vlS = XMVectorMultiply(viJP, vlStep);
481483
XMVectorSinCos(&vSin, &vCos, vlS);
482-
pUnityTable[j + uLength * 2] = vCos;
483-
pUnityTable[j + uLength * 6] = XMVectorMultiply(vSin, g_XMNegativeOne);
484+
pUnityTable[j + len * 2] = vCos;
485+
pUnityTable[j + len * 6] = XMVectorMultiply(vSin, g_XMNegativeOne);
484486

485487
viJP = XMVectorAdd(viJP, vJP);
486488
vlS = XMVectorMultiply(viJP, vlStep);
487489
XMVectorSinCos(&vSin, &vCos, vlS);
488-
pUnityTable[j + uLength * 3] = vCos;
489-
pUnityTable[j + uLength * 7] = XMVectorMultiply(vSin, g_XMNegativeOne);
490+
pUnityTable[j + len * 3] = vCos;
491+
pUnityTable[j + len * 7] = XMVectorMultiply(vSin, g_XMNegativeOne);
490492

491493
vJP = XMVectorAdd(vJP, g_XMFour);
492494
}
493495
vlStep = XMVectorMultiply(vlStep, g_XMFour);
494-
pUnityTable += uLength * 8;
495-
} while (uLength > 4);
496+
pUnityTable += len * 8;
497+
} while (len > 4);
496498
}
497499

498500
//----------------------------------------------------------------------------------

0 commit comments

Comments
 (0)