1
0
mirror of https://github.com/microsoft/DirectXMath synced 2024-11-09 22:20:08 +00:00

Fixed clamping for XMStoreByteN4

This commit is contained in:
Chuck Walbourn 2020-05-18 23:40:27 -07:00
parent 939c94571b
commit 196104d0eb
2 changed files with 2 additions and 6 deletions

View File

@ -3233,15 +3233,13 @@ inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept
inline XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept
{
#if defined(_XM_NO_INTRINSICS_)
XMVECTORF32 Result = { { {
exp2f(V.vector4_f32[0]),
exp2f(V.vector4_f32[1]),
exp2f(V.vector4_f32[2]),
exp2f(V.vector4_f32[3])
} } };
return Result;
return Result.v;
#elif defined(_XM_ARM_NEON_INTRINSICS_)
int32x4_t itrunc = vcvtq_s32_f32(V);
float32x4_t ftrunc = vcvtq_f32_s32(itrunc);
@ -3584,7 +3582,6 @@ namespace Internal
inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
{
#if defined(_XM_NO_INTRINSICS_)
XMVECTORF32 Result = { { {
log2f(V.vector4_f32[0]),
log2f(V.vector4_f32[1]),
@ -3592,7 +3589,6 @@ inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
log2f(V.vector4_f32[3])
} } };
return Result.v;
#elif defined(_XM_ARM_NEON_INTRINSICS_)
int32x4_t rawBiased = vandq_s32(V, g_XMInfinity);
int32x4_t trailing = vandq_s32(V, g_XMQNaNTest);

View File

@ -3460,7 +3460,7 @@ inline void XM_CALLCONV XMStoreByteN4
#if defined(_XM_NO_INTRINSICS_)
XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
N = XMVectorMultiply(V, g_ByteMax);
N = XMVectorMultiply(N, g_ByteMax);
N = XMVectorTruncate(N);
XMFLOAT4A tmp;