mirror of
https://github.com/microsoft/DirectXMath
synced 2024-11-21 11:50:05 +00:00
Rename Internal namespace to MathInternal for some conformance issues (#190)
This commit is contained in:
parent
4a4f18f33f
commit
af1e6a1db5
@ -135,7 +135,7 @@ inline XMVECTOR XM_CALLCONV XMVectorRotateRight(FXMVECTOR V, uint32_t Elements)
|
||||
// Permute Templates
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
// Slow path fallback for permutes that do not map to a single SSE opcode.
|
||||
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
|
||||
const bool WhichZ = PermuteZ > 3;
|
||||
const bool WhichW = PermuteW > 3;
|
||||
|
||||
return AVX::Internal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
|
||||
return AVX::MathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
|
||||
}
|
||||
|
||||
// Special-case permute templates
|
||||
|
@ -479,7 +479,7 @@ inline XMMATRIX XM_CALLCONV XMMatrixMultiplyTranspose
|
||||
// Permute Templates
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
// Slow path fallback for permutes that do not map to a single SSE opcode.
|
||||
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
|
||||
const bool WhichZ = PermuteZ > 3;
|
||||
const bool WhichW = PermuteW > 3;
|
||||
|
||||
return AVX2::Internal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
|
||||
return AVX2::MathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
|
||||
}
|
||||
|
||||
// Special-case permute templates
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1735,7 +1735,7 @@ namespace DirectX
|
||||
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
|
||||
|
||||
// PermuteHelper internal template (SSE only)
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
// Slow path fallback for permutes that do not map to a single SSE shuffle opcode.
|
||||
template<uint32_t Shuffle, bool WhichX, bool WhichY, bool WhichZ, bool WhichW> struct PermuteHelper
|
||||
@ -1804,7 +1804,7 @@ namespace DirectX
|
||||
constexpr bool WhichZ = PermuteZ > 3;
|
||||
constexpr bool WhichW = PermuteW > 3;
|
||||
|
||||
return Internal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
|
||||
return MathInternal::PermuteHelper<Shuffle, WhichX, WhichY, WhichZ, WhichW>::Permute(V1, V2);
|
||||
#else
|
||||
|
||||
return XMVectorPermute(V1, V2, PermuteX, PermuteY, PermuteZ, PermuteW);
|
||||
|
@ -1561,7 +1561,7 @@ inline XMVECTOR XM_CALLCONV XMColorRGBToHSL(FXMVECTOR rgb) noexcept
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
|
||||
inline XMVECTOR XM_CALLCONV XMColorHue2Clr(FXMVECTOR p, FXMVECTOR q, FXMVECTOR h) noexcept
|
||||
@ -1599,7 +1599,7 @@ namespace Internal
|
||||
return p;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace MathInternal
|
||||
|
||||
inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept
|
||||
{
|
||||
@ -1629,9 +1629,9 @@ inline XMVECTOR XM_CALLCONV XMColorHSLToRGB(FXMVECTOR hsl) noexcept
|
||||
|
||||
XMVECTOR p = XMVectorSubtract(XMVectorMultiply(g_XMTwo, l), q);
|
||||
|
||||
XMVECTOR r = DirectX::Internal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird));
|
||||
XMVECTOR g = DirectX::Internal::XMColorHue2Clr(p, q, h);
|
||||
XMVECTOR b = DirectX::Internal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird));
|
||||
XMVECTOR r = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorAdd(h, oneThird));
|
||||
XMVECTOR g = DirectX::MathInternal::XMColorHue2Clr(p, q, h);
|
||||
XMVECTOR b = DirectX::MathInternal::XMColorHue2Clr(p, q, XMVectorSubtract(h, oneThird));
|
||||
|
||||
XMVECTOR rg = XMVectorSelect(g, r, g_XMSelect1000);
|
||||
XMVECTOR ba = XMVectorSelect(hsl, b, g_XMSelect1110);
|
||||
|
@ -2293,7 +2293,7 @@ inline XMVECTOR XM_CALLCONV XMVectorMax
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
// Round to nearest (even) a.k.a. banker's rounding
|
||||
inline float round_to_nearest(float x) noexcept
|
||||
@ -2326,10 +2326,10 @@ inline XMVECTOR XM_CALLCONV XMVectorRound(FXMVECTOR V) noexcept
|
||||
#if defined(_XM_NO_INTRINSICS_)
|
||||
|
||||
XMVECTORF32 Result = { { {
|
||||
Internal::round_to_nearest(V.vector4_f32[0]),
|
||||
Internal::round_to_nearest(V.vector4_f32[1]),
|
||||
Internal::round_to_nearest(V.vector4_f32[2]),
|
||||
Internal::round_to_nearest(V.vector4_f32[3])
|
||||
MathInternal::round_to_nearest(V.vector4_f32[0]),
|
||||
MathInternal::round_to_nearest(V.vector4_f32[1]),
|
||||
MathInternal::round_to_nearest(V.vector4_f32[2]),
|
||||
MathInternal::round_to_nearest(V.vector4_f32[3])
|
||||
} } };
|
||||
return Result.v;
|
||||
|
||||
@ -3443,7 +3443,7 @@ inline XMVECTOR XM_CALLCONV XMVectorExp(FXMVECTOR V) noexcept
|
||||
|
||||
#if defined(_XM_SSE_INTRINSICS_)
|
||||
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
inline __m128i multi_sll_epi32(__m128i value, __m128i count) noexcept
|
||||
{
|
||||
@ -3543,13 +3543,13 @@ namespace Internal
|
||||
r = _mm_or_si128(r, s);
|
||||
return r;
|
||||
}
|
||||
} // namespace Internal
|
||||
} // namespace MathInternal
|
||||
|
||||
#endif // _XM_SSE_INTRINSICS_
|
||||
|
||||
#if defined(_XM_ARM_NEON_INTRINSICS_)
|
||||
|
||||
namespace Internal
|
||||
namespace MathInternal
|
||||
{
|
||||
inline int32x4_t GetLeadingBit(const int32x4_t value) noexcept
|
||||
{
|
||||
@ -3590,7 +3590,7 @@ namespace Internal
|
||||
return r;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace MathInternal
|
||||
|
||||
#endif
|
||||
|
||||
@ -3617,7 +3617,7 @@ inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
|
||||
int32x4_t trailingNor = trailing;
|
||||
|
||||
// Compute exponent and significand for subnormals.
|
||||
int32x4_t leading = Internal::GetLeadingBit(trailing);
|
||||
int32x4_t leading = MathInternal::GetLeadingBit(trailing);
|
||||
int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading);
|
||||
int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift);
|
||||
int32x4_t trailingSub = vshlq_s32(trailing, shift);
|
||||
@ -3681,10 +3681,10 @@ inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
|
||||
__m128i trailingNor = trailing;
|
||||
|
||||
// Compute exponent and significand for subnormals.
|
||||
__m128i leading = Internal::GetLeadingBit(trailing);
|
||||
__m128i leading = MathInternal::GetLeadingBit(trailing);
|
||||
__m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading);
|
||||
__m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift);
|
||||
__m128i trailingSub = Internal::multi_sll_epi32(trailing, shift);
|
||||
__m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift);
|
||||
trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest);
|
||||
|
||||
__m128i select0 = _mm_and_si128(isExponentZero, exponentSub);
|
||||
@ -3777,7 +3777,7 @@ inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept
|
||||
int32x4_t trailingNor = trailing;
|
||||
|
||||
// Compute exponent and significand for subnormals.
|
||||
int32x4_t leading = Internal::GetLeadingBit(trailing);
|
||||
int32x4_t leading = MathInternal::GetLeadingBit(trailing);
|
||||
int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading);
|
||||
int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift);
|
||||
int32x4_t trailingSub = vshlq_s32(trailing, shift);
|
||||
@ -3843,10 +3843,10 @@ inline XMVECTOR XM_CALLCONV XMVectorLog10(FXMVECTOR V) noexcept
|
||||
__m128i trailingNor = trailing;
|
||||
|
||||
// Compute exponent and significand for subnormals.
|
||||
__m128i leading = Internal::GetLeadingBit(trailing);
|
||||
__m128i leading = MathInternal::GetLeadingBit(trailing);
|
||||
__m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading);
|
||||
__m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift);
|
||||
__m128i trailingSub = Internal::multi_sll_epi32(trailing, shift);
|
||||
__m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift);
|
||||
trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest);
|
||||
|
||||
__m128i select0 = _mm_and_si128(isExponentZero, exponentSub);
|
||||
@ -3941,7 +3941,7 @@ inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept
|
||||
int32x4_t trailingNor = trailing;
|
||||
|
||||
// Compute exponent and significand for subnormals.
|
||||
int32x4_t leading = Internal::GetLeadingBit(trailing);
|
||||
int32x4_t leading = MathInternal::GetLeadingBit(trailing);
|
||||
int32x4_t shift = vsubq_s32(g_XMNumTrailing, leading);
|
||||
int32x4_t exponentSub = vsubq_s32(g_XMSubnormalExponent, shift);
|
||||
int32x4_t trailingSub = vshlq_s32(trailing, shift);
|
||||
@ -4007,10 +4007,10 @@ inline XMVECTOR XM_CALLCONV XMVectorLogE(FXMVECTOR V) noexcept
|
||||
__m128i trailingNor = trailing;
|
||||
|
||||
// Compute exponent and significand for subnormals.
|
||||
__m128i leading = Internal::GetLeadingBit(trailing);
|
||||
__m128i leading = MathInternal::GetLeadingBit(trailing);
|
||||
__m128i shift = _mm_sub_epi32(g_XMNumTrailing, leading);
|
||||
__m128i exponentSub = _mm_sub_epi32(g_XMSubnormalExponent, shift);
|
||||
__m128i trailingSub = Internal::multi_sll_epi32(trailing, shift);
|
||||
__m128i trailingSub = MathInternal::multi_sll_epi32(trailing, shift);
|
||||
trailingSub = _mm_and_si128(trailingSub, g_XMQNaNTest);
|
||||
|
||||
__m128i select0 = _mm_and_si128(isExponentZero, exponentSub);
|
||||
|
@ -2644,9 +2644,9 @@ inline void XM_CALLCONV XMStoreFloat3SE
|
||||
fi.i = static_cast<int32_t>(0x83000000 - (exp << 23));
|
||||
float ScaleR = fi.f;
|
||||
|
||||
pDestination->xm = static_cast<uint32_t>(Internal::round_to_nearest(x * ScaleR));
|
||||
pDestination->ym = static_cast<uint32_t>(Internal::round_to_nearest(y * ScaleR));
|
||||
pDestination->zm = static_cast<uint32_t>(Internal::round_to_nearest(z * ScaleR));
|
||||
pDestination->xm = static_cast<uint32_t>(MathInternal::round_to_nearest(x * ScaleR));
|
||||
pDestination->ym = static_cast<uint32_t>(MathInternal::round_to_nearest(y * ScaleR));
|
||||
pDestination->zm = static_cast<uint32_t>(MathInternal::round_to_nearest(z * ScaleR));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user