]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix coding nit in x86amd64g_calculate_FXTRACT.
authorMark Wielaard <mark@klomp.org>
Tue, 28 May 2019 15:20:31 +0000 (17:20 +0200)
committerMark Wielaard <mark@klomp.org>
Tue, 28 May 2019 16:11:24 +0000 (18:11 +0200)
The current code "return getExp ? posInf : posInf;" looks like a typo.
But when the argument is positive infinity then both the significand
and the exponent are positive infinity (there is a fxtract testcase that
checks that). So no need to check getExp. Just always return posInf
if arg == posInf, but add a comment explaining why.

VEX/priv/guest_generic_x87.c

index 1e76395d524fc58b297e0eac9abca1b42cd079a3..85ebebdc77ed557f6027b6cc225272f0e908bd50 100644 (file)
@@ -453,7 +453,7 @@ ULong x86amd64g_calculate_FXTRACT ( ULong arg, HWord getExp )
 
    /* Mimic Core i5 behaviour for special cases. */
    if (arg == posInf)
-      return getExp ? posInf : posInf;
+      return posInf; /* Both significand and exponent are posInf. */
    if (arg == negInf)
       return getExp ? posInf : negInf;
    if ((arg & nanMask) == nanMask)