compiler/arm/{arith,parms}: Define remaining two-arg static-funs.
[sbcl/nyef.git] / src / compiler / arm / parms.lisp
blob910ecd6b1d62afd40f4842b03a3730a121246199
1 ;;;; This file contains some parameterizations of various VM
2 ;;;; attributes for the ARM. This file is separate from other stuff so
3 ;;;; that it can be compiled and loaded earlier.
5 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; more information.
7 ;;;;
8 ;;;; This software is derived from the CMU CL system, which was
9 ;;;; written at Carnegie Mellon University and released into the
10 ;;;; public domain. The software is in the public domain and is
11 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
12 ;;;; files for more information.
14 (in-package "SB!VM")
16 ;;; number of bits per word where a word holds one lisp descriptor
17 (def!constant n-word-bits 32)
19 ;;; the natural width of a machine word (as seen in e.g. register width,
20 ;;; address space)
21 (def!constant n-machine-word-bits 32)
23 ;;; number of bits per byte where a byte is the smallest addressable
24 ;;; object
25 (def!constant n-byte-bits 8)
27 ;;; Floating-point related constants, both format descriptions and FPU
28 ;;; control register descriptions. These don't exactly match up with
29 ;;; what the machine manuals say because the Common Lisp standard
30 ;;; defines floating-point values somewhat differently than the IEEE
31 ;;; standard does.
33 (def!constant float-sign-shift 31)
35 (def!constant single-float-bias 126)
36 (defconstant-eqx single-float-exponent-byte (byte 8 23) #'equalp)
37 (defconstant-eqx single-float-significand-byte (byte 23 0) #'equalp)
38 (def!constant single-float-normal-exponent-min 1)
39 (def!constant single-float-normal-exponent-max 254)
40 (def!constant single-float-hidden-bit (ash 1 23))
41 (def!constant single-float-trapping-nan-bit (ash 1 22))
43 (def!constant double-float-bias 1022)
44 (defconstant-eqx double-float-exponent-byte (byte 11 20) #'equalp)
45 (defconstant-eqx double-float-significand-byte (byte 20 0) #'equalp)
46 (def!constant double-float-normal-exponent-min 1)
47 (def!constant double-float-normal-exponent-max #x7FE)
48 (def!constant double-float-hidden-bit (ash 1 20))
49 (def!constant double-float-trapping-nan-bit (ash 1 19))
51 (def!constant single-float-digits
52 (+ (byte-size single-float-significand-byte) 1))
54 (def!constant double-float-digits
55 (+ (byte-size double-float-significand-byte) n-word-bits 1))
57 #!+arm-vfp
58 (progn
59 (def!constant float-invalid-trap-bit (ash 1 0))
60 (def!constant float-divide-by-zero-trap-bit (ash 1 1))
61 (def!constant float-overflow-trap-bit (ash 1 2))
62 (def!constant float-underflow-trap-bit (ash 1 3))
63 (def!constant float-inexact-trap-bit (ash 1 4))
64 (def!constant float-input-denormal-trap-bit (ash 1 7))
66 (def!constant float-round-to-nearest 0)
67 (def!constant float-round-to-zero 1)
68 (def!constant float-round-to-positive 2)
69 (def!constant float-round-to-negative 3)
71 (defconstant-eqx float-rounding-mode (byte 2 22) #'equalp)
73 (defconstant-eqx float-sticky-bits (byte 8 0) #'equalp)
74 (defconstant-eqx float-traps-byte (byte 8 8) #'equalp)
75 (defconstant-eqx float-exceptions-byte (byte 8 0) #'equalp)
77 (def!constant float-fast-bit (ash 1 24))) ;; Flush-to-zero mode
78 ;; NOTE: As with the FLOAT-REGISTERS SB in vm.lisp, if you define this
79 ;; for non-VFP systems, please use a specific positive feature
80 ;; conditional.
81 #!-arm-vfp
82 (error "Don't know how to set the FPU control word layout on non-VFP systems")
84 ;;;; Where to put the different spaces.
86 ;;; On non-gencgc we need large dynamic and static spaces for PURIFY
87 #!-gencgc
88 (progn
89 (def!constant read-only-space-start #x04000000)
90 (def!constant read-only-space-end #x07ff8000)
91 (def!constant static-space-start #x08000000)
92 (def!constant static-space-end #x097fff00)
94 (def!constant linkage-table-space-start #x0a000000)
95 (def!constant linkage-table-space-end #x0b000000))
97 (def!constant linkage-table-entry-size 16)
99 #!+linux
100 (progn
101 #!-gencgc
102 (progn
103 (def!constant dynamic-0-space-start #x4f000000)
104 (def!constant dynamic-0-space-end #x66fff000)
105 (def!constant dynamic-1-space-start #x67000000)
106 (def!constant dynamic-1-space-end #x7efff000)))
108 ;;;; other miscellaneous constants
110 (defenum (:start 8)
111 halt-trap
112 pending-interrupt-trap
113 error-trap
114 cerror-trap
115 breakpoint-trap
116 fun-end-breakpoint-trap
117 single-step-around-trap
118 single-step-before-trap)
120 ;;;; Static symbols.
122 ;;; These symbols are loaded into static space directly after NIL so
123 ;;; that the system can compute their address by adding a constant
124 ;;; amount to NIL.
126 ;;; The fdefn objects for the static functions are loaded into static
127 ;;; space directly after the static symbols. That way, the raw-addr
128 ;;; can be loaded directly out of them by indirecting relative to NIL.
130 (defparameter *static-symbols*
131 (append
132 *common-static-symbols*
133 *c-callable-static-symbols*
134 '(*allocation-pointer*
136 *binding-stack-pointer*
137 *number-stack-pointer*
139 ;; interrupt handling
140 *pseudo-atomic-atomic*
141 *pseudo-atomic-interrupted*)))
143 (defparameter *static-funs*
144 '(two-arg-gcd two-arg-lcm
145 two-arg-+ two-arg-- two-arg-* two-arg-/
146 two-arg-< two-arg-> two-arg-=
147 two-arg-and two-arg-ior two-arg-xor two-arg-eqv))
150 ;;;; Assembler parameters:
152 ;;; The number of bits per element in the assemblers code vector.
154 (defparameter *assembly-unit-length* 8)