]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
x86/amd64 FXTRACT: mimic the Core i5 behaviour when the argument is a
authorJulian Seward <jseward@acm.org>
Thu, 29 Jul 2010 07:01:29 +0000 (07:01 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 29 Jul 2010 07:01:29 +0000 (07:01 +0000)
negative NaN.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1992

VEX/priv/guest_generic_x87.c

index f022f80ae10be430b7afeaa553fa50143c5fd11e..5173e5283aa4579e83151dd38788dcd99b614439 100644 (file)
@@ -453,13 +453,13 @@ ULong x86amd64g_calculate_FXTRACT ( ULong arg, HWord getExp )
    const ULong bit52   = 1ULL << 52;
    const ULong sigMask = bit52 - 1;
 
-   /* Mimic PIII behaviour for special cases. */
+   /* Mimic Core i5 behaviour for special cases. */
    if (arg == posInf)
       return getExp ? posInf : posInf;
    if (arg == negInf)
       return getExp ? posInf : negInf;
    if ((arg & nanMask) == nanMask)
-      return qNan;
+      return qNan | (arg & (1ULL << 63));
    if (arg == posZero)
       return getExp ? negInf : posZero;
    if (arg == negZero)