From: Juho S. <js...@us...> - 2005-11-06 04:00:52
|
Update of /cvsroot/sbcl/sbcl/src/compiler/x86 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20054/src/compiler/x86 Modified Files: arith.lisp Log Message: 0.9.6.24: Faster bignum subtraction and division. (Patch from sbcl-devel "A microoptimisation of bignum subtraction on x86/x86-64" by Lutz Euler on 2005-10-16) Index: arith.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/arith.lisp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- arith.lisp 14 Jul 2005 19:13:47 -0000 1.37 +++ arith.lisp 6 Nov 2005 04:00:39 -0000 1.38 @@ -1421,7 +1421,7 @@ ;;; For add and sub with carry the sc of carry argument is any-reg so -;;; the it may be passed as a fixnum or word and thus may be 0, 1, or +;;; that it may be passed as a fixnum or word and thus may be 0, 1, or ;;; 4. This is easy to deal with and may save a fixnum-word ;;; conversion. (define-vop (add-w/carry) @@ -1443,8 +1443,8 @@ (inst mov carry 0) (inst adc carry carry))) -;;; Note: the borrow is the oppostite of the x86 convention - 1 for no -;;; borrow and 0 for a borrow. +;;; Note: the borrow is 1 for no borrow and 0 for a borrow, the opposite +;;; of the x86 convention. (define-vop (sub-w/borrow) (:translate sb!bignum:%subtract-with-borrow) (:policy :fast-safe) @@ -1459,9 +1459,8 @@ (inst cmp c 1) ; Set the carry flag to 1 if c=0 else to 0 (move result a) (inst sbb result b) - (inst mov borrow 0) - (inst adc borrow borrow) - (inst xor borrow 1))) + (inst mov borrow 1) + (inst sbb borrow 0))) (define-vop (bignum-mult-and-add-3-arg) |