PPC: Fix NaN Canonicalization.
authormbrandy <mbrandy@us.ibm.com>
Mon, 13 Apr 2015 16:24:31 +0000 (09:24 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 13 Apr 2015 16:24:24 +0000 (16:24 +0000)
Use fsub rather than fadd to avoid stripping the sign from minus zero.

Fixes mjsunit/result-table-min and mjsunit/result-table-max test failures.

R=michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1084583003

Cr-Commit-Position: refs/heads/master@{#27794}

src/ppc/macro-assembler-ppc.cc

index bfca9b36506e7b7a2b6548dd988eef649a549627..5231f4ae4be4e7050c5bed137ec464be6b96e774 100644 (file)
@@ -602,7 +602,7 @@ MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
 void MacroAssembler::CanonicalizeNaN(const DoubleRegister dst,
                                      const DoubleRegister src) {
   // Turn potential sNaN into qNaN.
-  fadd(dst, src, kDoubleRegZero);
+  fsub(dst, src, kDoubleRegZero);
 }