fixed softfloat FUZ condition. fixed/optimized pmaddwd computing function

This commit is contained in:
Stanislav Shwartsman 2017-03-30 22:11:38 +00:00
parent a6e7ffb284
commit 566a7aa82b
2 changed files with 4 additions and 9 deletions

View File

@ -883,7 +883,7 @@ static float32 addFloat32Sigs(float32 a, float32 b, int zSign, float_status_t &s
zSig = (aSig + bSig) >> 6; zSig = (aSig + bSig) >> 6;
if (aSig | bSig) { if (aSig | bSig) {
float_raise(status, float_flag_denormal); float_raise(status, float_flag_denormal);
if (get_flush_underflow_to_zero(status)) { if (get_flush_underflow_to_zero(status) && (extractFloat32Frac(zSig) == zSig)) {
float_raise(status, float_flag_underflow | float_flag_inexact); float_raise(status, float_flag_underflow | float_flag_inexact);
return packFloat32(zSign, 0, 0); return packFloat32(zSign, 0, 0);
} }
@ -2109,7 +2109,7 @@ static float64 addFloat64Sigs(float64 a, float64 b, int zSign, float_status_t &s
zSig = (aSig + bSig) >> 9; zSig = (aSig + bSig) >> 9;
if (aSig | bSig) { if (aSig | bSig) {
float_raise(status, float_flag_denormal); float_raise(status, float_flag_denormal);
if (get_flush_underflow_to_zero(status)) { if (get_flush_underflow_to_zero(status) && (extractFloat64Frac(zSig) == zSig)) {
float_raise(status, float_flag_underflow | float_flag_inexact); float_raise(status, float_flag_underflow | float_flag_inexact);
return packFloat64(zSign, 0, 0); return packFloat64(zSign, 0, 0);
} }

View File

@ -1009,13 +1009,8 @@ BX_CPP_INLINE void xmm_pmaddwd(BxPackedXmmRegister *op1, const BxPackedXmmRegist
{ {
for(unsigned n=0; n<4; n++) for(unsigned n=0; n<4; n++)
{ {
if((op1->xmm32u(n) & op2->xmm32u(n)) == 0x80008000) { op1->xmm32u(n) = Bit32s(op1->xmm16s(n*2)) * Bit32s(op2->xmm16s(n*2)) +
op1->xmm32u(n) = 0x80000000; Bit32s(op1->xmm16s(n*2+1)) * Bit32s(op2->xmm16s(n*2+1));
}
else {
op1->xmm32u(n) = Bit32s(op1->xmm16s(n*2)) * Bit32s(op2->xmm16s(n*2)) +
Bit32s(op1->xmm16s(n*2+1)) * Bit32s(op2->xmm16s(n*2+1));
}
} }
} }