aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2020-08-13 13:41:46 -0700
committerH. Peter Anvin <hpa@zytor.com>2020-08-13 13:41:46 -0700
commit783976666393dee5ca9f21e9a4339fd5dbf6ab0e (patch)
tree295191cbc81a85cbdf182b0560bb16bed85dcb0c
parent50200cc0d3d9847d40c5ed3ff87c47c1bde5d6dc (diff)
downloadnasm-783976666393dee5ca9f21e9a4339fd5dbf6ab0e.tar.gz
nasm-783976666393dee5ca9f21e9a4339fd5dbf6ab0e.tar.xz
nasm-783976666393dee5ca9f21e9a4339fd5dbf6ab0e.zip
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>
-rw-r--r--asm/eval.c2
-rw-r--r--doc/changes.src3
2 files changed, 4 insertions, 1 deletions
diff --git a/asm/eval.c b/asm/eval.c
index 5d6ee1e7..80fb4a28 100644
--- a/asm/eval.c
+++ b/asm/eval.c
@@ -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--;
diff --git a/doc/changes.src b/doc/changes.src
index 3de5ac7e..eb0031cc 100644
--- a/doc/changes.src
+++ b/doc/changes.src
@@ -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