1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-25 05:30:04 +00:00

Fixed conformance warnings based on clang (#75)

This commit is contained in:
Chuck Walbourn 2018-06-26 13:45:31 -07:00 committed by GitHub
parent 2e08f92a3c
commit 6883c5518a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 516 additions and 493 deletions

View File

@ -18,14 +18,14 @@ enum ContainmentType
{ {
DISJOINT = 0, DISJOINT = 0,
INTERSECTS = 1, INTERSECTS = 1,
CONTAINS = 2, CONTAINS = 2
}; };
enum PlaneIntersectionType enum PlaneIntersectionType
{ {
FRONT = 0, FRONT = 0,
INTERSECTING = 1, INTERSECTING = 1,
BACK = 2, BACK = 2
}; };
struct BoundingBox; struct BoundingBox;
@ -319,7 +319,7 @@ namespace TriangleTests
_In_ GXMVECTOR Plane0, _In_ HXMVECTOR Plane1, _In_ HXMVECTOR Plane2, _In_ GXMVECTOR Plane0, _In_ HXMVECTOR Plane1, _In_ HXMVECTOR Plane2,
_In_ CXMVECTOR Plane3, _In_ CXMVECTOR Plane4, _In_ CXMVECTOR Plane5 ); _In_ CXMVECTOR Plane3, _In_ CXMVECTOR Plane4, _In_ CXMVECTOR Plane5 );
// Test a triangle against six planes at once (see BoundingFrustum::GetPlanes) // Test a triangle against six planes at once (see BoundingFrustum::GetPlanes)
}; }
#pragma warning(pop) #pragma warning(pop)

View File

