[Gmp-commit] /var/hg/gmp-5.0: Fix of-by-one condition in invert_limb code.

mercurial at gmplib.org mercurial at gmplib.org
Wed Feb 8 22:58:59 CET 2012


details:   /var/hg/gmp-5.0/rev/66145957ec42
changeset: 13556:66145957ec42
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Feb 08 22:58:55 2012 +0100
description:
Fix of-by-one condition in invert_limb code.

diffstat:

 ChangeLog                  |   5 +++++
 mpn/powerpc32/divrem_2.asm |  10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r d51ec0330718 -r 66145957ec42 ChangeLog
--- a/ChangeLog	Wed Feb 08 11:47:19 2012 +0100
+++ b/ChangeLog	Wed Feb 08 22:58:55 2012 +0100
@@ -1,3 +1,8 @@
+2012-02-08  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/powerpc32/divrem_2.asm: Fix of-by-one condition in invert_limb
+	code.
+
 2012-02-08  Niels Möller  <nisse at lysator.liu.se>
 
 	* doc/gmp.texi (mpz_gcdext): Describe cofactor canonicalization.
diff -r d51ec0330718 -r 66145957ec42 mpn/powerpc32/divrem_2.asm
--- a/mpn/powerpc32/divrem_2.asm	Wed Feb 08 11:47:19 2012 +0100
+++ b/mpn/powerpc32/divrem_2.asm	Wed Feb 08 22:58:55 2012 +0100
@@ -1,6 +1,6 @@
 dnl  PPC-32 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
 
-dnl  Copyright 2007, 2008 Free Software Foundation, Inc.
+dnl  Copyright 2007, 2008, 2012 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -84,9 +84,9 @@
 	bge-	cr7, L(9)
 	add	r0, r0, r10
 	cmplw	cr7, r0, r10
-	cmplw	cr6, r0, r6
+	cmplw	cr6, r6, r0
 	addi	r31, r31, -1		C q1--
-	cror	28, 28, 25
+	crorc	28, 28, 25
 	bc+	12, 28, L(9)
 	addi	r31, r31, -1		C q1--
 	add	r0, r0, r10
@@ -101,9 +101,9 @@
 	bge-	cr7, L(13)
 	add	r0, r0, r10
 	cmplw	cr7, r0, r10
-	cmplw	cr6, r0, r11
+	cmplw	cr6, r11, r0
 	addi	r6, r6, -1		C q0--
-	cror	28, 28, 25
+	crorc	28, 28, 25
 	bc+	12, 28, L(13)
 C	add	r0, r0, r10		C final remainder
 	addi	r6, r6, -1		C q0--


More information about the gmp-commit mailing list