Skip to content

Commit af1e6a1

Browse files
authored
Rename Internal namespace to MathInternal for some conformance issues (microsoft#190)
1 parent 4a4f18f commit af1e6a1

7 files changed

+188
-188
lines changed

Extensions/DirectXMathAVX.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, uint32_t Elements)
135135
// Permute Templates
136136
//-------------------------------------------------------------------------------------
137137

138-
namespace Internal
138+
namespace MathInternal
139139
{
140140
// Slow path fallback for permutes that do not map to a single SSE opcode.
141141
template<uint32_t Shuffle, bool WhichX, bool WhichY, bool WhichZ, bool WhichW> struct PermuteHelper
@@ -201,7 +201,7 @@ template<uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t Permu
201201
const bool WhichZ = PermuteZ > 3;
202202
const bool WhichW = PermuteW > 3;
203203

204-
return AVX::Internal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
204+
return AVX::MathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
205205
}
206206

207207
// Special-case permute templates

Extensions/DirectXMathAVX2.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ inline XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose
479479
// Permute Templates
480480
//-------------------------------------------------------------------------------------
481481

482-
namespace Internal
482+
namespace MathInternal
483483
{
484484
// Slow path fallback for permutes that do not map to a single SSE opcode.
485485
template<uint32_t Shuffle, bool WhichX, bool WhichY, bool WhichZ, bool WhichW> struct PermuteHelper
@@ -545,7 +545,7 @@ template<uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t Permu
545545
const bool WhichZ = PermuteZ > 3;
546546
const bool WhichW = PermuteW > 3;
547547

548-
return AVX2::Internal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
548+
return AVX2::MathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
549549
}
550550

551551
// Special-case permute templates

Inc/DirectXCollision.inl

+156-156
Large diffs are not rendered by default.

Inc/DirectXMath.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ namespace DirectX
17351735
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
17361736

17371737
// PermuteHelper internal template (SSE only)
1738-
namespace Internal
1738+
namespace MathInternal
17391739
{
17401740
// Slow path fallback for permutes that do not map to a single SSE shuffle opcode.
17411741
template<uint32_t Shuffle, bool WhichX, bool WhichY, bool WhichZ, bool WhichW> struct PermuteHelper
@@ -1804,7 +1804,7 @@ namespace DirectX
18041804
constexpr bool WhichZ = PermuteZ > 3;
18051805
constexpr bool WhichW = PermuteW > 3;
18061806

1807-
return Internal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
1807+
return MathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
18081808
#else
18091809

18101810
return XMVectorPermute(V1, V2, PermuteX, PermuteY, PermuteZ, PermuteW);

Inc/DirectXMathMisc.inl

+5-5
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ inline XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept
15611561

15621562
//------------------------------------------------------------------------------
15631563

1564-
namespace Internal
1564+
namespace MathInternal
15651565
{
15661566

15671567
inline XMVECTOR XM_CALLCONV XMColorHue2Clr(FXMVECTOR p, FXMVECTOR q, FXMVECTOR h) noexcept
@@ -1599,7 +1599,7 @@ namespace Internal
15991599
return p;
16001600
}
16011601

1602-
} // namespace Internal
1602+
} // namespace MathInternal
16031603

16041604
inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept
16051605
{
@@ -1629,9 +1629,9 @@ inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept
16291629

16301630
XMVECTOR p = XMVectorSubtract(XMVectorMultiply(g_XMTwo, l), q);
16311631

1632-
XMVECTOR r = DirectX::Internal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird));
1633-
XMVECTOR g = DirectX::Internal::XMColorHue2Clr(p, q, h);
1634-
XMVECTOR b = DirectX::Internal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird));
1632+
XMVECTOR r = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird));
1633+
XMVECTOR g = DirectX::MathInternal::XMColorHue2Clr(p, q, h);
1634+
XMVECTOR b = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird));
16351635

16361636
XMVECTOR rg = XMVectorSelect(g, r, g_XMSelect1000);
16371637
XMVECTOR ba = XMVectorSelect(hsl, b, g_XMSelect1110);

Inc/DirectXMathVector.inl

+18-18
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ inline XMVECTOR XM_CALLCONV XMVectorMax
22932293

22942294
//------------------------------------------------------------------------------
22952295

2296-
namespace Internal
2296+
namespace MathInternal
22972297
{
22982298
// Round to nearest (even) a.k.a. banker's rounding
22992299
inline float round_to_nearest(float x) noexcept
@@ -2326,10 +2326,10 @@ inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept
23262326
#if defined(_XM_NO_INTRINSICS_)
23272327

23282328
XMVECTORF32 Result = { { {
2329-
Internal::round_to_nearest(V.vector4_f32[0]),
2330-
Internal::round_to_nearest(V.vector4_f32[1]),
2331-
Internal::round_to_nearest(V.vector4_f32[2]),
2332-
Internal::round_to_nearest(V.vector4_f32[3])
2329+
MathInternal::round_to_nearest(V.vector4_f32[0]),
2330+
MathInternal::round_to_nearest(V.vector4_f32[1]),
2331+
MathInternal::round_to_nearest(V.vector4_f32[2]),
2332+
MathInternal::round_to_nearest(V.vector4_f32[3])
23332333
} } };
23342334
return Result.v;
23352335

@@ -3443,7 +3443,7 @@ inline XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept
34433443

34443444
#if defined(_XM_SSE_INTRINSICS_)
34453445

3446-
namespace Internal
3446+
namespace MathInternal
34473447
{
34483448
inline __m128i multi_sll_epi32(__m128i value, __m128i count) noexcept
34493449
{
@@ -3543,13 +3543,13 @@ namespace Internal
35433543
r = _mm_or_si128(r, s);
35443544
return r;
35453545
}
3546-
} // namespace Internal
3546+
} // namespace MathInternal
35473547

