From 179dcdb7af4983fd42824db748ee6cb05f8d71cf Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Fri, 13 Oct 2017 15:44:39 -0300 Subject: [BZ #22142] powerpc: Fix the carry bit on mpn_[add|sub]_n on POWER7 Fix the ifdef clause that was being used in the opposite way, setting a wrong value of the carry bit. This is also correcting 2 memory accesses that were mistakenly referring to r0 while they were supposed to mean the immediate value 0. [BZ #22142] * stdio-common/tst-printf.c (fp_test): Add tests for DBL_MAX and -DBL_MAX. (do_test): Likewise. * stdio-common/tst-printf.sh: Likewise. * sysdeps/powerpc/powerpc64/power7/add_n.S: Invert the initial ifdef clause in order to set the carry bit right. Replace r0 by 0 without changing the behavior. --- sysdeps/powerpc/powerpc64/power7/add_n.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sysdeps/powerpc') diff --git a/sysdeps/powerpc/powerpc64/power7/add_n.S b/sysdeps/powerpc/powerpc64/power7/add_n.S index 02335c1848..88aec84e5a 100644 --- a/sysdeps/powerpc/powerpc64/power7/add_n.S +++ b/sysdeps/powerpc/powerpc64/power7/add_n.S @@ -38,17 +38,17 @@ ENTRY_TOCLESS (FUNC, 5) #ifdef USE_AS_SUB - addic r0, r0, 0 + addic r0, r1, -1 #else - addic r0, r1, -1 + addic r0, r0, 0 #endif andi. r7, N, 1 beq L(bx0) ld r7, 0(UP) - ld r9, r0(VP) + ld r9, 0(VP) ADDSUBC r11, r9, r7 - std r11, r0(RP) + std r11, 0(RP) cmpldi N, N, 1 beq N, L(end) addi UP, UP, 8 -- cgit 1.4.1