0.8.13.34:
authorNathan Froyd <froydnj@cs.rice.edu>
Fri, 6 Aug 2004 22:55:16 +0000 (22:55 +0000)
committerNathan Froyd <froydnj@cs.rice.edu>
Fri, 6 Aug 2004 22:55:16 +0000 (22:55 +0000)
* Start using Helmut Eller's cute computed features expression
  to distinguish between 32-bit and 64-bit pieces of code.
  Particularly useful because architecture names are not
  hardcoded; this idiom may have to be squirreled away in a
  function somewhere.
* SB!VM:WORD-SHIFT and SB!VM:N-WORD-BYTES were being defined
  the same way in every backend; move their definitions to
  generic/early-vm for MORE OOAO.  Tidy up comments in various
  backends for remaining constants--you can almost see the
  common code cut-and-pasted in each backend...

src/compiler/alpha/parms.lisp
src/compiler/generic/early-objdef.lisp
src/compiler/generic/early-vm.lisp
src/compiler/generic/genesis.lisp
src/compiler/hppa/parms.lisp
src/compiler/mips/parms.lisp
src/compiler/ppc/parms.lisp
src/compiler/sparc/parms.lisp
src/compiler/x86-64/parms.lisp
src/compiler/x86/parms.lisp
version.lisp-expr

index b13e2de..a19fc93 100644 (file)
 
 (eval-when  (:compile-toplevel :load-toplevel :execute)
 
-(def!constant n-word-bits 32
-  #!+sb-doc
-  "Number of bits per word where a word holds one lisp descriptor.")
+;;; number of bits per word where a word holds one lisp descriptor
+(def!constant n-word-bits 32)
 
 ;;; the natural width of a machine word (as seen in e.g. register width,
 ;;; address space)
 (def!constant n-machine-word-bits 64)
 
-(def!constant n-byte-bits 8
-  #!+sb-doc
-  "Number of bits per byte where a byte is the smallest addressable object.")
-
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
-  #!+sb-doc
-  "Number of bits to shift between word addresses and byte addresses.")
-
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits)
-  #!+sb-doc
-  "Number of bytes in a word.")
+;;; number of bits per byte where a byte is the smallest addressable
+;;; object
+(def!constant n-byte-bits 8)
 
 (def!constant float-sign-shift 31)
 
index 2b1cff0..090decb 100644 (file)
@@ -43,7 +43,7 @@
   ;; The EVAL-WHEN is necessary (at least for Lispworks), because the
   ;; second DEFENUM uses the value of OTHER-IMMEDIATE-0-LOWTAG, which is
   ;; defined in the first DEFENUM. -- AL 20000216
-  #!+x86-64
+  #!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
   (defenum (:suffix -lowtag)
     even-fixnum
     instance-pointer
@@ -57,7 +57,7 @@
     pad3 pad4 pad5
     other-immediate-3
     other-pointer)
-  #!-x86-64
+  #!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
   (defenum (:suffix -lowtag)
     even-fixnum
     instance-pointer
index 1e7ec1c..9b854ea 100644 (file)
 ;;; the bit width of positive fixnums
 (def!constant n-positive-fixnum-bits (- n-word-bits n-fixnum-tag-bits 1))
 
+;;; the number of bits to shift between word addresses and byte addresses
+(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits))))
+
+;;; the number of bytes in a word
+(def!constant n-word-bytes (/ n-word-bits n-byte-bits))
+
 ;;; the number of bits used in the header word of a data block to store
 ;;; the type
 (def!constant n-widetag-bits 8)
index 7ef58ec..a5bbe1f 100644 (file)
   (make-bvref-n 64))
 
 ;; lispobj-sized word, whatever that may be
+;; hopefully nobody ever wants a 128-bit SBCL...
+#!+#.(cl:if (cl:= 64 sb!vm:n-word-bits) '(and) '(or))
+(progn
 (defun bvref-word (bytes index)
-  #!+x86-64 (bvref-64 bytes index)
-  #!-x86-64 (bvref-32 bytes index))
+  (bvref-64 bytes index))
+(defun (setf bvref-word) (new-val bytes index)
+  (setf (bvref-64 bytes index) new-val)))
 
+#!+#.(cl:if (cl:= 32 sb!vm:n-word-bits) '(and) '(or))
+(progn
+(defun bvref-word (bytes index)
+  (bvref-32 bytes index))
 (defun (setf bvref-word) (new-val bytes index)
-  #!+x86-64 (setf (bvref-64 bytes index) new-val)
-  #!-x86-64 (setf (bvref-32 bytes index) new-val))
+  (setf (bvref-32 bytes index) new-val)))
+
 \f
 ;;;; representation of spaces in the core
 