35483548
#endif // _XM_SSE_INTRINSICS_
35493549

35503550
#if defined(_XM_ARM_NEON_INTRINSICS_)
35513551

3552-
namespace Internal
3552+
namespace MathInternal
35533553
{
35543554
inline int32x4_t GetLeadingBit(const int32x4_t value) noexcept
35553555
{
@@ -3590,7 +3590,7 @@ namespace Internal
35903590
return r;
35913591
}
35923592

3593-
} // namespace Internal
3593+
} // namespace MathInternal
35943594

35953595
#endif
35963596

@@ -3617,7 +3617,7 @@ inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
36173617
int32x4_t trailingNor = trailing;
36183618

36193619
// Compute exponent and significand for subnormals.
3620-
int32x4_t leading = Internal::GetLeadingBit(trailing);
3620+
int32x4_t leading = MathInternal::GetLeadingBit(trailing);
36213621
int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading);
36223622
int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift);
36233623
int32x4_t trailingSub = vshlq_s32(trailing, shift);
@@ -3681,10 +3681,10 @@ inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
36813681
__m128i trailingNor = trailing;
36823682

36833683
// Compute exponent and significand for subnormals.
3684-
__m128i leading = Internal::GetLeadingBit(trailing);
3684+
__m128i leading = MathInternal::GetLeadingBit(trailing);
36853685
__m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading);
36863686
__m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift);
3687-
__m128i trailingSub = Internal::multi_sll_epi32(trailing, shift);
3687+
__m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift);
36883688
trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest);
36893689

36903690
__m128i select0 = _mm_and_si128(isExponentZero, exponentSub);
@@ -3777,7 +3777,7 @@ inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept
37773777
int32x4_t trailingNor = trailing;
37783778

37793779
// Compute exponent and significand for subnormals.
3780-
int32x4_t leading = Internal::GetLeadingBit(trailing);
3780+
int32x4_t leading = MathInternal::GetLeadingBit(trailing);
37813781
int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading);
37823782
int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift);
37833783
int32x4_t trailingSub = vshlq_s32(trailing, shift);
@@ -3843,10 +3843,10 @@ inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept
38433843
__m128i trailingNor = trailing;
38443844

38453845
// Compute exponent and significand for subnormals.
3846-
__m128i leading = Internal::GetLeadingBit(trailing);
3846+
__m128i leading = MathInternal::GetLeadingBit(trailing);
38473847
__m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading);
38483848
__m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift);
3849-
__m128i trailingSub = Internal::multi_sll_epi32(trailing, shift);
3849+
__m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift);
38503850
trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest);
38513851

38523852
__m128i select0 = _mm_and_si128(isExponentZero, exponentSub);
@@ -3941,7 +3941,7 @@ inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept
39413941
int32x4_t trailingNor = trailing;
39423942

39433943
// Compute exponent and significand for subnormals.
3944-
int32x4_t leading = Internal::GetLeadingBit(trailing);
3944+
int32x4_t leading = MathInternal::GetLeadingBit(trailing);
39453945
int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading);
39463946
int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift);
39473947
int32x4_t trailingSub = vshlq_s32(trailing, shift);
@@ -4007,10 +4007,10 @@ inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept
40074007
__m128i trailingNor = trailing;
40084008

40094009
// Compute exponent and significand for subnormals.
4010-
__m128i leading = Internal::GetLeadingBit(trailing);
4010+
__m128i leading = MathInternal::GetLeadingBit(trailing);
40114011
__m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading);
40124012
__m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift);
4013-
__m128i trailingSub = Internal::multi_sll_epi32(trailing, shift);
4013+
__m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift);
40144014
trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest);
40154015

40164016
__m128i select0 = _mm_and_si128(isExponentZero, exponentSub);

Inc/DirectXPackedVector.inl

+3-3
Original file line numberDiff line numberDiff line change
@@ -2644,9 +2644,9 @@ inline void XM_CALLCONV XMStoreFloat3SE
26442644
fi.i = static_cast<int32_t>(0x83000000 - (exp << 23));
26452645
float ScaleR = fi.f;
26462646

2647-
pDestination->xm = static_cast<uint32_t>(Internal::round_to_nearest(x * ScaleR));
2648-
pDestination->ym = static_cast<uint32_t>(Internal::round_to_nearest(y * ScaleR));
2649-
pDestination->zm = static_cast<uint32_t>(Internal::round_to_nearest(z * ScaleR));
2647+
pDestination->xm = static_cast<uint32_t>(MathInternal::round_to_nearest(x * ScaleR));
2648+
pDestination->ym = static_cast<uint32_t>(MathInternal::round_to_nearest(y * ScaleR));
2649+
pDestination->zm = static_cast<uint32_t>(MathInternal::round_to_nearest(z * ScaleR));
26502650
}
26512651

26522652
//------------------------------------------------------------------------------

0 commit comments

Comments
 (0)