From b5237efc88c50577986563b7e8f126b95eb6a94e Mon Sep 17 00:00:00 2001 From: Raymond Toy <toy.raymond@gmail.com> Date: Mon, 18 Feb 2013 19:27:47 -0800 Subject: [PATCH] Add some fixnum contants for x86, as was done for sparc. code/export.lisp:: * Export new symbols compiler/x86/parms.lisp:: * Define constants for useful the number of lowtag bits and masks and the number of fixnum tag bits and masks. --- src/code/exports.lisp | 5 ++++- src/compiler/x86/parms.lisp | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/code/exports.lisp b/src/code/exports.lisp index b127c2743..3e9631b5a 100644 --- a/src/code/exports.lisp +++ b/src/code/exports.lisp @@ -1136,7 +1136,10 @@ "CHAR-BITS" "CHAR-BYTES" ) #+x86 - (:export "COMPATIBLE-FUNCTION-TYPES-P") + (:export "COMPATIBLE-FUNCTION-TYPES-P" + "POSITIVE-FIXNUM-BITS" + "FIXNUM-TAG-BITS" + "FIXNUM-TAG-MASK") #+sparc (:export "ALLOCATION-TRAP" "POSITIVE-FIXNUM-BITS" diff --git a/src/compiler/x86/parms.lisp b/src/compiler/x86/parms.lisp index 77b04b3a4..6a643af96 100644 --- a/src/compiler/x86/parms.lisp +++ b/src/compiler/x86/parms.lisp @@ -75,6 +75,7 @@ ;;;; Machine Architecture parameters: (export '(word-bits byte-bits char-bits word-shift word-bytes char-bytes + fixnum-tag-bits fixnum-tag-mask positive-fixnum-bits float-sign-shift single-float-bias single-float-exponent-byte @@ -119,6 +120,25 @@ (defconstant word-bytes (/ word-bits byte-bits) "Number of bytes in a word.") + +(defconstant lowtag-bits 3 + "Number of bits at the low end of a pointer used for type information.") + +(defconstant lowtag-mask (1- (ash 1 lowtag-bits)) + "Mask to extract the low tag bits from a pointer.") + +(defconstant lowtag-limit (ash 1 lowtag-bits) + "Exclusive upper bound on the value of the low tag bits from a + pointer.") + +(defconstant fixnum-tag-bits (1- lowtag-bits) + "Number of tag bits used for a fixnum") + +(defconstant fixnum-tag-mask (1- (ash 1 fixnum-tag-bits)) + "Mask to get the fixnum tag") + +(defconstant positive-fixnum-bits (- word-bits fixnum-tag-bits 1) + "Maximum number of bits in a positive fixnum") ) ; eval-when (eval-when (compile load eval) -- GitLab