X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Farith.lisp;h=0a073c7996d2127ab75a7a6c099787c85a21d8af;hb=3da8e4ca35e534942f7a5046490d169509170c85;hp=8f40dd8fd442ea0518dbb5a60e8a525ce6c4a1ae;hpb=23b070aba7a0f3339358ef7dea05684f93b065a9;p=sbcl.git diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index 8f40dd8..0a073c7 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -128,7 +128,6 @@ (:result-types unsigned-num) (:note "inline (unsigned-byte 32) 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) @@ -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) @@ -328,7 +327,7 @@ (: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) @@ -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 @@ -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. @@ -909,7 +908,6 @@ DONE)) -;;; Note: documentation for this function is wrong - rtfm (define-vop (signed-byte-64-len) (:translate integer-length) (:note "inline (signed-byte 32) integer-length") @@ -925,9 +923,9 @@ (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)) @@ -942,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)) @@ -1262,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))