Fix previous commit: We should only mask the top bit in the STRTOG_NaNBits

case, not the STRTOG_Normal case.
This commit is contained in:
David Schultz 2007-12-16 23:31:55 +00:00
parent 3d6d3ed091
commit fb048cca0c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174690
2 changed files with 14 additions and 1 deletions

View File

@ -65,6 +65,12 @@ ULtoQ(ULong *L, ULong *bits, Long exp, int k)
break;
case STRTOG_Normal:
L[_3] = bits[0];
L[_2] = bits[1];
L[_1] = bits[2];
L[_0] = (bits[3] & ~0x10000) | ((exp + 0x3fff + 112) << 16);
break;
case STRTOG_NaNbits:
L[_3] = bits[0];
L[_2] = bits[1];

View File

@ -71,9 +71,16 @@ ULtox(UShort *L, ULong *bits, Long exp, int k)
goto normal_bits;
case STRTOG_Normal:
case STRTOG_NaNbits:
L[_0] = exp + 0x3fff + 63;
normal_bits:
L[_4] = (UShort)bits[0];
L[_3] = (UShort)(bits[0] >> 16);
L[_2] = (UShort)bits[1];
L[_1] = (UShort)(bits[1] >> 16);
break;
case STRTOG_NaNbits:
L[_0] = exp + 0x3fff + 63;
L[_4] = (UShort)bits[0];
L[_3] = (UShort)(bits[0] >> 16);
L[_2] = (UShort)bits[1];