eval, float: fix the __float80e__ and __float128h__ conversions

We need to add the byte offset into the floating-point value to get
the correct result for these floating point to integer conversions.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2020-08-13 13:41:46 -07:00
parent 50200cc0d3
commit 7839766663
2 changed files with 4 additions and 1 deletions

View File

@ -727,7 +727,7 @@ static expr *eval_floatize(enum floatize type)
len = fmt->bytes - fmt->offset;
if (len > 8)
len = 8; /* Max 64 bits */
p = result + len;
p = result + len + fmt->offset;
val = 0;
for (i = len; i; i--) {
p--;

View File

@ -34,6 +34,9 @@ operation size (e.g. \c{movsd qword [eax],xmm0}).
\b The \c{-L+} option no longer enables \c{-Lw}, which is mainly
useful to debug NASM crashes. See \k{opt-L}.
\b Fix the \c{__float80e__} and \c{__float128h__} conversions, which
would return the wrong bytes of the result.
\S{cl-2.15.03} Version 2.15.03
\b Add instructions from the Intel Instruction Set Extensions and