index af2c41b..53bc314 100644 (file)
@@ -3,21 +3,16 @@
 \f
 ;;;; Machine Architecture parameters:
 
-(def!constant n-word-bits 32
-  "Number of bits per word where a word holds one lisp descriptor.")
+;;; number of bits per word where a word holds one lisp descriptor
+(def!constant n-word-bits 32)
 
 ;;; the natural width of a machine word (as seen in e.g. register width,
 ;;; address space)
 (def!constant n-machine-word-bits 32)
 
-(def!constant n-byte-bits 8
-  "Number of bits per byte where a byte is the smallest addressable object.")
-
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
-  "Number of bits to shift between word addresses and byte addresses.")
-
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits)
-  "Number of bytes in a word.")
+;;; number of bits per byte where a byte is the smallest addressable
+;;; object
+(def!constant n-byte-bits 8)
 
 (def!constant float-sign-shift 31)
 
index 4989172..6095c53 100644 (file)
@@ -1,20 +1,15 @@
 (in-package "SB!VM")
 
-(def!constant n-word-bits 32
-  "Number of bits per word where a word holds one lisp descriptor.")
+;;; number of bits per word where a word holds one lisp descriptor
+(def!constant n-word-bits 32)
 
 ;;; the natural width of a machine word (as seen in e.g. register width,
 ;;; address space)
 (def!constant n-machine-word-bits 32)
 
-(def!constant n-byte-bits 8
-  "Number of bits per byte where a byte is the smallest addressable object.")
-
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
-  "Number of bits to shift between word addresses and byte addresses.")
-
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits)
-  "Number of bytes in a word.")
+;;; number of bits per byte where a byte is the smallest addressable
+;;; object
+(def!constant n-byte-bits 8)
 
 
 (def!constant float-sign-shift 31)
index 4e05dd7..86a439d 100644 (file)
 
 (in-package "SB!VM")
 
-(def!constant n-word-bits 32
-  "Number of bits per word where a word holds one lisp descriptor.")
+;;; number of bits per word where a word holds one lisp descriptor
+(def!constant n-word-bits 32)
 
 ;;; the natural width of a machine word (as seen in e.g. register width,
 ;;; address space)
 (def!constant n-machine-word-bits 32)
 
-(def!constant n-byte-bits 8
-  "Number of bits per byte where a byte is the smallest addressable object.")
-
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
-  "Number of bits to shift between word addresses and byte addresses.")
-
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits)
-  "Number of bytes in a word.")
+;;; number of bits per byte where a byte is the smallest addressable
+;;; object
+(def!constant n-byte-bits 8)
 
 
 (def!constant float-sign-shift 31)
index 4e4461e..897048b 100644 (file)
 ;;;; Machine Architecture parameters:
 (eval-when (:compile-toplevel :load-toplevel :execute)
 
-(def!constant n-word-bits 32
-  #!+sb-doc
-  "Number of bits per word where a word holds one lisp descriptor.")
+;;; number of bits per word where a word holds one lisp descriptor
+(def!constant n-word-bits 32)
 
 ;;; the natural width of a machine word (as seen in e.g. register width,
 ;;; address space)
 (def!constant n-machine-word-bits 32)
 
-(def!constant n-byte-bits 8
-  #!+sb-doc
-  "Number of bits per byte where a byte is the smallest addressable object.")
-
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits)))
-  #!+sb-doc
-  "Number of bits to shift between word addresses and byte addresses.")
-
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits)
-  #!+sb-doc
-  "Number of bytes in a word.")
+;;; number of bits per byte where a byte is the smallest addressable object
+(def!constant n-byte-bits 8)
 
 (def!constant float-sign-shift 31)
 
index 702b334..ae33140 100644 (file)
 ;;; addressable object
 (def!constant n-byte-bits 8)
 
-;;; the number of bits to shift between word addresses and byte addresses
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits))))
-
-;;; the number of bytes in a word
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits))
-
 (def!constant float-sign-shift 31)
 
 ;;; comment from CMU CL:
index 27d9cd3..cb4d029 100644 (file)
 ;;; addressable object
 (def!constant n-byte-bits 8)
 
-;;; the number of bits to shift between word addresses and byte addresses
-(def!constant word-shift (1- (integer-length (/ n-word-bits n-byte-bits))))
-
-;;; the number of bytes in a word
-(def!constant n-word-bytes (/ n-word-bits n-byte-bits))
-
 (def!constant float-sign-shift 31)
 
 ;;; comment from CMU CL:
index f6417b5..e0c261c 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.13.33"
+"0.8.13.34"