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:
parent
939c94571b
commit
196104d0eb
@ -3233,15 +3233,13 @@ inline XMVECTOR XM_CALLCONV XMVectorReciprocalSqrt(FXMVECTOR V) noexcept
|
|||||||
inline XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept
|
inline XMVECTOR XM_CALLCONV XMVectorExp2(FXMVECTOR V) noexcept
|
||||||
{
|
{
|
||||||
#if defined(_XM_NO_INTRINSICS_)
|
#if defined(_XM_NO_INTRINSICS_)
|
||||||
|
|
||||||
XMVECTORF32 Result = { { {
|
XMVECTORF32 Result = { { {
|
||||||
exp2f(V.vector4_f32[0]),
|
exp2f(V.vector4_f32[0]),
|
||||||
exp2f(V.vector4_f32[1]),
|
exp2f(V.vector4_f32[1]),
|
||||||
exp2f(V.vector4_f32[2]),
|
exp2f(V.vector4_f32[2]),
|
||||||
exp2f(V.vector4_f32[3])
|
exp2f(V.vector4_f32[3])
|
||||||
} } };
|
} } };
|
||||||
return Result;
|
return Result.v;
|
||||||
|
|
||||||
#elif defined(_XM_ARM_NEON_INTRINSICS_)
|
#elif defined(_XM_ARM_NEON_INTRINSICS_)
|
||||||
int32x4_t itrunc = vcvtq_s32_f32(V);
|
int32x4_t itrunc = vcvtq_s32_f32(V);
|
||||||
float32x4_t ftrunc = vcvtq_f32_s32(itrunc);
|
float32x4_t ftrunc = vcvtq_f32_s32(itrunc);
|
||||||
@ -3584,7 +3582,6 @@ namespace Internal
|
|||||||
inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
|
inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
|
||||||
{
|
{
|
||||||
#if defined(_XM_NO_INTRINSICS_)
|
#if defined(_XM_NO_INTRINSICS_)
|
||||||
|
|
||||||
XMVECTORF32 Result = { { {
|
XMVECTORF32 Result = { { {
|
||||||
log2f(V.vector4_f32[0]),
|
log2f(V.vector4_f32[0]),
|
||||||
log2f(V.vector4_f32[1]),
|
log2f(V.vector4_f32[1]),
|
||||||
@ -3592,7 +3589,6 @@ inline XMVECTOR XM_CALLCONV XMVectorLog2(FXMVECTOR V) noexcept
|
|||||||
log2f(V.vector4_f32[3])
|
log2f(V.vector4_f32[3])
|
||||||
} } };
|
} } };
|
||||||
return Result.v;
|
return Result.v;
|
||||||
|
|
||||||
#elif defined(_XM_ARM_NEON_INTRINSICS_)
|
#elif defined(_XM_ARM_NEON_INTRINSICS_)
|
||||||
int32x4_t rawBiased = vandq_s32(V, g_XMInfinity);
|
int32x4_t rawBiased = vandq_s32(V, g_XMInfinity);
|
||||||
int32x4_t trailing = vandq_s32(V, g_XMQNaNTest);
|
int32x4_t trailing = vandq_s32(V, g_XMQNaNTest);
|
||||||
|
@ -3460,7 +3460,7 @@ inline void XM_CALLCONV XMStoreByteN4
|
|||||||
#if defined(_XM_NO_INTRINSICS_)
|
#if defined(_XM_NO_INTRINSICS_)
|
||||||
|
|
||||||
XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
|
XMVECTOR N = XMVectorClamp(V, g_XMNegativeOne.v, g_XMOne.v);
|
||||||
N = XMVectorMultiply(V, g_ByteMax);
|
N = XMVectorMultiply(N, g_ByteMax);
|
||||||
N = XMVectorTruncate(N);
|
N = XMVectorTruncate(N);
|
||||||
|
|
||||||
XMFLOAT4A tmp;
|
XMFLOAT4A tmp;
|
||||||
|
Loading…
Reference in New Issue
Block a user