X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Farith.lisp;h=b0a7ead5493f3bcdf3e5cde6e1fee0d239497e81;hb=69d60b456b07a0256f08df0d02484f361ce5737c;hp=fad7497f294b56928c32459719a77a03acccda05;hpb=b914788eab773b579664dcdc09a5278161191c47;p=sbcl.git diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index fad7497..b0a7ead 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -28,7 +28,7 @@ (define-vop (signed-unop fast-safe-arith-op) (:args (x :scs (signed-reg) :target res)) (:results (res :scs (signed-reg))) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:arg-types signed-num) (:result-types signed-num)) @@ -90,7 +90,7 @@ (sc-is r unsigned-stack) (location= x r))))) (:result-types unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic")) + (:note "inline (unsigned-byte 64) arithmetic")) (define-vop (fast-signed-binop fast-safe-arith-op) (:args (x :target r :scs (signed-reg) @@ -106,7 +106,7 @@ (sc-is r signed-stack) (location= x r))))) (:result-types signed-num) - (:note "inline (signed-byte 32) arithmetic")) + (:note "inline (signed-byte 64) arithmetic")) (define-vop (fast-fixnum-binop-c fast-safe-arith-op) (:args (x :target r :scs (any-reg control-stack))) @@ -126,9 +126,8 @@ (:results (r :scs (unsigned-reg) :load-if (not (location= x r)))) (:result-types unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic")) + (:note "inline (unsigned-byte 64) arithmetic")) -;; 32 not 64 because it's hard work loading 64 bit constants (define-vop (fast-signed-binop-c fast-safe-arith-op) (:args (x :target r :scs (signed-reg signed-stack))) (:info y) @@ -136,7 +135,7 @@ (:results (r :scs (signed-reg) :load-if (not (location= x r)))) (:result-types signed-num) - (:note "inline (signed-byte 32) arithmetic")) + (:note "inline (signed-byte 64) arithmetic")) (macrolet ((define-binop (translate untagged-penalty op) `(progn @@ -243,7 +242,7 @@ (sc-is y signed-reg) (location= x r))))) (:result-types signed-num) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:generator 5 (cond ((and (sc-is x signed-reg) (sc-is y signed-reg) (sc-is r signed-reg) (not (location= x r))) @@ -268,7 +267,7 @@ (define-vop (fast-logand-c/signed-unsigned=>unsigned fast-logand-c/unsigned=>unsigned) (:args (x :target r :scs (signed-reg signed-stack))) - (:arg-types signed-num (:constant (unsigned-byte 32)))) + (:arg-types signed-num (:constant (unsigned-byte 31)))) (define-vop (fast-logand/unsigned-signed=>unsigned fast-logand/unsigned=>unsigned) @@ -289,7 +288,7 @@ (:results (r :scs (signed-reg) :load-if (not (location= x r)))) (:result-types signed-num) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:generator 4 (cond ((and (sc-is x signed-reg) (sc-is r signed-reg) (not (location= x r))) @@ -315,7 +314,7 @@ (sc-is r unsigned-stack) (location= x r))))) (:result-types unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic") + (:note "inline (unsigned-byte 64) arithmetic") (:generator 5 (cond ((and (sc-is x unsigned-reg) (sc-is y unsigned-reg) (sc-is r unsigned-reg) (not (location= x r))) @@ -328,11 +327,11 @@ (:translate +) (:args (x :target r :scs (unsigned-reg unsigned-stack))) (:info y) - (:arg-types unsigned-num (:constant (unsigned-byte 32))) + (:arg-types unsigned-num (:constant (unsigned-byte 31))) (:results (r :scs (unsigned-reg) :load-if (not (location= x r)))) (:result-types unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic") + (:note "inline (unsigned-byte 64) arithmetic") (:generator 4 (cond ((and (sc-is x unsigned-reg) (sc-is r unsigned-reg) (not (location= x r))) @@ -379,7 +378,7 @@ (:arg-types signed-num signed-num) (:results (r :scs (signed-reg) :from (:argument 0))) (:result-types signed-num) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:generator 5 (move r x) (inst imul r y))) @@ -392,7 +391,7 @@ (:arg-types signed-num (:constant (signed-byte 32))) (:results (r :scs (signed-reg))) (:result-types signed-num) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:generator 4 (inst imul r x y))) @@ -408,7 +407,7 @@ (:ignore edx) (:results (result :scs (unsigned-reg))) (:result-types unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic") + (:note "inline (unsigned-byte 64) arithmetic") (:vop-var vop) (:save-p :compute-only) (:generator 6 @@ -484,7 +483,7 @@ (:results (quo :scs (unsigned-reg)) (rem :scs (unsigned-reg))) (:result-types unsigned-num unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic") + (:note "inline (unsigned-byte 64) arithmetic") (:vop-var vop) (:save-p :compute-only) (:generator 33 @@ -503,7 +502,7 @@ (:translate truncate) (:args (x :scs (unsigned-reg) :target eax)) (:info y) - (:arg-types unsigned-num (:constant (unsigned-byte 32))) + (:arg-types unsigned-num (:constant (unsigned-byte 31))) (:temporary (:sc unsigned-reg :offset eax-offset :target quo :from :argument :to (:result 0)) eax) (:temporary (:sc unsigned-reg :offset edx-offset :target rem @@ -512,7 +511,7 @@ (:results (quo :scs (unsigned-reg)) (rem :scs (unsigned-reg))) (:result-types unsigned-num unsigned-num) - (:note "inline (unsigned-byte 32) arithmetic") + (:note "inline (unsigned-byte 64) arithmetic") (:vop-var vop) (:save-p :compute-only) (:generator 32 @@ -535,7 +534,7 @@ (:results (quo :scs (signed-reg)) (rem :scs (signed-reg))) (:result-types signed-num signed-num) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:vop-var vop) (:save-p :compute-only) (:generator 33 @@ -563,7 +562,7 @@ (:results (quo :scs (signed-reg)) (rem :scs (signed-reg))) (:result-types signed-num signed-num) - (:note "inline (signed-byte 32) arithmetic") + (:note "inline (signed-byte 64) arithmetic") (:vop-var vop) (:save-p :compute-only) (:generator 32 @@ -754,14 +753,14 @@ (move result number) (move ecx amount) (inst or ecx ecx) - (inst jmp :ns positive) + (inst jmp :ns POSITIVE) (inst neg ecx) (inst cmp ecx 63) - (inst jmp :be okay) + (inst jmp :be OKAY) (inst mov ecx 63) OKAY (inst sar result :cl) - (inst jmp done) + (inst jmp DONE) POSITIVE ;; The result-type ensures us that this shift will not overflow. @@ -783,15 +782,15 @@ (move result number) (move ecx amount) (inst or ecx ecx) - (inst jmp :ns positive) + (inst jmp :ns POSITIVE) (inst neg ecx) (inst cmp ecx 63) - (inst jmp :be okay) + (inst jmp :be OKAY) (inst xor result result) - (inst jmp done) + (inst jmp DONE) OKAY (inst shr result :cl) - (inst jmp done) + (inst jmp DONE) POSITIVE ;; The result-type ensures us that this shift will not overflow. @@ -895,13 +894,13 @@ (move result number) (move ecx amount) (inst or ecx ecx) - (inst jmp :ns positive) + (inst jmp :ns POSITIVE) (inst neg ecx) (inst xor zero zero) (inst shr result :cl) (inst cmp ecx 63) (inst cmov :nbe result zero) - (inst jmp done) + (inst jmp DONE) POSITIVE ;; The result-type ensures us that this shift will not overflow. @@ -911,7 +910,7 @@ (define-vop (signed-byte-64-len) (:translate integer-length) - (:note "inline (signed-byte 32) integer-length") + (:note "inline (signed-byte 64) integer-length") (:policy :fast-safe) (:args (arg :scs (signed-reg) :target res)) (:arg-types signed-num) @@ -924,16 +923,16 @@ (inst not res) POS (inst bsr res res) - (inst jmp :z zero) + (inst jmp :z ZERO) (inst inc res) - (inst jmp done) + (inst jmp DONE) ZERO (inst xor res res) DONE)) (define-vop (unsigned-byte-64-len) (:translate integer-length) - (:note "inline (unsigned-byte 32) integer-length") + (:note "inline (unsigned-byte 64) integer-length") (:policy :fast-safe) (:args (arg :scs (unsigned-reg))) (:arg-types unsigned-num) @@ -941,9 +940,9 @@ (:result-types unsigned-num) (:generator 26 (inst bsr res arg) - (inst jmp :z zero) + (inst jmp :z ZERO) (inst inc res) - (inst jmp done) + (inst jmp DONE) ZERO (inst xor res res) DONE)) @@ -1060,7 +1059,7 @@ (sc-is y signed-reg)))) (y :scs (signed-reg signed-stack))) (:arg-types signed-num signed-num) - (:note "inline (signed-byte 32) comparison")) + (:note "inline (signed-byte 64) comparison")) (define-vop (fast-conditional-c/signed fast-conditional/signed) (:args (x :scs (signed-reg signed-stack))) @@ -1073,7 +1072,7 @@ (sc-is y unsigned-reg)))) (y :scs (unsigned-reg unsigned-stack))) (:arg-types unsigned-num unsigned-num) - (:note "inline (unsigned-byte 32) comparison")) + (:note "inline (unsigned-byte 64) comparison")) (define-vop (fast-conditional-c/unsigned fast-conditional/unsigned) (:args (x :scs (unsigned-reg unsigned-stack))) @@ -1261,8 +1260,6 @@ ;; (no -C variant as x86 MUL instruction doesn't take an immediate) (def * nil)) -;;; (no -C variant as x86 MUL instruction doesn't take an immediate) - (define-vop (fast-ash-left-mod64-c/unsigned=>unsigned fast-ash-c/unsigned=>unsigned) (:translate ash-left-mod64))