@ -192,9 +192,9 @@ inline XMVECTOR CalculateEigenVector( _In_ float m11, _In_ float m12, _In_ float
_In_ float m22, _In_ float m23, _In_ float m33, _In_ float e ) _In_ float m22, _In_ float m23, _In_ float m33, _In_ float e )
{ {
float fTmp[3]; float fTmp[3];
fTmp[0] = ( float )( m12 * m23 - m13 * ( m22 - e ) ); fTmp[0] = m12 * m23 - m13 * ( m22 - e );
fTmp[1] = ( float )( m13 * m12 - m23 * ( m11 - e ) ); fTmp[1] = m13 * m12 - m23 * ( m11 - e );
fTmp[2] = ( float )( ( m11 - e ) * ( m22 - e ) - m12 * m12 ); fTmp[2] = ( m11 - e ) * ( m22 - e ) - m12 * m12;
XMVECTOR vTmp = XMLoadFloat3( reinterpret_cast<const XMFLOAT3*>(fTmp) ); XMVECTOR vTmp = XMLoadFloat3( reinterpret_cast<const XMFLOAT3*>(fTmp) );
@ -236,11 +236,11 @@ inline XMVECTOR CalculateEigenVector( _In_ float m11, _In_ float m12, _In_ float
vTmp = XMVectorSetZ( vTmp, 0.0f ); vTmp = XMVectorSetZ( vTmp, 0.0f );
// recalculate y to make equation work // recalculate y to make equation work
if( m12 != 0 ) if( m12 != 0 )
vTmp = XMVectorSetY( vTmp, ( float )( -f1 / f2 ) ); vTmp = XMVectorSetY( vTmp, -f1 / f2 );
} }
else else
{ {
vTmp = XMVectorSetZ( vTmp, ( float )( ( f2 - f1 ) / f3 ) ); vTmp = XMVectorSetZ( vTmp, ( f2 - f1 ) / f3 );
} }
} }
@ -2006,7 +2006,7 @@ inline void XM_CALLCONV BoundingOrientedBox::Transform( BoundingOrientedBox& Out
_Use_decl_annotations_ _Use_decl_annotations_
inline void BoundingOrientedBox::GetCorners( XMFLOAT3* Corners ) const inline void BoundingOrientedBox::GetCorners( XMFLOAT3* Corners ) const
{ {
assert( Corners != 0 ); assert( Corners != nullptr );
// Load the box // Load the box
XMVECTOR vCenter = XMLoadFloat3( &Center ); XMVECTOR vCenter = XMLoadFloat3( &Center );
@ -2698,7 +2698,7 @@ _Use_decl_annotations_
inline void BoundingOrientedBox::CreateFromPoints( BoundingOrientedBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride ) inline void BoundingOrientedBox::CreateFromPoints( BoundingOrientedBox& Out, size_t Count, const XMFLOAT3* pPoints, size_t Stride )
{ {
assert( Count > 0 ); assert( Count > 0 );
assert( pPoints != 0 ); assert( pPoints != nullptr );
XMVECTOR CenterOfMass = XMVectorZero(); XMVECTOR CenterOfMass = XMVectorZero();
@ -2895,7 +2895,7 @@ inline void XM_CALLCONV BoundingFrustum::Transform( BoundingFrustum& Out, float
_Use_decl_annotations_ _Use_decl_annotations_
inline void BoundingFrustum::GetCorners( XMFLOAT3* Corners ) const inline void BoundingFrustum::GetCorners( XMFLOAT3* Corners ) const
{ {
assert( Corners != 0 ); assert( Corners != nullptr );
// Load origin and orientation of the frustum. // Load origin and orientation of the frustum.
XMVECTOR vOrigin = XMLoadFloat3( &Origin ); XMVECTOR vOrigin = XMLoadFloat3( &Origin );

View File

@ -1666,7 +1666,7 @@ namespace Internal
{ {
static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) { return _mm_shuffle_ps(v2, v1, Shuffle); } static XMVECTOR XM_CALLCONV Permute(FXMVECTOR v1, FXMVECTOR v2) { return _mm_shuffle_ps(v2, v1, Shuffle); }
}; };
}; }
#endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_ #endif // _XM_SSE_INTRINSICS_ && !_XM_NO_INTRINSICS_
@ -1944,12 +1944,12 @@ XMGLOBALCONST XMVECTORI32 g_XMFltMax = { { { 0x7F7FFFFF, 0x7F7FFF
XMGLOBALCONST XMVECTORU32 g_XMNegOneMask = { { { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF } } }; XMGLOBALCONST XMVECTORU32 g_XMNegOneMask = { { { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF } } };
XMGLOBALCONST XMVECTORU32 g_XMMaskA8R8G8B8 = { { { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMMaskA8R8G8B8 = { { { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 } } };
XMGLOBALCONST XMVECTORU32 g_XMFlipA8R8G8B8 = { { { 0x00000000, 0x00000000, 0x00000000, 0x80000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMFlipA8R8G8B8 = { { { 0x00000000, 0x00000000, 0x00000000, 0x80000000 } } };
XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = { { { 0.0f, 0.0f, 0.0f, (float) (0x80000000U) } } }; XMGLOBALCONST XMVECTORF32 g_XMFixAA8R8G8B8 = { { { 0.0f, 0.0f, 0.0f, float(0x80000000U) } } };
XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = { { { 1.0f / (255.0f*(float) (0x10000)), 1.0f / (255.0f*(float) (0x100)), 1.0f / 255.0f, 1.0f / (255.0f*(float) (0x1000000)) } } }; XMGLOBALCONST XMVECTORF32 g_XMNormalizeA8R8G8B8 = { { { 1.0f / (255.0f*float(0x10000)), 1.0f / (255.0f*float(0x100)), 1.0f / 255.0f, 1.0f / (255.0f*float(0x1000000)) } } };
XMGLOBALCONST XMVECTORU32 g_XMMaskA2B10G10R10 = { { { 0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMMaskA2B10G10R10 = { { { 0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000 } } };
XMGLOBALCONST XMVECTORU32 g_XMFlipA2B10G10R10 = { { { 0x00000200, 0x00080000, 0x20000000, 0x80000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMFlipA2B10G10R10 = { { { 0x00000200, 0x00080000, 0x20000000, 0x80000000 } } };
XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = { { { -512.0f, -512.0f*(float) (0x400), -512.0f*(float) (0x100000), (float) (0x80000000U) } } }; XMGLOBALCONST XMVECTORF32 g_XMFixAA2B10G10R10 = { { { -512.0f, -512.0f*float(0x400), -512.0f*float(0x100000), float(0x80000000U) } } };
XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = { { { 1.0f / 511.0f, 1.0f / (511.0f*(float) (0x400)), 1.0f / (511.0f*(float) (0x100000)), 1.0f / (3.0f*(float) (0x40000000)) } } }; XMGLOBALCONST XMVECTORF32 g_XMNormalizeA2B10G10R10 = { { { 1.0f / 511.0f, 1.0f / (511.0f*float(0x400)), 1.0f / (511.0f*float(0x100000)), 1.0f / (3.0f*float(0x40000000)) } } };
XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16 = { { { 0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMMaskX16Y16 = { { { 0x0000FFFF, 0xFFFF0000, 0x00000000, 0x00000000 } } };
XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = { { { 0x00008000, 0x00000000, 0x00000000, 0x00000000 } } }; XMGLOBALCONST XMVECTORI32 g_XMFlipX16Y16 = { { { 0x00008000, 0x00000000, 0x00000000, 0x00000000 } } };
XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = { { { -32768.0f, 0.0f, 0.0f, 0.0f } } }; XMGLOBALCONST XMVECTORF32 g_XMFixX16Y16 = { { { -32768.0f, 0.0f, 0.0f, 0.0f } } };
@ -1979,7 +1979,7 @@ XMGLOBALCONST XMVECTORU32 g_XMFlipW = { { { 0, 0, 0, 0x80000000
XMGLOBALCONST XMVECTORU32 g_XMFlipYZ = { { { 0, 0x80000000, 0x80000000, 0 } } }; XMGLOBALCONST XMVECTORU32 g_XMFlipYZ = { { { 0, 0x80000000, 0x80000000, 0 } } };
XMGLOBALCONST XMVECTORU32 g_XMFlipZW = { { { 0, 0, 0x80000000, 0x80000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMFlipZW = { { { 0, 0, 0x80000000, 0x80000000 } } };
XMGLOBALCONST XMVECTORU32 g_XMFlipYW = { { { 0, 0x80000000, 0, 0x80000000 } } }; XMGLOBALCONST XMVECTORU32 g_XMFlipYW = { { { 0, 0x80000000, 0, 0x80000000 } } };
XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, 0x3 << 30 } } }; XMGLOBALCONST XMVECTORI32 g_XMMaskDec4 = { { { 0x3FF, 0x3FF << 10, 0x3FF << 20, static_cast<int>(0xC0000000) } } };
XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = { { { 0x200, 0x200 << 10, 0x200 << 20, 0 } } }; XMGLOBALCONST XMVECTORI32 g_XMXorDec4 = { { { 0x200, 0x200 << 10, 0x200 << 20, 0 } } };
XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = { { { 0, 0, 0, 32768.0f*65536.0f } } }; XMGLOBALCONST XMVECTORF32 g_XMAddUDec4 = { { { 0, 0, 0, 32768.0f*65536.0f } } };
XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = { { { -512.0f, -512.0f*1024.0f, -512.0f*1024.0f*1024.0f, 0 } } }; XMGLOBALCONST XMVECTORF32 g_XMAddDec4 = { { { -512.0f, -512.0f*1024.0f, -512.0f*1024.0f*1024.0f, 0 } } };
@ -2067,7 +2067,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSetBinaryConstant(uint32_t C0, uint32_t C1,
#else // XM_SSE_INTRINSICS_ #else // XM_SSE_INTRINSICS_
static const XMVECTORU32 g_vMask1 = { { { 1, 1, 1, 1 } } }; static const XMVECTORU32 g_vMask1 = { { { 1, 1, 1, 1 } } };
// Move the parms to a vector // Move the parms to a vector
__m128i vTemp = _mm_set_epi32(C3,C2,C1,C0); __m128i vTemp = _mm_set_epi32(static_cast<int>(C3), static_cast<int>(C2), static_cast<int>(C1), static_cast<int>(C0));
// Mask off the low bits // Mask off the low bits
vTemp = _mm_and_si128(vTemp,g_vMask1); vTemp = _mm_and_si128(vTemp,g_vMask1);
// 0xFFFFFFFF on true bits // 0xFFFFFFFF on true bits
@ -2099,7 +2099,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSplatConstant(int32_t IntConstant, uint32_t
// Convert DivExponent into 1.0f/(1<<DivExponent) // Convert DivExponent into 1.0f/(1<<DivExponent)
uint32_t uScale = 0x3F800000U - (DivExponent << 23); uint32_t uScale = 0x3F800000U - (DivExponent << 23);
// Splat the scalar value (It's really a float) // Splat the scalar value (It's really a float)
vScale = vdupq_n_s32(uScale); vScale = vdupq_n_u32(uScale);
// Multiply by the reciprocal (Perform a right shift by DivExponent) // Multiply by the reciprocal (Perform a right shift by DivExponent)
vResult = vmulq_f32(vResult,reinterpret_cast<const float32x4_t *>(&vScale)[0]); vResult = vmulq_f32(vResult,reinterpret_cast<const float32x4_t *>(&vScale)[0]);
return vResult; return vResult;
@ -2111,7 +2111,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSplatConstant(int32_t IntConstant, uint32_t
// Convert DivExponent into 1.0f/(1<<DivExponent) // Convert DivExponent into 1.0f/(1<<DivExponent)
uint32_t uScale = 0x3F800000U - (DivExponent << 23); uint32_t uScale = 0x3F800000U - (DivExponent << 23);
// Splat the scalar value (It's really a float) // Splat the scalar value (It's really a float)
vScale = _mm_set1_epi32(uScale); vScale = _mm_set1_epi32(static_cast<int>(uScale));
// Multiply by the reciprocal (Perform a right shift by DivExponent) // Multiply by the reciprocal (Perform a right shift by DivExponent)
vResult = _mm_mul_ps(vResult,_mm_castsi128_ps(vScale)); vResult = _mm_mul_ps(vResult,_mm_castsi128_ps(vScale));
return vResult; return vResult;

View File

@ -29,12 +29,12 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat
{ {
assert(DivExponent<32); assert(DivExponent<32);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
float fScale = 1.0f / (float)(1U << DivExponent); float fScale = 1.0f / static_cast<float>(1U << DivExponent);
uint32_t ElementIndex = 0; uint32_t ElementIndex = 0;
XMVECTOR Result; XMVECTOR Result;
do { do {
int32_t iTemp = (int32_t)VInt.vector4_u32[ElementIndex]; auto iTemp = static_cast<int32_t>(VInt.vector4_u32[ElementIndex]);
Result.vector4_f32[ElementIndex] = ((float)iTemp) * fScale; Result.vector4_f32[ElementIndex] = static_cast<float>(iTemp) * fScale;
} while (++ElementIndex<4); } while (++ElementIndex<4);
return Result; return Result;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
@ -47,7 +47,7 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorIntToFloat
// Convert DivExponent into 1.0f/(1<<DivExponent) // Convert DivExponent into 1.0f/(1<<DivExponent)
uint32_t uScale = 0x3F800000U - (DivExponent << 23); uint32_t uScale = 0x3F800000U - (DivExponent << 23);
// Splat the scalar value // Splat the scalar value
__m128i vScale = _mm_set1_epi32(uScale); __m128i vScale = _mm_set1_epi32(static_cast<int>(uScale));
vResult = _mm_mul_ps(vResult,_mm_castsi128_ps(vScale)); vResult = _mm_mul_ps(vResult,_mm_castsi128_ps(vScale));
return vResult; return vResult;
#endif #endif
@ -64,7 +64,7 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt
assert(MulExponent<32); assert(MulExponent<32);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
// Get the scalar factor. // Get the scalar factor.
float fScale = (float)(1U << MulExponent); auto fScale = static_cast<float>(1U << MulExponent);
uint32_t ElementIndex = 0; uint32_t ElementIndex = 0;
XMVECTOR Result; XMVECTOR Result;
do { do {
@ -75,9 +75,9 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt
} else if (fTemp > (65536.0f*32768.0f)-128.0f) { } else if (fTemp > (65536.0f*32768.0f)-128.0f) {
iResult = 0x7FFFFFFF; iResult = 0x7FFFFFFF;
} else { } else {
iResult = (int32_t)fTemp; iResult = static_cast<int32_t>(fTemp);
} }
Result.vector4_u32[ElementIndex] = (uint32_t)iResult; Result.vector4_u32[ElementIndex] = static_cast<uint32_t>(iResult);
} while (++ElementIndex<4); } while (++ElementIndex<4);
return Result; return Result;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
@ -92,7 +92,7 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToInt
vOverflow = vorrq_u32(vOverflow,vResult); vOverflow = vorrq_u32(vOverflow,vResult);
return vOverflow; return vOverflow;
#else // _XM_SSE_INTRINSICS_ #else // _XM_SSE_INTRINSICS_
XMVECTOR vResult = _mm_set_ps1((float)(1U << MulExponent)); XMVECTOR vResult = _mm_set_ps1(static_cast<float>(1U << MulExponent));
vResult = _mm_mul_ps(vResult,VFloat); vResult = _mm_mul_ps(vResult,VFloat);
// In case of positive overflow, detect it // In case of positive overflow, detect it
XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,g_XMMaxInt); XMVECTOR vOverflow = _mm_cmpgt_ps(vResult,g_XMMaxInt);
@ -116,11 +116,11 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat
{ {
assert(DivExponent<32); assert(DivExponent<32);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
float fScale = 1.0f / (float)(1U << DivExponent); float fScale = 1.0f / static_cast<float>(1U << DivExponent);
uint32_t ElementIndex = 0; uint32_t ElementIndex = 0;
XMVECTOR Result; XMVECTOR Result;
do { do {
Result.vector4_f32[ElementIndex] = (float)VUInt.vector4_u32[ElementIndex] * fScale; Result.vector4_f32[ElementIndex] = static_cast<float>(VUInt.vector4_u32[ElementIndex]) * fScale;
} while (++ElementIndex<4); } while (++ElementIndex<4);
return Result; return Result;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
@ -143,7 +143,7 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorUIntToFloat
// Convert DivExponent into 1.0f/(1<<DivExponent) // Convert DivExponent into 1.0f/(1<<DivExponent)
uint32_t uScale = 0x3F800000U - (DivExponent << 23); uint32_t uScale = 0x3F800000U - (DivExponent << 23);
// Splat // Splat
iMask = _mm_set1_epi32(uScale); iMask = _mm_set1_epi32(static_cast<int>(uScale));
vResult = _mm_mul_ps(vResult,_mm_castsi128_ps(iMask)); vResult = _mm_mul_ps(vResult,_mm_castsi128_ps(iMask));
return vResult; return vResult;
#endif #endif
@ -160,7 +160,7 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt
assert(MulExponent<32); assert(MulExponent<32);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
// Get the scalar factor. // Get the scalar factor.
float fScale = (float)(1U << MulExponent); auto fScale = static_cast<float>(1U << MulExponent);
uint32_t ElementIndex = 0; uint32_t ElementIndex = 0;
XMVECTOR Result; XMVECTOR Result;
do { do {
@ -171,7 +171,7 @@ inline XMVECTOR XM_CALLCONV XMConvertVectorFloatToUInt
} else if (fTemp >= (65536.0f*65536.0f)) { } else if (fTemp >= (65536.0f*65536.0f)) {
uResult = 0xFFFFFFFFU; uResult = 0xFFFFFFFFU;
} else { } else {
uResult = (uint32_t)fTemp; uResult = static_cast<uint32_t>(fTemp);
} }
Result.vector4_u32[ElementIndex] = uResult; Result.vector4_u32[ElementIndex] = uResult;
} while (++ElementIndex<4); } while (++ElementIndex<4);
@ -292,7 +292,7 @@ inline XMVECTOR XM_CALLCONV XMLoadInt2A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_u32[0] = pSource[0]; V.vector4_u32[0] = pSource[0];
@ -344,7 +344,7 @@ inline XMVECTOR XM_CALLCONV XMLoadFloat2A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = pSource->x; V.vector4_f32[0] = pSource->x;
@ -372,8 +372,8 @@ inline XMVECTOR XM_CALLCONV XMLoadSInt2
assert(pSource); assert(pSource);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = (float)pSource->x; V.vector4_f32[0] = static_cast<float>(pSource->x);
V.vector4_f32[1] = (float)pSource->y; V.vector4_f32[1] = static_cast<float>(pSource->y);
V.vector4_f32[2] = 0.f; V.vector4_f32[2] = 0.f;
V.vector4_f32[3] = 0.f; V.vector4_f32[3] = 0.f;
return V; return V;
@ -400,8 +400,8 @@ inline XMVECTOR XM_CALLCONV XMLoadUInt2
assert(pSource); assert(pSource);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = (float)pSource->x; V.vector4_f32[0] = static_cast<float>(pSource->x);
V.vector4_f32[1] = (float)pSource->y; V.vector4_f32[1] = static_cast<float>(pSource->y);
V.vector4_f32[2] = 0.f; V.vector4_f32[2] = 0.f;
V.vector4_f32[3] = 0.f; V.vector4_f32[3] = 0.f;
return V; return V;
@ -467,7 +467,7 @@ inline XMVECTOR XM_CALLCONV XMLoadInt3A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_u32[0] = pSource[0]; V.vector4_u32[0] = pSource[0];
@ -524,7 +524,7 @@ inline XMVECTOR XM_CALLCONV XMLoadFloat3A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = pSource->x; V.vector4_f32[0] = pSource->x;
@ -554,9 +554,9 @@ inline XMVECTOR XM_CALLCONV XMLoadSInt3
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = (float)pSource->x; V.vector4_f32[0] = static_cast<float>(pSource->x);
V.vector4_f32[1] = (float)pSource->y; V.vector4_f32[1] = static_cast<float>(pSource->y);
V.vector4_f32[2] = (float)pSource->z; V.vector4_f32[2] = static_cast<float>(pSource->z);
V.vector4_f32[3] = 0.f; V.vector4_f32[3] = 0.f;
return V; return V;
@ -586,9 +586,9 @@ inline XMVECTOR XM_CALLCONV XMLoadUInt3
assert(pSource); assert(pSource);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = (float)pSource->x; V.vector4_f32[0] = static_cast<float>(pSource->x);
V.vector4_f32[1] = (float)pSource->y; V.vector4_f32[1] = static_cast<float>(pSource->y);
V.vector4_f32[2] = (float)pSource->z; V.vector4_f32[2] = static_cast<float>(pSource->z);
V.vector4_f32[3] = 0.f; V.vector4_f32[3] = 0.f;
return V; return V;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
@ -651,7 +651,7 @@ inline XMVECTOR XM_CALLCONV XMLoadInt4A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_u32[0] = pSource[0]; V.vector4_u32[0] = pSource[0];
@ -697,7 +697,7 @@ inline XMVECTOR XM_CALLCONV XMLoadFloat4A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = pSource->x; V.vector4_f32[0] = pSource->x;
@ -723,10 +723,10 @@ inline XMVECTOR XM_CALLCONV XMLoadSInt4
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = (float)pSource->x; V.vector4_f32[0] = static_cast<float>(pSource->x);
V.vector4_f32[1] = (float)pSource->y; V.vector4_f32[1] = static_cast<float>(pSource->y);
V.vector4_f32[2] = (float)pSource->z; V.vector4_f32[2] = static_cast<float>(pSource->z);
V.vector4_f32[3] = (float)pSource->w; V.vector4_f32[3] = static_cast<float>(pSource->w);
return V; return V;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
@ -748,10 +748,10 @@ inline XMVECTOR XM_CALLCONV XMLoadUInt4
assert(pSource); assert(pSource);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMVECTOR V; XMVECTOR V;
V.vector4_f32[0] = (float)pSource->x; V.vector4_f32[0] = static_cast<float>(pSource->x);
V.vector4_f32[1] = (float)pSource->y; V.vector4_f32[1] = static_cast<float>(pSource->y);
V.vector4_f32[2] = (float)pSource->z; V.vector4_f32[2] = static_cast<float>(pSource->z);
V.vector4_f32[3] = (float)pSource->w; V.vector4_f32[3] = static_cast<float>(pSource->w);
return V; return V;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
uint32x4_t v = vld1q_u32( reinterpret_cast<const uint32_t*>(pSource) ); uint32x4_t v = vld1q_u32( reinterpret_cast<const uint32_t*>(pSource) );
@ -808,7 +808,7 @@ inline XMMATRIX XM_CALLCONV XMLoadFloat3x3
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
float32x4_t v0 = vld1q_f32( &pSource->m[0][0] ); float32x4_t v0 = vld1q_f32( &pSource->m[0][0] );
float32x4_t v1 = vld1q_f32( &pSource->m[1][1] ); float32x4_t v1 = vld1q_f32( &pSource->m[1][1] );
float32x2_t v2 = vcreate_f32( (uint64_t)*(const uint32_t*)&pSource->m[2][2] ); float32x2_t v2 = vcreate_f32(static_cast<uint64_t>(*reinterpret_cast<const uint32_t*>(&pSource->m[2][2])));
float32x4_t T = vextq_f32( v0, v1, 3 ); float32x4_t T = vextq_f32( v0, v1, 3 );
XMMATRIX M; XMMATRIX M;
@ -927,7 +927,7 @@ inline XMMATRIX XM_CALLCONV XMLoadFloat4x3A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMMATRIX M; XMMATRIX M;
@ -1089,7 +1089,7 @@ inline XMMATRIX XM_CALLCONV XMLoadFloat3x4A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMMATRIX M; XMMATRIX M;
@ -1220,7 +1220,7 @@ inline XMMATRIX XM_CALLCONV XMLoadFloat4x4A
) )
{ {
assert(pSource); assert(pSource);
assert(((uintptr_t)pSource & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
XMMATRIX M; XMMATRIX M;
@ -1333,7 +1333,7 @@ inline void XM_CALLCONV XMStoreInt2A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination[0] = V.vector4_u32[0]; pDestination[0] = V.vector4_u32[0];
pDestination[1] = V.vector4_u32[1]; pDestination[1] = V.vector4_u32[1];
@ -1376,7 +1376,7 @@ inline void XM_CALLCONV XMStoreFloat2A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = V.vector4_f32[0]; pDestination->x = V.vector4_f32[0];
pDestination->y = V.vector4_f32[1]; pDestination->y = V.vector4_f32[1];
@ -1398,8 +1398,8 @@ inline void XM_CALLCONV XMStoreSInt2
{ {
assert(pDestination); assert(pDestination);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = (int32_t)V.vector4_f32[0]; pDestination->x = static_cast<int32_t>(V.vector4_f32[0]);
pDestination->y = (int32_t)V.vector4_f32[1]; pDestination->y = static_cast<int32_t>(V.vector4_f32[1]);
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
int32x2_t v = vget_low_s32(V); int32x2_t v = vget_low_s32(V);
v = vcvt_s32_f32( v ); v = vcvt_s32_f32( v );
@ -1430,8 +1430,8 @@ inline void XM_CALLCONV XMStoreUInt2
{ {
assert(pDestination); assert(pDestination);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = (uint32_t)V.vector4_f32[0]; pDestination->x = static_cast<uint32_t>(V.vector4_f32[0]);
pDestination->y = (uint32_t)V.vector4_f32[1]; pDestination->y = static_cast<uint32_t>(V.vector4_f32[1]);
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
float32x2_t v = vget_low_f32(V); float32x2_t v = vget_low_f32(V);
uint32x2_t iv = vcvt_u32_f32( v ); uint32x2_t iv = vcvt_u32_f32( v );
@ -1496,7 +1496,7 @@ inline void XM_CALLCONV XMStoreInt3A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination[0] = V.vector4_u32[0]; pDestination[0] = V.vector4_u32[0];
pDestination[1] = V.vector4_u32[1]; pDestination[1] = V.vector4_u32[1];
@ -1547,7 +1547,7 @@ inline void XM_CALLCONV XMStoreFloat3A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = V.vector4_f32[0]; pDestination->x = V.vector4_f32[0];
pDestination->y = V.vector4_f32[1]; pDestination->y = V.vector4_f32[1];
@ -1573,9 +1573,9 @@ inline void XM_CALLCONV XMStoreSInt3
{ {
assert(pDestination); assert(pDestination);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = (int32_t)V.vector4_f32[0]; pDestination->x = static_cast<int32_t>(V.vector4_f32[0]);
pDestination->y = (int32_t)V.vector4_f32[1]; pDestination->y = static_cast<int32_t>(V.vector4_f32[1]);
pDestination->z = (int32_t)V.vector4_f32[2]; pDestination->z = static_cast<int32_t>(V.vector4_f32[2]);
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
int32x4_t v = vcvtq_s32_f32(V); int32x4_t v = vcvtq_s32_f32(V);
int32x2_t vL = vget_low_s32(v); int32x2_t vL = vget_low_s32(v);
@ -1609,9 +1609,9 @@ inline void XM_CALLCONV XMStoreUInt3
{ {
assert(pDestination); assert(pDestination);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = (uint32_t)V.vector4_f32[0]; pDestination->x = static_cast<uint32_t>(V.vector4_f32[0]);
pDestination->y = (uint32_t)V.vector4_f32[1]; pDestination->y = static_cast<uint32_t>(V.vector4_f32[1]);
pDestination->z = (uint32_t)V.vector4_f32[2]; pDestination->z = static_cast<uint32_t>(V.vector4_f32[2]);
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
uint32x4_t v = vcvtq_u32_f32(V); uint32x4_t v = vcvtq_u32_f32(V);
uint32x2_t vL = vget_low_u32(v); uint32x2_t vL = vget_low_u32(v);
@ -1674,7 +1674,7 @@ inline void XM_CALLCONV XMStoreInt4A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination[0] = V.vector4_u32[0]; pDestination[0] = V.vector4_u32[0];
pDestination[1] = V.vector4_u32[1]; pDestination[1] = V.vector4_u32[1];
@ -1717,7 +1717,7 @@ inline void XM_CALLCONV XMStoreFloat4A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = V.vector4_f32[0]; pDestination->x = V.vector4_f32[0];
pDestination->y = V.vector4_f32[1]; pDestination->y = V.vector4_f32[1];
@ -1740,10 +1740,10 @@ inline void XM_CALLCONV XMStoreSInt4
{ {
assert(pDestination); assert(pDestination);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = (int32_t)V.vector4_f32[0]; pDestination->x = static_cast<int32_t>(V.vector4_f32[0]);
pDestination->y = (int32_t)V.vector4_f32[1]; pDestination->y = static_cast<int32_t>(V.vector4_f32[1]);
pDestination->z = (int32_t)V.vector4_f32[2]; pDestination->z = static_cast<int32_t>(V.vector4_f32[2]);
pDestination->w = (int32_t)V.vector4_f32[3]; pDestination->w = static_cast<int32_t>(V.vector4_f32[3]);
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
int32x4_t v = vcvtq_s32_f32(V); int32x4_t v = vcvtq_s32_f32(V);
vst1q_s32( reinterpret_cast<int32_t*>(pDestination), v ); vst1q_s32( reinterpret_cast<int32_t*>(pDestination), v );
@ -1770,10 +1770,10 @@ inline void XM_CALLCONV XMStoreUInt4
{ {
assert(pDestination); assert(pDestination);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->x = (uint32_t)V.vector4_f32[0]; pDestination->x = static_cast<uint32_t>(V.vector4_f32[0]);
pDestination->y = (uint32_t)V.vector4_f32[1]; pDestination->y = static_cast<uint32_t>(V.vector4_f32[1]);
pDestination->z = (uint32_t)V.vector4_f32[2]; pDestination->z = static_cast<uint32_t>(V.vector4_f32[2]);
pDestination->w = (uint32_t)V.vector4_f32[3]; pDestination->w = static_cast<uint32_t>(V.vector4_f32[3]);
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
uint32x4_t v = vcvtq_u32_f32(V); uint32x4_t v = vcvtq_u32_f32(V);
vst1q_u32( reinterpret_cast<uint32_t*>(pDestination), v ); vst1q_u32( reinterpret_cast<uint32_t*>(pDestination), v );
@ -1910,7 +1910,7 @@ inline void XM_CALLCONV XMStoreFloat4x3A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->m[0][0] = M.r[0].vector4_f32[0]; pDestination->m[0][0] = M.r[0].vector4_f32[0];
@ -2035,7 +2035,7 @@ inline void XM_CALLCONV XMStoreFloat3x4A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->m[0][0] = M.r[0].vector4_f32[0]; pDestination->m[0][0] = M.r[0].vector4_f32[0];
@ -2139,7 +2139,7 @@ inline void XM_CALLCONV XMStoreFloat4x4A
) )
{ {
assert(pDestination); assert(pDestination);
assert(((uintptr_t)pDestination & 0xF) == 0); assert((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0);
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
pDestination->m[0][0] = M.r[0].vector4_f32[0]; pDestination->m[0][0] = M.r[0].vector4_f32[0];

View File

@ -29,7 +29,7 @@ inline bool XM_CALLCONV XMMatrixIsNaN
{ {
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
size_t i = 16; size_t i = 16;
const uint32_t *pWork = (const uint32_t *)(&M.m[0][0]); auto pWork = reinterpret_cast<const uint32_t *>(&M.m[0][0]);
do { do {
// Fetch value into integer unit // Fetch value into integer unit
uint32_t uTest = pWork[0]; uint32_t uTest = pWork[0];
@ -94,7 +94,7 @@ inline bool XM_CALLCONV XMMatrixIsInfinite
{ {
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
size_t i = 16; size_t i = 16;
const uint32_t *pWork = (const uint32_t *)(&M.m[0][0]); auto pWork = reinterpret_cast<const uint32_t *>(&M.m[0][0]);
do { do {
// Fetch value into integer unit // Fetch value into integer unit
uint32_t uTest = pWork[0]; uint32_t uTest = pWork[0];
@ -157,7 +157,7 @@ inline bool XM_CALLCONV XMMatrixIsIdentity
{ {
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
// Use the integer pipeline to reduce branching to a minimum // Use the integer pipeline to reduce branching to a minimum
const uint32_t *pWork = (const uint32_t*)(&M.m[0][0]); auto pWork = reinterpret_cast<const uint32_t*>(&M.m[0][0]);
// Convert 1.0f to zero and or them together // Convert 1.0f to zero and or them together
uint32_t uOne = pWork[0]^0x3F800000U; uint32_t uOne = pWork[0]^0x3F800000U;
// Or all the 0.0f entries together // Or all the 0.0f entries together
@ -995,7 +995,7 @@ inline bool XM_CALLCONV XMMatrixDecompose
matTemp.r[2] = M.r[2]; matTemp.r[2] = M.r[2];
matTemp.r[3] = g_XMIdentityR3.v; matTemp.r[3] = g_XMIdentityR3.v;
float *pfScales = (float *)outScale; auto pfScales = reinterpret_cast<float *>(outScale);
size_t a, b, c; size_t a, b, c;
XMVectorGetXPtr(&pfScales[0],XMVector3Length(ppvBasis[0][0])); XMVectorGetXPtr(&pfScales[0],XMVector3Length(ppvBasis[0][0]));
@ -2981,10 +2981,10 @@ inline XMMATRIX::XMMATRIX
) )
{ {
assert( pArray != nullptr ); assert( pArray != nullptr );
r[0] = XMLoadFloat4((const XMFLOAT4*)pArray); r[0] = XMLoadFloat4(reinterpret_cast<const XMFLOAT4*>(pArray));
r[1] = XMLoadFloat4((const XMFLOAT4*)(pArray + 4)); r[1] = XMLoadFloat4(reinterpret_cast<const XMFLOAT4*>(pArray + 4));
r[2] = XMLoadFloat4((const XMFLOAT4*)(pArray + 8)); r[2] = XMLoadFloat4(reinterpret_cast<const XMFLOAT4*>(pArray + 8));
r[3] = XMLoadFloat4((const XMFLOAT4*)(pArray + 12)); r[3] = XMLoadFloat4(reinterpret_cast<const XMFLOAT4*>(pArray + 12));
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -1124,7 +1124,7 @@ inline XMVECTOR XM_CALLCONV XMPlaneNormalize
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
float fLengthSq = sqrtf((P.vector4_f32[0]*P.vector4_f32[0])+(P.vector4_f32[1]*P.vector4_f32[1])+(P.vector4_f32[2]*P.vector4_f32[2])); float fLengthSq = sqrtf((P.vector4_f32[0]*P.vector4_f32[0])+(P.vector4_f32[1]*P.vector4_f32[1])+(P.vector4_f32[2]*P.vector4_f32[2]));
// Prevent divide by zero // Prevent divide by zero
if (fLengthSq) if (fLengthSq > 0)
{ {
fLengthSq = 1.0f/fLengthSq; fLengthSq = 1.0f/fLengthSq;
} }
@ -1748,7 +1748,7 @@ inline XMVECTOR XM_CALLCONV XMColorHSVToRGB( FXMVECTOR hsv )
// t = v*(1 - (1-f)*s) // t = v*(1 - (1-f)*s)
XMVECTOR t = XMVectorMultiply( v, XMVectorSubtract( g_XMOne, XMVectorMultiply( XMVectorSubtract( g_XMOne, f ), s ) ) ); XMVECTOR t = XMVectorMultiply( v, XMVectorSubtract( g_XMOne, XMVectorMultiply( XMVectorSubtract( g_XMOne, f ), s ) ) );
int ii = static_cast<int>( XMVectorGetX( XMVectorMod( i, g_XMSix ) ) ); auto ii = static_cast<int>( XMVectorGetX( XMVectorMod( i, g_XMSix ) ) );
XMVECTOR _rgb; XMVECTOR _rgb;
@ -2143,7 +2143,7 @@ inline float XMScalarModAngle
Angle = Angle + XM_PI; Angle = Angle + XM_PI;
// Perform the modulo, unsigned // Perform the modulo, unsigned
float fTemp = fabsf(Angle); float fTemp = fabsf(Angle);
fTemp = fTemp - (XM_2PI * (float)((int32_t)(fTemp/XM_2PI))); fTemp = fTemp - (XM_2PI * static_cast<float>(static_cast<int32_t>(fTemp/XM_2PI)));
// Restore the number to the range of -XM_PI to XM_PI-epsilon // Restore the number to the range of -XM_PI to XM_PI-epsilon
fTemp = fTemp - XM_PI; fTemp = fTemp - XM_PI;
// If the modulo'd value was negative, restore negation // If the modulo'd value was negative, restore negation
@ -2164,11 +2164,11 @@ inline float XMScalarSin
float quotient = XM_1DIV2PI*Value; float quotient = XM_1DIV2PI*Value;
if (Value >= 0.0f) if (Value >= 0.0f)
{ {
quotient = (float)((int)(quotient + 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient + 0.5f));
} }
else else
{ {
quotient = (float)((int)(quotient - 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient - 0.5f));
} }
float y = Value - XM_2PI*quotient; float y = Value - XM_2PI*quotient;
@ -2198,11 +2198,11 @@ inline float XMScalarSinEst
float quotient = XM_1DIV2PI*Value; float quotient = XM_1DIV2PI*Value;
if (Value >= 0.0f) if (Value >= 0.0f)
{ {
quotient = (float)((int)(quotient + 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient + 0.5f));
} }
else else
{ {
quotient = (float)((int)(quotient - 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient - 0.5f));
} }
float y = Value - XM_2PI*quotient; float y = Value - XM_2PI*quotient;
@ -2232,11 +2232,11 @@ inline float XMScalarCos
float quotient = XM_1DIV2PI*Value; float quotient = XM_1DIV2PI*Value;
if (Value >= 0.0f) if (Value >= 0.0f)
{ {
quotient = (float)((int)(quotient + 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient + 0.5f));
} }
else else
{ {
quotient = (float)((int)(quotient - 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient - 0.5f));
} }
float y = Value - XM_2PI*quotient; float y = Value - XM_2PI*quotient;
@ -2274,11 +2274,11 @@ inline float XMScalarCosEst
float quotient = XM_1DIV2PI*Value; float quotient = XM_1DIV2PI*Value;
if (Value >= 0.0f) if (Value >= 0.0f)
{ {
quotient = (float)((int)(quotient + 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient + 0.5f));
} }
else else
{ {
quotient = (float)((int)(quotient - 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient - 0.5f));
} }
float y = Value - XM_2PI*quotient; float y = Value - XM_2PI*quotient;
@ -2322,11 +2322,11 @@ inline void XMScalarSinCos
float quotient = XM_1DIV2PI*Value; float quotient = XM_1DIV2PI*Value;
if (Value >= 0.0f) if (Value >= 0.0f)
{ {
quotient = (float)((int)(quotient + 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient + 0.5f));
} }
else else
{ {
quotient = (float)((int)(quotient - 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient - 0.5f));
} }
float y = Value - XM_2PI*quotient; float y = Value - XM_2PI*quotient;
@ -2374,11 +2374,11 @@ inline void XMScalarSinCosEst
float quotient = XM_1DIV2PI*Value; float quotient = XM_1DIV2PI*Value;
if (Value >= 0.0f) if (Value >= 0.0f)
{ {
quotient = (float)((int)(quotient + 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient + 0.5f));
} }
else else
{ {
quotient = (float)((int)(quotient - 0.5f)); quotient = static_cast<float>(static_cast<int>(quotient - 0.5f));
} }
float y = Value - XM_2PI*quotient; float y = Value - XM_2PI*quotient;

View File

@ -10,8 +10,8 @@
#pragma once #pragma once
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
#define XMISNAN(x) ((*(const uint32_t*)&(x) & 0x7F800000) == 0x7F800000 && (*(const uint32_t*)&(x) & 0x7FFFFF) != 0) #define XMISNAN(x) isnan(x)
#define XMISINF(x) ((*(const uint32_t*)&(x) & 0x7FFFFFFF) == 0x7F800000) #define XMISINF(x) isinf(x)
#endif #endif
#if defined(_XM_SSE_INTRINSICS_) #if defined(_XM_SSE_INTRINSICS_)
@ -69,8 +69,12 @@ inline XMVECTOR XM_CALLCONV XMVectorSet
XMVECTORF32 vResult = { { { x, y, z, w } } }; XMVECTORF32 vResult = { { { x, y, z, w } } };
return vResult.v; return vResult.v;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
float32x2_t V0 = vcreate_f32(((uint64_t)*(const uint32_t *)&x) | ((uint64_t)(*(const uint32_t *)&y) << 32)); float32x2_t V0 = vcreate_f32(
float32x2_t V1 = vcreate_f32(((uint64_t)*(const uint32_t *)&z) | ((uint64_t)(*(const uint32_t *)&w) << 32)); static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&x))
| (static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&y)) << 32));
float32x2_t V1 = vcreate_f32(
static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&z))
| (static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&w)) << 32));
return vcombine_f32(V0, V1); return vcombine_f32(V0, V1);
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
return _mm_set_ps( w, z, y, x ); return _mm_set_ps( w, z, y, x );
@ -91,11 +95,11 @@ inline XMVECTOR XM_CALLCONV XMVectorSetInt
XMVECTORU32 vResult = { { { x, y, z, w } } }; XMVECTORU32 vResult = { { { x, y, z, w } } };
return vResult.v; return vResult.v;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
uint32x2_t V0 = vcreate_u32(((uint64_t)x) | ((uint64_t)y << 32)); uint32x2_t V0 = vcreate_u32(static_cast<uint64_t>(x) | (static_cast<uint64_t>(y) << 32));
uint32x2_t V1 = vcreate_u32(((uint64_t)z) | ((uint64_t)w << 32)); uint32x2_t V1 = vcreate_u32(static_cast<uint64_t>(z) | (static_cast<uint64_t>(w) << 32));
return vcombine_u32(V0, V1); return vcombine_u32(V0, V1);
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
__m128i V = _mm_set_epi32( w, z, y, x ); __m128i V = _mm_set_epi32(static_cast<int>(w), static_cast<int>(z), static_cast<int>(y), static_cast<int>(x));
return _mm_castsi128_ps(V); return _mm_castsi128_ps(V);
#endif #endif
} }
@ -163,7 +167,7 @@ inline XMVECTOR XM_CALLCONV XMVectorReplicateInt
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
return vdupq_n_u32( Value ); return vdupq_n_u32( Value );
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
__m128i vTemp = _mm_set1_epi32( Value ); __m128i vTemp = _mm_set1_epi32(static_cast<int>(Value));
return _mm_castsi128_ps(vTemp); return _mm_castsi128_ps(vTemp);
#endif #endif
} }
@ -392,7 +396,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSplatSignMask()
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
return vdupq_n_u32(0x80000000U); return vdupq_n_u32(0x80000000U);
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
__m128i V = _mm_set1_epi32( 0x80000000 ); __m128i V = _mm_set1_epi32(static_cast<int>(0x80000000));
return _mm_castsi128_ps(V); return _mm_castsi128_ps(V);
#endif #endif
} }
@ -509,7 +513,7 @@ inline void XM_CALLCONV XMVectorGetYPtr(float *y, FXMVECTOR V)
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
vst1q_lane_f32(y,V,1); vst1q_lane_f32(y,V,1);
#elif defined(_XM_SSE4_INTRINSICS_) #elif defined(_XM_SSE4_INTRINSICS_)
*((int*)y) = _mm_extract_ps( V, 1 ); *(reinterpret_cast<int*>(y)) = _mm_extract_ps( V, 1 );
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(1,1,1,1)); XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(1,1,1,1));
_mm_store_ss(y,vResult); _mm_store_ss(y,vResult);
@ -526,7 +530,7 @@ inline void XM_CALLCONV XMVectorGetZPtr(float *z, FXMVECTOR V)
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
vst1q_lane_f32(z,V,2); vst1q_lane_f32(z,V,2);
#elif defined(_XM_SSE4_INTRINSICS_) #elif defined(_XM_SSE4_INTRINSICS_)
*((int*)z) = _mm_extract_ps( V, 2 ); *(reinterpret_cast<int*>(z)) = _mm_extract_ps( V, 2 );
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(2,2,2,2)); XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(2,2,2,2));
_mm_store_ss(z,vResult); _mm_store_ss(z,vResult);
@ -543,7 +547,7 @@ inline void XM_CALLCONV XMVectorGetWPtr(float *w, FXMVECTOR V)
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
vst1q_lane_f32(w,V,3); vst1q_lane_f32(w,V,3);
#elif defined(_XM_SSE4_INTRINSICS_) #elif defined(_XM_SSE4_INTRINSICS_)
*((int*)w) = _mm_extract_ps( V, 3 ); *(reinterpret_cast<int*>(w)) = _mm_extract_ps( V, 3 );
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(3,3,3,3)); XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(3,3,3,3));
_mm_store_ss(w,vResult); _mm_store_ss(w,vResult);
@ -993,7 +997,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSetIntX(FXMVECTOR V, uint32_t x)
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
return vsetq_lane_u32(x,V,0); return vsetq_lane_u32(x,V,0);
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
__m128i vTemp = _mm_cvtsi32_si128(x); __m128i vTemp = _mm_cvtsi32_si128(static_cast<int>(x));
XMVECTOR vResult = _mm_move_ss(V,_mm_castsi128_ps(vTemp)); XMVECTOR vResult = _mm_move_ss(V,_mm_castsi128_ps(vTemp));
return vResult; return vResult;
#endif #endif
@ -1020,7 +1024,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSetIntY(FXMVECTOR V, uint32_t y)
// Swap y and x // Swap y and x
XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(3,2,0,1)); XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(3,2,0,1));
// Convert input to vector // Convert input to vector
__m128i vTemp = _mm_cvtsi32_si128(y); __m128i vTemp = _mm_cvtsi32_si128(static_cast<int>(y));
// Replace the x component // Replace the x component
vResult = _mm_move_ss(vResult,_mm_castsi128_ps(vTemp)); vResult = _mm_move_ss(vResult,_mm_castsi128_ps(vTemp));
// Swap y and x again // Swap y and x again
@ -1050,7 +1054,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSetIntZ(FXMVECTOR V, uint32_t z)
// Swap z and x // Swap z and x
XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(3,0,1,2)); XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(3,0,1,2));
// Convert input to vector // Convert input to vector
__m128i vTemp = _mm_cvtsi32_si128(z); __m128i vTemp = _mm_cvtsi32_si128(static_cast<int>(z));
// Replace the x component // Replace the x component
vResult = _mm_move_ss(vResult,_mm_castsi128_ps(vTemp)); vResult = _mm_move_ss(vResult,_mm_castsi128_ps(vTemp));
// Swap z and x again // Swap z and x again
@ -1080,7 +1084,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSetIntW(FXMVECTOR V, uint32_t w)
// Swap w and x // Swap w and x
XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(0,2,1,3)); XMVECTOR vResult = XM_PERMUTE_PS(V,_MM_SHUFFLE(0,2,1,3));
// Convert input to vector // Convert input to vector
__m128i vTemp = _mm_cvtsi32_si128(w); __m128i vTemp = _mm_cvtsi32_si128(static_cast<int>(w));
// Replace the x component // Replace the x component
vResult = _mm_move_ss(vResult,_mm_castsi128_ps(vTemp)); vResult = _mm_move_ss(vResult,_mm_castsi128_ps(vTemp));
// Swap w and x again // Swap w and x again
@ -1248,10 +1252,10 @@ inline XMVECTOR XM_CALLCONV XMVectorSwizzle
tbl.val[0] = vget_low_f32(V); tbl.val[0] = vget_low_f32(V);
tbl.val[1] = vget_high_f32(V); tbl.val[1] = vget_high_f32(V);
uint32x2_t idx = vcreate_u32( ((uint64_t)ControlElement[E0]) | (((uint64_t)ControlElement[E1]) << 32) ); uint32x2_t idx = vcreate_u32(static_cast<uint64_t>(ControlElement[E0]) | (static_cast<uint64_t>(ControlElement[E1]) << 32));
const uint8x8_t rL = vtbl2_u8( tbl, idx ); const uint8x8_t rL = vtbl2_u8( tbl, idx );
idx = vcreate_u32( ((uint64_t)ControlElement[E2]) | (((uint64_t)ControlElement[E3]) << 32) ); idx = vcreate_u32(static_cast<uint64_t>(ControlElement[E2]) | (static_cast<uint64_t>(ControlElement[E3]) << 32));
const uint8x8_t rH = vtbl2_u8( tbl, idx ); const uint8x8_t rH = vtbl2_u8( tbl, idx );
return vcombine_f32( rL, rH ); return vcombine_f32( rL, rH );
@ -1260,10 +1264,10 @@ inline XMVECTOR XM_CALLCONV XMVectorSwizzle
__m128i vControl = _mm_loadu_si128( reinterpret_cast<const __m128i *>(&elem[0]) ); __m128i vControl = _mm_loadu_si128( reinterpret_cast<const __m128i *>(&elem[0]) );
return _mm_permutevar_ps( V, vControl ); return _mm_permutevar_ps( V, vControl );
#else #else
const uint32_t *aPtr = (const uint32_t* )(&V); auto aPtr = reinterpret_cast<const uint32_t*>(&V);
XMVECTOR Result; XMVECTOR Result;
uint32_t *pWork = (uint32_t*)(&Result); auto pWork = reinterpret_cast<uint32_t*>(&Result);
pWork[0] = aPtr[E0]; pWork[0] = aPtr[E0];
pWork[1] = aPtr[E1]; pWork[1] = aPtr[E1];
@ -1307,10 +1311,10 @@ inline XMVECTOR XM_CALLCONV XMVectorPermute
tbl.val[2] = vget_low_f32(V2); tbl.val[2] = vget_low_f32(V2);
tbl.val[3] = vget_high_f32(V2); tbl.val[3] = vget_high_f32(V2);
uint32x2_t idx = vcreate_u32( ((uint64_t)ControlElement[PermuteX]) | (((uint64_t)ControlElement[PermuteY]) << 32) ); uint32x2_t idx = vcreate_u32(static_cast<uint64_t>(ControlElement[PermuteX]) | (static_cast<uint64_t>(ControlElement[PermuteY]) << 32));
const uint8x8_t rL = vtbl4_u8( tbl, idx ); const uint8x8_t rL = vtbl4_u8( tbl, idx );
idx = vcreate_u32( ((uint64_t)ControlElement[PermuteZ]) | (((uint64_t)ControlElement[PermuteW]) << 32) ); idx = vcreate_u32(static_cast<uint64_t>(ControlElement[PermuteZ]) | (static_cast<uint64_t>(ControlElement[PermuteW]) << 32));
const uint8x8_t rH = vtbl4_u8( tbl, idx ); const uint8x8_t rH = vtbl4_u8( tbl, idx );
return vcombine_f32( rL, rH ); return vcombine_f32( rL, rH );
@ -1333,11 +1337,11 @@ inline XMVECTOR XM_CALLCONV XMVectorPermute
#else #else
const uint32_t *aPtr[2]; const uint32_t *aPtr[2];
aPtr[0] = (const uint32_t* )(&V1); aPtr[0] = reinterpret_cast<const uint32_t*>(&V1);
aPtr[1] = (const uint32_t* )(&V2); aPtr[1] = reinterpret_cast<const uint32_t*>(&V2);
XMVECTOR Result; XMVECTOR Result;
uint32_t *pWork = (uint32_t*)(&Result); auto pWork = reinterpret_cast<uint32_t*>(&Result);
const uint32_t i0 = PermuteX & 3; const uint32_t i0 = PermuteX & 3;
const uint32_t vi0 = PermuteX >> 2; const uint32_t vi0 = PermuteX >> 2;
@ -1380,13 +1384,13 @@ inline XMVECTOR XM_CALLCONV XMVectorSelectControl
{ {
#if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) #if defined(_XM_SSE_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
// x=Index0,y=Index1,z=Index2,w=Index3 // x=Index0,y=Index1,z=Index2,w=Index3
__m128i vTemp = _mm_set_epi32(VectorIndex3,VectorIndex2,VectorIndex1,VectorIndex0); __m128i vTemp = _mm_set_epi32(static_cast<int>(VectorIndex3), static_cast<int>(VectorIndex2), static_cast<int>(VectorIndex1), static_cast<int>(VectorIndex0));
// Any non-zero entries become 0xFFFFFFFF else 0 // Any non-zero entries become 0xFFFFFFFF else 0
vTemp = _mm_cmpgt_epi32(vTemp,g_XMZero); vTemp = _mm_cmpgt_epi32(vTemp,g_XMZero);
return _mm_castsi128_ps(vTemp); return _mm_castsi128_ps(vTemp);
#elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
int32x2_t V0 = vcreate_s32(((uint64_t)VectorIndex0) | ((uint64_t)VectorIndex1 << 32)); int32x2_t V0 = vcreate_s32(static_cast<uint64_t>(VectorIndex0) | (static_cast<uint64_t>(VectorIndex1) << 32));
int32x2_t V1 = vcreate_s32(((uint64_t)VectorIndex2) | ((uint64_t)VectorIndex3 << 32)); int32x2_t V1 = vcreate_s32(static_cast<uint64_t>(VectorIndex2) | (static_cast<uint64_t>(VectorIndex3) << 32));
int32x4_t vTemp = vcombine_s32(V0, V1); int32x4_t vTemp = vcombine_s32(V0, V1);
// Any non-zero entries become 0xFFFFFFFF else 0 // Any non-zero entries become 0xFFFFFFFF else 0
return vcgtq_s32(vTemp,g_XMZero); return vcgtq_s32(vTemp,g_XMZero);
@ -2303,7 +2307,7 @@ namespace Internal
return i + 1.f; return i + 1.f;
} }
}; }
#if !defined(_XM_NO_INTRINSICS_) && !defined(__clang__) && !defined(__INTEL_COMPILER) #if !defined(_XM_NO_INTRINSICS_) && !defined(__clang__) && !defined(__INTEL_COMPILER)
#pragma float_control(push) #pragma float_control(push)
@ -2380,7 +2384,7 @@ inline XMVECTOR XM_CALLCONV XMVectorTruncate
} }
else if (fabsf(V.vector4_f32[i]) < 8388608.0f) else if (fabsf(V.vector4_f32[i]) < 8388608.0f)
{ {
Result.vector4_f32[i] = (float)((int32_t)V.vector4_f32[i]); Result.vector4_f32[i] = static_cast<float>(static_cast<int32_t>(V.vector4_f32[i]));
} }
else else
{ {
@ -4619,7 +4623,7 @@ inline XMVECTOR XM_CALLCONV XMVectorTan
#else #else
for (size_t i = 0; i < 4; i++) for (size_t i = 0; i < 4; i++)
{ {
VB.vector4_u32[i] = (uint32_t)VB.vector4_f32[i]; VB.vector4_u32[i] = static_cast<uint32_t>(VB.vector4_f32[i]);
} }
#endif #endif
@ -7676,8 +7680,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -7685,7 +7689,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat2((const XMFLOAT2*)pInputVector); XMVECTOR V = XMLoadFloat2(reinterpret_cast<const XMFLOAT2*>(pInputVector));
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
XMVECTOR X = XMVectorSplatX(V); XMVECTOR X = XMVectorSplatX(V);
@ -7697,7 +7701,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" )
#endif #endif
XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); XMStoreFloat4(reinterpret_cast<XMFLOAT4*>(pOutputVector), Result);
#ifdef _PREFAST_ #ifdef _PREFAST_
#pragma prefast(pop) #pragma prefast(pop)
@ -7710,8 +7714,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -7782,8 +7786,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -7795,7 +7799,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
{ {
if ( InputStride == sizeof(XMFLOAT2) ) if ( InputStride == sizeof(XMFLOAT2) )
{ {
if ( !((uintptr_t)pOutputStream & 0xF) && !(OutputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) && !(OutputStride & 0xF) )
{ {
// Packed input, aligned output // Packed input, aligned output
for (size_t j = 0; j < two; ++j) for (size_t j = 0; j < two; ++j)
@ -7864,9 +7868,9 @@ inline XMFLOAT4* XM_CALLCONV XMVector2TransformStream
} }
} }
if ( !((uintptr_t)pInputVector & 0xF) && !(InputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pInputVector) & 0xF) && !(InputStride & 0xF) )
{ {
if ( !((uintptr_t)pOutputStream & 0xF) && !(OutputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) && !(OutputStride & 0xF) )
{ {
// Aligned input, aligned output // Aligned input, aligned output
for (; i < VectorCount; i++) for (; i < VectorCount; i++)
@ -7977,8 +7981,8 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -7986,7 +7990,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat2((const XMFLOAT2*)pInputVector); XMVECTOR V = XMLoadFloat2(reinterpret_cast<const XMFLOAT2*>(pInputVector));
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
XMVECTOR X = XMVectorSplatX(V); XMVECTOR X = XMVectorSplatX(V);
@ -8002,7 +8006,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" )
#endif #endif
XMStoreFloat2((XMFLOAT2*)pOutputVector, Result); XMStoreFloat2(reinterpret_cast<XMFLOAT2*>(pOutputVector), Result);
#ifdef _PREFAST_ #ifdef _PREFAST_
#pragma prefast(pop) #pragma prefast(pop)
@ -8015,8 +8019,8 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -8112,8 +8116,8 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -8127,7 +8131,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
{ {
if ( OutputStride == sizeof(XMFLOAT2) ) if ( OutputStride == sizeof(XMFLOAT2) )
{ {
if ( !((uintptr_t)pOutputStream & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) )
{ {
// Packed input, aligned & packed output // Packed input, aligned & packed output
for (size_t j = 0; j < two; ++j) for (size_t j = 0; j < two; ++j)
@ -8262,7 +8266,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformCoordStream
} }
} }
if ( !((uintptr_t)pInputVector & 0xF) && !(InputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pInputVector) & 0xF) && !(InputStride & 0xF) )
{ {
// Aligned input // Aligned input
for (; i < VectorCount; i++) for (; i < VectorCount; i++)
@ -8378,15 +8382,15 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat2((const XMFLOAT2*)pInputVector); XMVECTOR V = XMLoadFloat2(reinterpret_cast<const XMFLOAT2*>(pInputVector));
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
XMVECTOR X = XMVectorSplatX(V); XMVECTOR X = XMVectorSplatX(V);
@ -8398,7 +8402,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream
#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" )
#endif #endif
XMStoreFloat2((XMFLOAT2*)pOutputVector, Result); XMStoreFloat2(reinterpret_cast<XMFLOAT2*>(pOutputVector), Result);
#ifdef _PREFAST_ #ifdef _PREFAST_
#pragma prefast(pop) #pragma prefast(pop)
@ -8411,8 +8415,8 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -8468,8 +8472,8 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -8482,7 +8486,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream
{ {
if ( OutputStride == sizeof(XMFLOAT2) ) if ( OutputStride == sizeof(XMFLOAT2) )
{ {
if ( !((uintptr_t)pOutputStream & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) )
{ {
// Packed input, aligned & packed output // Packed input, aligned & packed output
for (size_t j = 0; j < two; ++j) for (size_t j = 0; j < two; ++j)
@ -8587,7 +8591,7 @@ inline XMFLOAT2* XM_CALLCONV XMVector2TransformNormalStream
} }
} }
if ( !((uintptr_t)pInputVector & 0xF) && !(InputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pInputVector) & 0xF) && !(InputStride & 0xF) )
{ {
// Aligned input // Aligned input
for (; i < VectorCount; i++) for (; i < VectorCount; i++)
@ -10141,8 +10145,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -10151,7 +10155,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat3((const XMFLOAT3*)pInputVector); XMVECTOR V = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(pInputVector));
XMVECTOR Z = XMVectorSplatZ(V); XMVECTOR Z = XMVectorSplatZ(V);
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
XMVECTOR X = XMVectorSplatX(V); XMVECTOR X = XMVectorSplatX(V);
@ -10160,7 +10164,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
Result = XMVectorMultiplyAdd(Y, row1, Result); Result = XMVectorMultiplyAdd(Y, row1, Result);
Result = XMVectorMultiplyAdd(X, row0, Result); Result = XMVectorMultiplyAdd(X, row0, Result);
XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); XMStoreFloat4(reinterpret_cast<XMFLOAT4*>(pOutputVector), Result);
pInputVector += InputStride; pInputVector += InputStride;
pOutputVector += OutputStride; pOutputVector += OutputStride;
@ -10169,8 +10173,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -10257,8 +10261,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -10271,7 +10275,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
{ {
if (InputStride == sizeof(XMFLOAT3)) if (InputStride == sizeof(XMFLOAT3))
{ {
if ( !((uintptr_t)pOutputStream & 0xF) && !(OutputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) && !(OutputStride & 0xF) )
{ {
// Packed input, aligned output // Packed input, aligned output
for (size_t j = 0; j < four; ++j) for (size_t j = 0; j < four; ++j)
@ -10418,7 +10422,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector3TransformStream
} }
} }
if ( !((uintptr_t)pOutputStream & 0xF) && !(OutputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) && !(OutputStride & 0xF) )
{ {
// Aligned output // Aligned output
for (; i < VectorCount; ++i) for (; i < VectorCount; ++i)
@ -10524,8 +10528,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -10534,7 +10538,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat3((const XMFLOAT3*)pInputVector); XMVECTOR V = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(pInputVector));
XMVECTOR Z = XMVectorSplatZ(V); XMVECTOR Z = XMVectorSplatZ(V);
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
XMVECTOR X = XMVectorSplatX(V); XMVECTOR X = XMVectorSplatX(V);
@ -10547,7 +10551,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream
Result = XMVectorDivide(Result, W); Result = XMVectorDivide(Result, W);
XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(pOutputVector), Result);
pInputVector += InputStride; pInputVector += InputStride;
pOutputVector += OutputStride; pOutputVector += OutputStride;
@ -10556,8 +10560,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -10673,8 +10677,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -10689,7 +10693,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformCoordStream
{ {
if (OutputStride == sizeof(XMFLOAT3)) if (OutputStride == sizeof(XMFLOAT3))
{ {
if ( !((uintptr_t)pOutputStream & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) )
{ {
// Packed input, aligned & packed output // Packed input, aligned & packed output
for (size_t j = 0; j < four; ++j) for (size_t j = 0; j < four; ++j)
@ -11054,8 +11058,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -11063,7 +11067,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat3((const XMFLOAT3*)pInputVector); XMVECTOR V = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(pInputVector));
XMVECTOR Z = XMVectorSplatZ(V); XMVECTOR Z = XMVectorSplatZ(V);
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
XMVECTOR X = XMVectorSplatX(V); XMVECTOR X = XMVectorSplatX(V);
@ -11072,7 +11076,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream
Result = XMVectorMultiplyAdd(Y, row1, Result); Result = XMVectorMultiplyAdd(Y, row1, Result);
Result = XMVectorMultiplyAdd(X, row0, Result); Result = XMVectorMultiplyAdd(X, row0, Result);
XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(pOutputVector), Result);
pInputVector += InputStride; pInputVector += InputStride;
pOutputVector += OutputStride; pOutputVector += OutputStride;
@ -11081,8 +11085,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -11163,8 +11167,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -11178,7 +11182,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3TransformNormalStream
{ {
if (OutputStride == sizeof(XMFLOAT3)) if (OutputStride == sizeof(XMFLOAT3))
{ {
if ( !((uintptr_t)pOutputStream & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) )
{ {
// Packed input, aligned & packed output // Packed input, aligned & packed output
for (size_t j = 0; j < four; ++j) for (size_t j = 0; j < four; ++j)
@ -11493,17 +11497,17 @@ inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream
XMMATRIX Transform = XMMatrixMultiply(World, View); XMMATRIX Transform = XMMatrixMultiply(World, View);
Transform = XMMatrixMultiply(Transform, Projection); Transform = XMMatrixMultiply(Transform, Projection);
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat3((const XMFLOAT3*)pInputVector); XMVECTOR V = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(pInputVector));
XMVECTOR Result = XMVector3TransformCoord(V, Transform); XMVECTOR Result = XMVector3TransformCoord(V, Transform);
Result = XMVectorMultiplyAdd(Result, Scale, Offset); Result = XMVectorMultiplyAdd(Result, Scale, Offset);
XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(pOutputVector), Result);
pInputVector += InputStride; pInputVector += InputStride;
pOutputVector += OutputStride; pOutputVector += OutputStride;
@ -11517,8 +11521,9 @@ inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream
XMMATRIX Transform = XMMatrixMultiply(World, View); XMMATRIX Transform = XMMatrixMultiply(World, View);
Transform = XMMatrixMultiply(Transform, Projection); Transform = XMMatrixMultiply(Transform, Projection);
const uint8_t* pInputVector = (const uint8_t*)pInputStream;
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
size_t i = 0; size_t i = 0;
size_t four = VectorCount >> 2; size_t four = VectorCount >> 2;
@ -11658,8 +11663,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream
XMMATRIX Transform = XMMatrixMultiply(World, View); XMMATRIX Transform = XMMatrixMultiply(World, View);
Transform = XMMatrixMultiply(Transform, Projection); Transform = XMMatrixMultiply(Transform, Projection);
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
size_t i = 0; size_t i = 0;
size_t four = VectorCount >> 2; size_t four = VectorCount >> 2;
@ -11669,7 +11674,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3ProjectStream
{ {
if (OutputStride == sizeof(XMFLOAT3)) if (OutputStride == sizeof(XMFLOAT3))
{ {
if ( !((uintptr_t)pOutputStream & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) )
{ {
// Packed input, aligned & packed output // Packed input, aligned & packed output
for (size_t j = 0; j < four; ++j) for (size_t j = 0; j < four; ++j)
@ -12078,18 +12083,18 @@ inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream
Transform = XMMatrixMultiply(Transform, Projection); Transform = XMMatrixMultiply(Transform, Projection);
Transform = XMMatrixInverse(nullptr, Transform); Transform = XMMatrixInverse(nullptr, Transform);
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat3((const XMFLOAT3*)pInputVector); XMVECTOR V = XMLoadFloat3(reinterpret_cast<const XMFLOAT3*>(pInputVector));
XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset); XMVECTOR Result = XMVectorMultiplyAdd(V, Scale, Offset);
Result = XMVector3TransformCoord(Result, Transform); Result = XMVector3TransformCoord(Result, Transform);
XMStoreFloat3((XMFLOAT3*)pOutputVector, Result); XMStoreFloat3(reinterpret_cast<XMFLOAT3*>(pOutputVector), Result);
pInputVector += InputStride; pInputVector += InputStride;
pOutputVector += OutputStride; pOutputVector += OutputStride;
@ -12102,8 +12107,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream
Transform = XMMatrixMultiply(Transform, Projection); Transform = XMMatrixMultiply(Transform, Projection);
Transform = XMMatrixInverse(nullptr, Transform); Transform = XMMatrixInverse(nullptr, Transform);
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
float sx = 1.f / (ViewportWidth * 0.5f); float sx = 1.f / (ViewportWidth * 0.5f);
float sy = 1.f / (-ViewportHeight * 0.5f); float sy = 1.f / (-ViewportHeight * 0.5f);
@ -12201,11 +12206,15 @@ inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream
if (i < VectorCount) if (i < VectorCount)
{ {
float32x2_t ScaleL = vcreate_f32(((uint64_t)*(const uint32_t *)&sx) | ((uint64_t)(*(const uint32_t *)&sy) << 32)); float32x2_t ScaleL = vcreate_f32(
float32x2_t ScaleH = vcreate_f32((uint64_t)*(const uint32_t *)&sz); static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&sx))
| (static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&sy)) << 32));
float32x2_t ScaleH = vcreate_f32(static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&sz)));
float32x2_t OffsetL = vcreate_f32(((uint64_t)*(const uint32_t *)&ox) | ((uint64_t)(*(const uint32_t *)&oy) << 32)); float32x2_t OffsetL = vcreate_f32(
float32x2_t OffsetH = vcreate_f32((uint64_t)*(const uint32_t *)&oz); static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&ox))
| (static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&oy)) << 32));
float32x2_t OffsetH = vcreate_f32(static_cast<uint64_t>(*reinterpret_cast<const uint32_t *>(&oz)));
for (; i < VectorCount; i++) for (; i < VectorCount; i++)
{ {
@ -12259,8 +12268,8 @@ inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream
Transform = XMMatrixMultiply(Transform, Projection); Transform = XMMatrixMultiply(Transform, Projection);
Transform = XMMatrixInverse(nullptr, Transform); Transform = XMMatrixInverse(nullptr, Transform);
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
size_t i = 0; size_t i = 0;
size_t four = VectorCount >> 2; size_t four = VectorCount >> 2;
@ -12270,7 +12279,7 @@ inline XMFLOAT3* XM_CALLCONV XMVector3UnprojectStream
{ {
if (OutputStride == sizeof(XMFLOAT3)) if (OutputStride == sizeof(XMFLOAT3))
{ {
if ( !((uintptr_t)pOutputStream & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) )
{ {
// Packed input, aligned & packed output // Packed input, aligned & packed output
for (size_t j = 0; j < four; ++j) for (size_t j = 0; j < four; ++j)
@ -14149,8 +14158,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream
#if defined(_XM_NO_INTRINSICS_) #if defined(_XM_NO_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -14159,7 +14168,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
{ {
XMVECTOR V = XMLoadFloat4((const XMFLOAT4*)pInputVector); XMVECTOR V = XMLoadFloat4(reinterpret_cast<const XMFLOAT4*>(pInputVector));
XMVECTOR W = XMVectorSplatW(V); XMVECTOR W = XMVectorSplatW(V);
XMVECTOR Z = XMVectorSplatZ(V); XMVECTOR Z = XMVectorSplatZ(V);
XMVECTOR Y = XMVectorSplatY(V); XMVECTOR Y = XMVectorSplatY(V);
@ -14175,7 +14184,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream
#pragma prefast(disable : 26015, "PREfast noise: Esp:1307" ) #pragma prefast(disable : 26015, "PREfast noise: Esp:1307" )
#endif #endif
XMStoreFloat4((XMFLOAT4*)pOutputVector, Result); XMStoreFloat4(reinterpret_cast<XMFLOAT4*>(pOutputVector), Result);
#ifdef _PREFAST_ #ifdef _PREFAST_
#pragma prefast(pop) #pragma prefast(pop)
@ -14188,8 +14197,8 @@ inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_ARM_NEON_INTRINSICS_) #elif defined(_XM_ARM_NEON_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
@ -14286,17 +14295,17 @@ inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream
return pOutputStream; return pOutputStream;
#elif defined(_XM_SSE_INTRINSICS_) #elif defined(_XM_SSE_INTRINSICS_)
const uint8_t* pInputVector = (const uint8_t*)pInputStream; auto pInputVector = reinterpret_cast<const uint8_t*>(pInputStream);
uint8_t* pOutputVector = (uint8_t*)pOutputStream; auto pOutputVector = reinterpret_cast<uint8_t*>(pOutputStream);
const XMVECTOR row0 = M.r[0]; const XMVECTOR row0 = M.r[0];
const XMVECTOR row1 = M.r[1]; const XMVECTOR row1 = M.r[1];
const XMVECTOR row2 = M.r[2]; const XMVECTOR row2 = M.r[2];
const XMVECTOR row3 = M.r[3]; const XMVECTOR row3 = M.r[3];
if ( !((uintptr_t)pOutputStream & 0xF) && !(OutputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pOutputStream) & 0xF) && !(OutputStride & 0xF) )
{ {
if ( !((uintptr_t)pInputStream & 0xF) && !(InputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pInputStream) & 0xF) && !(InputStride & 0xF) )
{ {
// Aligned input, aligned output // Aligned input, aligned output
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)
@ -14351,7 +14360,7 @@ inline XMFLOAT4* XM_CALLCONV XMVector4TransformStream
} }
else else
{ {
if ( !((uintptr_t)pInputStream & 0xF) && !(InputStride & 0xF) ) if ( !(reinterpret_cast<uintptr_t>(pInputStream) & 0xF) && !(InputStride & 0xF) )
{ {
// Aligned input, unaligned output // Aligned input, unaligned output
for (size_t i = 0; i < VectorCount; i++) for (size_t i = 0; i < VectorCount; i++)

File diff suppressed because it is too large Load Diff