X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Farith.lisp;h=d509aac0ada154434df4018cd23398c2b86be10e;hb=7a961398d8faa8f25725405c882245f498ff5117;hp=304590315fde2ecefede6d5e12f4404910b6dbef;hpb=673234cb910923d41badca51b383e3188f375691;p=sbcl.git diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index 3045903..d509aac 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -1415,8 +1415,8 @@ ;;; 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 -;;; 4. This is easy to deal with and may save a fixnum-word +;;; that it may be passed as a fixnum or word and thus may be 0, 1, or +;;; 8. This is easy to deal with and may save a fixnum-word ;;; conversion. (define-vop (add-w/carry) (:translate sb!bignum:%add-with-carry) @@ -1437,8 +1437,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-64 convention. (define-vop (sub-w/borrow) (:translate sb!bignum:%subtract-with-borrow) (:policy :fast-safe) @@ -1453,9 +1453,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)