X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fppc%2Fsystem.lisp;h=301da10325ec96dbdced5d5fb123afae94e8b938;hb=7deecae2d959173eda6a153d490c752c32050a9e;hp=d03f15dc6ab017c761f36df9ac7b2066437d8eda;hpb=6365d636fa30ff3e2c2ebc9668f978fa0ebc7a0e;p=sbcl.git diff --git a/src/compiler/ppc/system.lisp b/src/compiler/ppc/system.lisp index d03f15d..301da10 100644 --- a/src/compiler/ppc/system.lisp +++ b/src/compiler/ppc/system.lisp @@ -42,12 +42,12 @@ (inst beq done) ;; Okay, it is an immediate. If fixnum, we want zero. Otherwise, ;; we want the low 8 bits. - (inst andi. result object #b11) + (inst andi. result object fixnum-tag-mask) (inst beq done) ;; It wasn't a fixnum, so get the low 8 bits. (inst andi. result object widetag-mask) (inst b done) - + FUNCTION-POINTER (load-type result object (- fun-pointer-lowtag)) (inst b done) @@ -71,7 +71,7 @@ (:translate (setf fun-subtype)) (:policy :fast-safe) (:args (type :scs (unsigned-reg) :target result) - (function :scs (descriptor-reg))) + (function :scs (descriptor-reg))) (:arg-types positive-fixnum *) (:results (result :scs (unsigned-reg))) (:result-types positive-fixnum) @@ -103,7 +103,7 @@ (:translate set-header-data) (:policy :fast-safe) (:args (x :scs (descriptor-reg) :target res) - (data :scs (any-reg immediate zero))) + (data :scs (any-reg immediate zero))) (:arg-types * positive-fixnum) (:results (res :scs (descriptor-reg))) (:temporary (:scs (non-descriptor-reg)) t1 t2) @@ -112,7 +112,7 @@ (inst andi. t1 t1 widetag-mask) (sc-case data (any-reg - (inst slwi t2 data (- n-widetag-bits 2)) + (inst slwi t2 data (- n-widetag-bits n-fixnum-tag-bits)) (inst or t1 t1 t2)) (immediate (inst ori t1 t1 (ash (tn-value data) n-widetag-bits))) @@ -121,20 +121,20 @@ (move res x))) -(define-vop (make-fixnum) +(define-vop (pointer-hash) + (:translate pointer-hash) (:args (ptr :scs (any-reg descriptor-reg))) (:results (res :scs (any-reg descriptor-reg))) + (:policy :fast-safe) (:generator 1 - ;; - ;; Some code (the hash table code) depends on this returning a - ;; positive number so make sure it does. - (inst slwi res ptr 3) - (inst srwi res res 1))) + ;; FIXME: It would be better if this would mask the lowtag, + ;; and shift the result into a positive fixnum like on x86. + (inst rlwinm res ptr n-fixnum-tag-bits 1 n-positive-fixnum-bits))) (define-vop (make-other-immediate-type) (:args (val :scs (any-reg descriptor-reg)) - (type :scs (any-reg descriptor-reg immediate) - :target temp)) + (type :scs (any-reg descriptor-reg immediate) + :target temp)) (:results (res :scs (any-reg descriptor-reg))) (:temporary (:scs (non-descriptor-reg)) temp) (:generator 2 @@ -143,8 +143,8 @@ (inst slwi temp val n-widetag-bits) (inst ori res temp (tn-value type))) (t - (inst srawi temp type 2) - (inst slwi res val (- n-widetag-bits 2)) + (inst srawi temp type n-fixnum-tag-bits) + (inst slwi res val (- n-widetag-bits n-fixnum-tag-bits)) (inst or res res temp))))) @@ -193,7 +193,7 @@ (define-vop (compute-fun) (:args (code :scs (descriptor-reg)) - (offset :scs (signed-reg unsigned-reg))) + (offset :scs (signed-reg unsigned-reg))) (:arg-types * positive-fixnum) (:results (func :scs (descriptor-reg))) (:temporary (:scs (non-descriptor-reg)) ndescr) @@ -229,7 +229,7 @@ (:temporary (:scs (non-descriptor-reg)) count) (:generator 1 (let ((offset - (- (* (+ index vector-data-offset) n-word-bytes) other-pointer-lowtag))) + (- (* (+ index vector-data-offset) n-word-bytes) other-pointer-lowtag))) (aver (typep offset '(signed-byte 16))) (inst lwz count count-vector offset) (inst addi count count 1)