From 4af254de85367806d14ccafc4dfbe79a235b926d Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 8 Apr 2004 09:25:08 +0000 Subject: [PATCH] 0.8.9.28: Restore buildability goodness on PPC and SPARC ... move n-fixnum-foo-bits and so on from sparc-specific code to early-vm.lisp ... while I'm at it, make the n-lowtag-bits calculated rather than #+ / #- ... restore the hideous hack in ppc type-vops UGH UGH UGH (my brain is too slow to fix this properly) --- src/compiler/generic/early-vm.lisp | 9 ++++++++- src/compiler/generic/late-type-vops.lisp | 3 +-- src/compiler/ppc/type-vops.lisp | 15 +++++---------- src/compiler/sparc/parms.lisp | 12 ------------ version.lisp-expr | 2 +- 5 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/compiler/generic/early-vm.lisp b/src/compiler/generic/early-vm.lisp index afc7dfc..1e7ec1c 100644 --- a/src/compiler/generic/early-vm.lisp +++ b/src/compiler/generic/early-vm.lisp @@ -11,12 +11,19 @@ ;;; the number of bits at the low end of a pointer used for type ;;; information -(def!constant n-lowtag-bits #!+x86-64 4 #!-x86-64 3) +(def!constant n-lowtag-bits + (integer-length (1- (/ (* 2 n-word-bits) n-byte-bits)))) ;;; a mask to extract the low tag bits from a pointer (def!constant lowtag-mask (1- (ash 1 n-lowtag-bits))) ;;; the exclusive upper bound on the value of the low tag bits from a ;;; pointer (def!constant lowtag-limit (ash 1 n-lowtag-bits)) +;;; the number of tag bits used for a fixnum +(def!constant n-fixnum-tag-bits (1- n-lowtag-bits)) +;;; the fixnum tag mask +(def!constant fixnum-tag-mask (1- (ash 1 n-fixnum-tag-bits))) +;;; the bit width of positive fixnums +(def!constant n-positive-fixnum-bits (- n-word-bits n-fixnum-tag-bits 1)) ;;; the number of bits used in the header word of a data block to store ;;; the type diff --git a/src/compiler/generic/late-type-vops.lisp b/src/compiler/generic/late-type-vops.lisp index 0563804..14bcd83 100644 --- a/src/compiler/generic/late-type-vops.lisp +++ b/src/compiler/generic/late-type-vops.lisp @@ -15,8 +15,7 @@ ;; we can save a register on the x86. :variant simple ;; we can save a couple of instructions and a branch on the ppc. - ;; FIXME: make this be FIXNUM-MASK - :mask (ash lowtag-mask -1)) + :mask fixnum-tag-mask) (!define-type-vops functionp check-fun function object-not-fun-error (fun-pointer-lowtag) diff --git a/src/compiler/ppc/type-vops.lisp b/src/compiler/ppc/type-vops.lisp index 3b2b34a..9a82f52 100644 --- a/src/compiler/ppc/type-vops.lisp +++ b/src/compiler/ppc/type-vops.lisp @@ -13,14 +13,13 @@ (defun %test-fixnum (value target not-p &key temp) (assemble () - ;; FIXME: again, this 3 should be FIXNUM-MASK - (inst andi. temp value 3) + (inst andi. temp value fixnum-tag-mask) (inst b? (if not-p :ne :eq) target))) (defun %test-fixnum-and-headers (value target not-p headers &key temp) (let ((drop-through (gen-label))) (assemble () - (inst andi. temp value 3) + (inst andi. temp value fixnum-tag-mask) (inst beq (if not-p drop-through target))) (%test-headers value target not-p nil headers :drop-through drop-through :temp temp))) @@ -140,13 +139,9 @@ ,@(if mask `((inst andi. temp value ,mask) (inst twi 0 value (error-number-or-lose ',error-code)) - (inst twi :ne temp ,@(if ;; KLUDGE: At - ;; present, MASK is - ;; 3 or LOWTAG-MASK - (eql mask 3) - ;; KLUDGE - `(0) - type-codes)) + (inst twi :ne temp ,@(ecase mask + ((fixnum-tag-mask) `(0)) + ((lowtag-mask) type-codes))) (move result value)) `((let ((err-lab (generate-error-code vop ,error-code value))) diff --git a/src/compiler/sparc/parms.lisp b/src/compiler/sparc/parms.lisp index c0f3dbb..4e4461e 100644 --- a/src/compiler/sparc/parms.lisp +++ b/src/compiler/sparc/parms.lisp @@ -32,18 +32,6 @@ #!+sb-doc "Number of bytes in a word.") -(def!constant n-fixnum-tag-bits (1- n-lowtag-bits) - #!+sb-doc - "Number of tag bits used for a fixnum") - -(def!constant fixnum-tag-mask (1- (ash 1 n-fixnum-tag-bits)) - #!+sb-doc - "Mask to get the fixnum tag") - -(def!constant n-positive-fixnum-bits (- n-word-bits n-fixnum-tag-bits 1) - #!+sb-doc - "Maximum number of bits in a positive fixnum") - (def!constant float-sign-shift 31) (def!constant single-float-bias 126) diff --git a/version.lisp-expr b/version.lisp-expr index c59abcd..66d7616 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.9.27" +"0.8.9.28" -- 1.7.10.4