0.8.9.28:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 8 Apr 2004 09:25:08 +0000 (09:25 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 8 Apr 2004 09:25:08 +0000 (09:25 +0000)
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
src/compiler/generic/late-type-vops.lisp
src/compiler/ppc/type-vops.lisp
src/compiler/sparc/parms.lisp
version.lisp-expr

index afc7dfc..1e7ec1c 100644 (file)
 
 ;;; 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
index 0563804..14bcd83 100644 (file)
@@ -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)
index 3b2b34a..9a82f52 100644 (file)
 \f
 (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)))
                 ,@(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)))
index c0f3dbb..4e4461e 100644 (file)
   #!+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)
index c59abcd..66d7616 100644 (file)
@@ -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"