Skip to content

Arch Constant Values in CCL

Shannon Spires edited this page Mar 14, 2023 · 1 revision

Here's a table of various defconstant forms in #P"ccl:compiler;" directories. Columns are the various architectures and rows are constants sorted in alphabetical order. Empty cells represent constants that are not defined for that column's architecture.

Caveats:

  • Not all constants are included here; constants defined by a macro are not [yet] included.
  • Comments that exist in the source are appended to cell values preceded by ";"
  • No guarantees that this table is complete or accurate. It's a work in progress.

This table was produced by #'print-table in https://github.com/svspire/ccl-code-mining/blob/main/architecture-constants.lisp.

X8664 X8632 ARM32 PPC32 PPC64
arg-check-trap-pc-limit 7 7 8 8 8
arrayH.data-vector-cell 2 2 2 2 2
arrayH.dim0-cell 5 5 5 5 5
arrayH.displacement-cell 3 3 3 3 3
arrayH.flags-cell 4 4 4 4 4
arrayH.flags-cell-bits-byte (byte 8 0) (byte 8 0) (byte 8 0) (byte 8 0) (byte 8 0)
arrayH.flags-cell-subtag-byte (byte 8 8) (byte 8 8) (byte 8 8) (byte 8 8) (byte 8 8)
arrayH.physsize-cell 1 1 1 1 1
arrayH.rank-cell 0 0 0 0 0
bitmap-shift 6 5 5 5 6
c-frame.minsize c-frame.size c-frame.size
canonical-nil-value (+ #x13000 fulltag-nil) (+ #x13000 fulltag-cons) (+ #x04000000 fulltag-nil) 12309 (+ #x3000 symbol.size fulltag-misc)
canonical-t-value (+ #x13020 fulltag-symbol) (+ #x13008 fulltag-misc)
charcode-shift 8 8 (- nbits-in-word ncharcodebits) (- nbits-in-word ncharcodebits) 8
cl-array-subtag-bit 7
cl-array-subtag-mask (ash 1 cl-array-subtag-bit)
complex-double-float.imagpart complex-double-float.imagpart-low complex-double-float.imagpart-low complex-double-float.imagpart-high
complex-double-float.realpart complex-double-float.realpart-low complex-double-float.realpart-low complex-double-float.realpart-high
complex-single-float.imagpart (+ complex-single-float.value 4) (+ complex-single-float.value 4)
complex-single-float.realpart complex-single-float.value complex-single-float.value
cons-bias fulltag-cons fulltag-cons
default-node-regs-mask 206
dnode-align-bits 4 3 3 3 4
dnode-shift dnode-align-bits dnode-align-bits dnode-align-bits dnode-align-bits dnode-align-bits
dnode-size 16 8 8 8 16
double-float.element-count 2 2
double-float.size 16 16
double-float.val-high (+ double-float.value 4) double-float.value
double-float.val-high-cell 1 double-float.value-cell
double-float.val-low double-float.value (+ double-float.value 4)
double-float.val-low-cell 0 1
double-float.value misc-data-offset double-float.val-low misc-data-offset
double-float.value-cell 0 double-float.val-low-cell 0
dzc 1 ;division by 0
dze 9 ;division by 0 enable
eabi-c-frame.minsize eabi-c-frame.size
fasl-max-version 98 103 102 96 96
fasl-min-version 98 103 102 96 96
fasl-version 98 103 102 96 96
fixnum-mask fixnummask fixnummask fixnummask
fixnum-one fixnumone fixnumone
fixnum-shift 3 2 fixnumshift ; A pet name for it. fixnumshift ; A pet name for it. fixnumshift ; A pet name for it.
fixnum1 fixnumone fixnumone
fixnummask 7 3 (1- (ash 1 nfixnumtagbits)) (1- (ash 1 nfixnumtagbits)) (1- (ash 1 nfixnumtagbits))
fixnumone (ash 1 fixnumshift) (ash 1 fixnumshift) (ash 1 fixnumshift)
fixnumshift 3 2 nfixnumtagbits nfixnumtagbits nfixnumtagbits
full-tag-mask fulltagmask fulltagmask fulltagmask
fulltag-cons 3 1 4
fulltag-even-fixnum 0 0 ; I suppose EVENP/ODDP might care; nothing else does. 0
fulltag-function 15
fulltag-imm 3 ; a "real" immediate object. Shares TAG with fulltag-immheader.
fulltag-imm-0 1 ;subtag-single-float ONLY 1
fulltag-imm-1 2 ;characters, markers 5
fulltag-imm-2 9
fulltag-imm-3 13
fulltag-immheader 7 ; Header of heap-allocated object that contains unboxed data.
fulltag-immheader-0 7 2
fulltag-immheader-1 9 6
fulltag-immheader-2 10 10
fulltag-immheader-3 14
fulltag-misc 13 6 ; Pointer "real" tag-misc object. Shares TAG with fulltag-nodeheader. 12
fulltag-nil 11
fulltag-nodeheader 2 ; Header of heap-allocated object that contains lisp-object pointers
fulltag-nodeheader-0 5 3
fulltag-nodeheader-1 6 7
fulltag-nodeheader-2 11
fulltag-nodeheader-3 15
fulltag-odd-fixnum 8 4 8
fulltag-single-float fulltag-imm-0
fulltag-symbol 14
fulltag-tra 5 ;was for nil on PPC32
fulltag-tra-0 4 ;tagged return address
fulltag-tra-1 12
fulltagmask 15 7 (1- (ash 1 ntagbits)) ; Only needed by GC/very low-level code (1- (ash 1 ntagbits)) ; Only needed by GC/very low-level code (1- (ash 1 ntagbits)) ; Only needed by GC/very low-level code
function-boundary-marker subtag-function-boundary-marker subtag-function-boundary-marker
gf-code-size 18 30
gvector-funcallable fulltag-nodeheader-0
illegal-marker subtag-illegal subtag-illegal subtag-illegal subtag-illegal subtag-illegal
interrupt-level-binding-index (ash 1 fixnumshift) (ash 1 fixnumshift) (ash 1 fixnumshift) (ash 1 fixnumshift) (ash 1 fixnumshift)
ioc 0 ;invalid operation
ioe 8 ;invalid operation enable
ivector-class-32-bit fulltag-immheader-1 fulltag-immheader-2
ivector-class-64-bit fulltag-immheader-2 fulltag-immheader-3
ivector-class-8-bit fulltag-immheader-0
ivector-class-other-bit fulltag-immheader-0 fulltag-immheader-1
ixc 4 ;inexact
ixe 12 ;inexact enable
least-significant-bit 31 31 63
lisp-frame-marker subtag-lisp-frame-marker
lowtag-imm 1
lowtag-immheader 2
lowtag-mask lowtagmask
lowtag-nodeheader 3
lowtag-primary 0
lowtagmask (1- (ash 1 nlowtagbits))
max-1-bit-constant-index (ash (+ #x7fffffff x8664::misc-data-offset) 3) (ash 1 24) (ash (+ #xfff arm::misc-data-offset) 5) (ash (+ #x7fff ppc32::misc-data-offset) 5) (ash (+ #x7fff ppc64::misc-data-offset) 5)
max-16-bit-constant-index (ash (+ #x7fffffff x8664::misc-data-offset) -1) (ash 1 24) (ash (+ #xfff arm::misc-data-offset) -1) (ash (+ #x7fff ppc32::misc-data-offset) -1) (ash (+ #x7fff ppc64::misc-data-offset) -1)
max-16-bit-ivector-subtag subtag-s16-vector subtag-s16-vector subtag-s16-vector
max-32-bit-constant-index (ash (+ #x7fffffff x8664::misc-data-offset) -2) (ash 1 24) (ash (+ #xfff arm::misc-data-offset) -2) (ash (+ #x7fff ppc32::misc-data-offset) -2) (ash (+ #x7fff ppc64::misc-data-offset) -2)
max-32-bit-ivector-subtag subtag-simple-base-string (logior fulltag-immheader (ash 23 ntagbits)) subtag-simple-base-string
max-64-bit-constant-index (ash (+ #x7fffffff x8664::misc-dfloat-offset) -3) (ash 1 24) 127 (ash (+ #x7fff ppc32::misc-dfloat-offset) -3) (ash (+ #x7fff ppc64::misc-dfloat-offset) -3)
max-8-bit-constant-index (+ #x7fffffff x8664::misc-data-offset) (ash 1 24) (+ #xfff arm::misc-data-offset) (+ #x7fff ppc32::misc-data-offset) (+ #x7fff ppc64::misc-data-offset)
max-8-bit-ivector-subtag subtag-u8-vector subtag-s8-vector (logior fulltag-immheader (ash 25 ntagbits)) subtag-s8-vector
max-float-subtag subtag-double-float subtag-double-float
max-non-array-imm-subtag (logior (ash 19 ntagbits) fulltag-immheader) (logior (ash 19 ntagbits) fulltag-immheader) (logior (ash 19 ntagbits) fulltag-immheader)
max-non-array-node-subtag (logior (ash 18 ntagbits) fulltag-nodeheader) (logior (ash 18 ntagbits) fulltag-nodeheader) (logior (ash 18 ntagbits) fulltag-nodeheader)
max-numeric-subtag subtag-complex subtag-complex
max-rational-subtag subtag-ratio subtag-ratio
max-real-subtag subtag-double-float subtag-double-float
min-16-bit-ivector-subtag subtag-u16-vector subtag-u16-vector subtag-u16-vector
min-8-bit-ivector-subtag subtag-s8-vector subtag-u8-vector subtag-u8-vector subtag-u8-vector
min-cl-ivector-subtag subtag-complex-double-float-vector subtag-single-float-vector subtag-single-float-vector subtag-single-float-vector subtag-s8-vector
min-float-subtag subtag-single-float subtag-single-float
min-non-numeric-imm-subtag subtag-macptr subtag-macptr
min-non-numeric-node-subtag subtag-catch-frame subtag-catch-frame subtag-catch-frame
min-numeric-subtag subtag-bignum subtag-bignum
misc-bias fulltag-misc fulltag-misc
misc-complex-dfloat-offset (+ misc-data-offset node-size) misc-dfloat-offset misc-dfloat-offset
misc-data-offset (+ misc-header-offset node-size) (+ misc-header-offset node-size) (+ misc-header-offset 4) (+ misc-header-offset 4) (+ misc-header-offset 8)
misc-dfloat-offset misc-data-offset ( + misc-header-offset 8) (+ misc-header-offset 8) (+ misc-header-offset 8) (+ misc-header-offset 8)
misc-function-offset (- node-size fulltag-function)
misc-header-offset (- fulltag-misc) (- fulltag-misc) (- fulltag-misc) (- fulltag-misc) (- fulltag-misc)
misc-subtag-offset misc-header-offset misc-header-offset misc-header-offset (+ misc-header-offset 3) (+ misc-header-offset 7 )
misc-symbol-offset (- node-size fulltag-symbol)
nbits-in-byte 8 8 8 8 8
nbits-in-word 64 32 32 32 64
ncharcodebits 8 8 24 ; only the low 8 bits are used, currently 24 ; only the low 8 bits are used, currently 8 ;24
nfixnumtagbits 3 2 2 ; See ? 2 ; See ? 3 ; See ?
nil-value canonical-nil-value
nilsym-offset (+ t-offset symbol.size) (+ t-offset symbol.size) (+ t-offset symbol.size) (+ t-offset symbol.size)
nlisptagbits 3 2 2 2 3
nlowtagbits 2
no-thread-local-binding-marker subtag-no-thread-local-binding
node-size word-size-in-bytes word-size-in-bytes 4 4 word-size-in-bytes
ntagbits 4 3 3 ; But non-header objects only use 2 3 ; But non-header objects only use 2 4
num-kernel-imports (ash kernel-import-last-kernel-import -2)
num-subtag-bits 8 8 8 ; tag part of header is 8 bits wide 8 ; tag part of header is 8 bits wide 8 ; tag part of header is 8 bits wide
numeric-tags-mask (logior real-tags-mask (ash 1 subtag-complex))
ofc 2 ;overflow
ofe 10 ;overflow enable
rcontext 13 2 ;sigh. Could use r13+bias on Linux,
recover-fn-address-offset 1
recover-fn-from-rip-byte2 45
recover-fn-from-rip-disp-offset 3
recover-fn-from-rip-length 7
recover-fn-from-rip-word0 36172
recover-fn-opcode-byte 191 ;when %fn is %edi
reservation-discharge 8196 8200
reserved-frame-marker subtag-reserved-frame subtag-reserved-frame
slot-unbound-marker subtag-slot-unbound subtag-slot-unbound subtag-slot-unbound subtag-slot-unbound subtag-slot-unbound
stack-alloc-marker subtag-stack-alloc-marker
subtag-mask (1- (ash 1 num-subtag-bits)) (1- (ash 1 num-subtag-bits)) (1- (ash 1 num-subtag-bits))
subtagmask 255
t-offset (- canonical-t-value canonical-nil-value) (- canonical-t-value canonical-nil-value) (+ (- dnode-size fulltag-nil) fulltag-misc) (+ 8 (- 8 fulltag-nil) fulltag-misc) (- symbol.size)
tag-fixnum 0 0 ; All fixnums, whether odd or even 0
tag-function 7 ;function entry point
tag-imm 3 ; Immediate-objects: characters, UNBOUND, other markers.
tag-imm-0 1 ;subtag-single-float ONLY 1
tag-imm-1 2 ;subtag-character, internal markers
tag-imm-2 5
tag-immheader-0 2
tag-immheader2 6
tag-list 3 ;fulltag-cons or NIL 1 ; Conses and NIL
tag-mask tagmask tagmask tagmask
tag-memory 4
tag-misc 5 ;random uvector 2 ; Heap-consed objects other than conses: vectors, symbols, functions, floats …
tag-nodeheader-0 3
tag-nodeheader2 7
tag-single-float tag-imm-0
tag-symbol 6 ;non-null symbol
tag-tra 4 ;tagged return-address
tagmask 7 3 (1- (ash 1 nlisptagbits)) (1- (ash 1 nlisptagbits)) (1- (ash 1 nlisptagbits))
target-most-negative-fixnum (ash -1 (1- (- nbits-in-word nfixnumtagbits))) (ash -1 (1- (- nbits-in-word nfixnumtagbits))) (ash -1 (1- (- nbits-in-word nfixnumtagbits))) (ash -1 (1- (- nbits-in-word nfixnumtagbits))) (ash -1 (1- (- nbits-in-word nfixnumtagbits)))
target-most-positive-fixnum (1- (ash 1 (1- (- nbits-in-word nfixnumtagbits)))) (1- (ash 1 (1- (- nbits-in-word nfixnumtagbits)))) (1- (ash 1 (1- (- nbits-in-word nfixnumtagbits)))) (1- (ash 1 (1- (- nbits-in-word nfixnumtagbits)))) (1- (ash 1 (1- (- nbits-in-word nfixnumtagbits))))
tcr-bias 0 0 0 0
tcr.lisp-fpscr-low (+ tcr.lisp-fpscr-high 4)
tcr.single-float-convert.value (+ 4 tcr.single-float-convert)
tcr.sptab 256
tcr.total-bytes-allocated-low (+ tcr.total-bytes-allocated-high 4)
ufc 3 ;underflow
ufe 11 ;underflow enable
unbound-marker subtag-unbound subtag-unbound subtag-unbound subtag-unbound subtag-unbound
undefined unbound-marker unbound-marker unbound-marker unbound-marker unbound-marker
uuo-format-binary 15 ; 4 bits of code, r1, r0
uuo-format-cerror-fulltag 11 ; continuable, fulltag, reg
uuo-format-cerror-lisptag 10 ; continuable, lisptag, reg
uuo-format-cerror-xtype 12 ; continuable, xtype, reg
uuo-format-error-fulltag 3 ; 3 bits of fulltag info, 4 bit reg
uuo-format-error-lisptag 2 ; 2 bits of lisptag info, 4-bit reg
uuo-format-error-xtype 4 ; 8 bits of extended type/subtag info, 4 bit reg
uuo-format-nullary 0 ; 12 bits of code
uuo-format-unary 1 ; 8 bits of info - NOT type info - 4-bit reg
word-shift 3 2 2 2 3
word-size-in-bytes 8 4 4 4 8
x8632-subprims-base 86016
x8664-subprims-base 86016
xtype-array2d 248
xtype-array3d 244
xtype-bit 40
xtype-char-code 56
xtype-integer 4
xtype-number 52
xtype-rational 44
xtype-real 48
xtype-s16 24
xtype-s32 16
xtype-s64 8
xtype-s8 32
xtype-u16 28
xtype-u32 20
xtype-u64 12
xtype-u8 36
xtype-unsigned-byte-24 252