X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Farith.lisp;h=4abd9c63b014d516649531ccfa13645730913224;hb=ad9090dc91fc922a2d7edb256411c1593d12b33a;hp=d557048a270585d5de98fd3d439b18788a5af9d1;hpb=d95f1e6476aa63695e018a7769a1ae9e002fca36;p=sbcl.git diff --git a/src/compiler/x86/arith.lisp b/src/compiler/x86/arith.lisp index d557048..4abd9c6 100644 --- a/src/compiler/x86/arith.lisp +++ b/src/compiler/x86/arith.lisp @@ -359,7 +359,7 @@ (:note "inline fixnum arithmetic") (:generator 4 (move r x) - (inst sar r 2) + (inst sar r n-fixnum-tag-bits) (inst imul r y))) (define-vop (fast-*-c/fixnum=>fixnum fast-safe-arith-op) @@ -445,8 +445,9 @@ (inst cdq) (inst idiv eax y) (if (location= quo eax) - (inst shl eax 2) - (inst lea quo (make-ea :dword :index eax :scale 4))) + (inst shl eax n-fixnum-tag-bits) + (inst lea quo (make-ea :dword :index eax + :scale (ash 1 n-fixnum-tag-bits)))) (move rem edx))) (define-vop (fast-truncate-c/fixnum=>fixnum fast-safe-arith-op) @@ -471,8 +472,9 @@ (inst mov y-arg (fixnumize y)) (inst idiv eax y-arg) (if (location= quo eax) - (inst shl eax 2) - (inst lea quo (make-ea :dword :index eax :scale 4))) + (inst shl eax n-fixnum-tag-bits) + (inst lea quo (make-ea :dword :index eax + :scale (ash 1 n-fixnum-tag-bits)))) (move rem edx))) (define-vop (fast-truncate/unsigned=>unsigned fast-safe-arith-op) @@ -1213,21 +1215,6 @@ ;;;; 32-bit logical operations -(define-vop (merge-bits) - (:translate merge-bits) - (:args (shift :scs (signed-reg unsigned-reg) :target ecx) - (prev :scs (unsigned-reg) :target result) - (next :scs (unsigned-reg))) - (:arg-types tagged-num unsigned-num unsigned-num) - (:temporary (:sc signed-reg :offset ecx-offset :from (:argument 0)) ecx) - (:results (result :scs (unsigned-reg) :from (:argument 1))) - (:result-types unsigned-num) - (:policy :fast-safe) - (:generator 4 - (move ecx shift) - (move result prev) - (inst shrd result next :cl))) - ;;; Only the lower 5 bits of the shift amount are significant. (define-vop (shift-towards-someplace) (:policy :fast-safe) @@ -1596,7 +1583,7 @@ (:result-types unsigned-num) (:generator 1 (move digit fixnum) - (inst sar digit 2))) + (inst sar digit n-fixnum-tag-bits))) (define-vop (bignum-floor) (:translate sb!bignum:%floor) @@ -1632,7 +1619,7 @@ (:generator 1 (move res digit) (when (sc-is res any-reg control-stack) - (inst shl res 2)))) + (inst shl res n-fixnum-tag-bits)))) (define-vop (digit-ashr) (:translate sb!bignum:%ashr)