X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fsparc%2Fsystem.lisp;h=0e5b9935ed5907a5c274c3ce49f18f76a6356c61;hb=7deecae2d959173eda6a153d490c752c32050a9e;hp=77ab3ead51cb9bba44bc8652b370c97a08f1e9af;hpb=68fd2d2dd6f265669a8957accd8a33e62786a97e;p=sbcl.git diff --git a/src/compiler/sparc/system.lisp b/src/compiler/sparc/system.lisp index 77ab3ea..0e5b993 100644 --- a/src/compiler/sparc/system.lisp +++ b/src/compiler/sparc/system.lisp @@ -42,13 +42,13 @@ (inst b :eq done) ;; Okay, it is an immediate. If fixnum, we want zero. Otherwise, ;; we want the low 8 bits. - (inst andcc zero-tn object #b11) + (inst andcc zero-tn object fixnum-tag-mask) (inst b :eq done) (inst li result 0) ;; It wasn't a fixnum, so get the low 8 bits. (inst b done) (inst and result object widetag-mask) - + FUNCTION-POINTER (inst b done) (load-type result object (- fun-pointer-lowtag)) @@ -68,11 +68,13 @@ (:generator 6 (load-type result function (- fun-pointer-lowtag)))) +;;; Is this VOP dead? I can't see anywhere that it is used... -- CSR, +;;; 2002-06-21 (define-vop (set-fun-subtype) (: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) @@ -106,7 +108,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) @@ -115,7 +117,7 @@ (inst and t1 widetag-mask) (sc-case data (any-reg - (inst sll t2 data (- n-widetag-bits 2)) + (inst sll t2 data (- n-widetag-bits n-fixnum-tag-bits)) (inst or t1 t2)) (immediate (inst or t1 (ash (tn-value data) n-widetag-bits))) @@ -124,20 +126,21 @@ (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 - ;; FIXME: CMUCL comment: - ;; Some code (the hash table code) depends on this returning a - ;; positive number so make sure it does. + ;; FIXME: It would be better if this would mask the lowtag, + ;; and shift the result into a positive fixnum like on x86. (inst sll res ptr 3) (inst srl res res 1))) (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 @@ -146,8 +149,8 @@ (inst sll temp val n-widetag-bits) (inst or res temp (tn-value type))) (t - (inst sra temp type 2) - (inst sll res val (- n-widetag-bits 2)) + (inst sra temp type n-fixnum-tag-bits) + (inst sll res val (- n-widetag-bits n-fixnum-tag-bits)) (inst or res res temp))))) @@ -196,7 +199,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) @@ -220,6 +223,8 @@ (:generator 1 (inst unimp pending-interrupt-trap))) +#!+sb-thread +(error "write a VOP for CURRENT-THREAD-OFFSET-SAP") (define-vop (halt) (:generator 1 @@ -235,9 +240,9 @@ (:temporary (:scs (non-descriptor-reg)) count) (:generator 1 (let ((offset - (- (* (+ index vector-data-offset) n-word-bytes) - other-pointer-lowtag))) - (assert (typep offset '(signed-byte 13))) + (- (* (+ index vector-data-offset) n-word-bytes) + other-pointer-lowtag))) + (aver (typep offset '(signed-byte 13))) (inst ld count count-vector offset) (inst add count 1) (inst st count count-vector offset))))