New function: SB!KERNEL:%MULTIPLY-HIGH
[sbcl.git] / base-target-features.lisp-expr
1 ;;;; -*- Lisp -*-
2
3 ;;;; tags which are set during the build process and which end up in
4 ;;;; CL:*FEATURES* in the target SBCL, plus some comments about other
5 ;;;; CL:*FEATURES* tags which have special meaning to SBCL or which
6 ;;;; have a special conventional meaning
7 ;;;;
8 ;;;; Note that the recommended way to customize the features of a
9 ;;;; local build of SBCL is not to edit this file, but instead to
10 ;;;; tweak customize-target-features.lisp. (You must create this file
11 ;;;; first; it is not in the SBCL distribution, and is in fact
12 ;;;; explicitly excluded from the distribution in places like
13 ;;;; .cvsignore.) If you define a function in
14 ;;;; customize-target-features.lisp, it will be used to transform the
15 ;;;; target features list after it's read and before it's used. E.g.,
16 ;;;; you can use code like this:
17 ;;;;    (lambda (list)
18 ;;;;      (flet ((enable (x) (pushnew x list))
19 ;;;;             (disable (x) (setf list (remove x list))))
20 ;;;;        #+nil (enable :sb-show)
21 ;;;;        (enable :sb-after-xc-core)
22 ;;;;        #+nil (disable :sb-doc)
23 ;;;;        list))
24 ;;;; By thus editing a local file (one which is not in the source
25 ;;;; distribution, and which is in .cvsignore) your customizations
26 ;;;; will remain local even if you do things like "cvs update",
27 ;;;; will not show up if you try to submit a patch with "cvs diff",
28 ;;;; and might even stay out of the way if you use other non-CVS-based
29 ;;;; methods to upgrade the files or store your configuration.
30
31 ;;;; This software is part of the SBCL system. See the README file for
32 ;;;; more information.
33 ;;;;
34 ;;;; This software is derived from the CMU CL system, which was
35 ;;;; written at Carnegie Mellon University and released into the
36 ;;;; public domain. The software is in the public domain and is
37 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
38 ;;;; files for more information.
39
40 (
41  ;;
42  ;; features present in all builds
43  ;;
44
45  ;; our standard
46  :ansi-cl :common-lisp
47  ;; FIXME: Isn't there a :x3jsomething feature which we should set too?
48  ;; No. CLHS says ":x3j13 [...] A conforming implementation might or
49  ;; might not contain such a feature." -- CSR, 2002-02-21
50
51  ;; our dialect
52  :sbcl
53
54  ;; Douglas Thomas Crosher's conservative generational GC (the only one
55  ;; we currently support for X86).
56  ;; :gencgc used to be here; CSR moved it into
57  ;; local-target-features.lisp-expr via make-config.sh, as alpha,
58  ;; sparc and ppc ports don't currently support it. -- CSR, 2002-02-21
59
60  ;;
61  ;; features present in this particular build
62  ;;
63
64  ;; Setting this enables the compilation of documentation strings
65  ;; from the system sources into the target Lisp executable.
66  ;; Traditional Common Lisp folk will want this option set.
67  ;; I (WHN) made it optional because I came to Common Lisp from
68  ;; C++ through Scheme, so I'm accustomed to asking
69  ;; Emacs about things that I'm curious about instead of asking
70  ;; the executable I'm running.
71  :sb-doc
72
73  ;; Do regression and other tests when building the system. You might
74  ;; or might not want this if you're not a developer, depending on how
75  ;; paranoid you are. You probably do want it if you are a developer.
76  ;; This test does not affect the target system (in much the same way
77  ;; as :sb-after-xc-core, below).
78  :sb-test
79
80  ;; Make more debugging information available (for debugging SBCL
81  ;; itself). If you aren't hacking or troubleshooting SBCL itself,
82  ;; you probably don't want this set.
83  ;;
84  ;; At least two varieties of debugging information are enabled by this
85  ;; option:
86  ;;   * SBCL is compiled with a higher level of OPTIMIZE DEBUG, so that
87  ;;     the debugger can tell more about the state of the system.
88  ;;   * Various code to print debugging messages, and similar debugging code,
89  ;;     is compiled only when this feature is present.
90  ;;
91  ;; Note that the extra information recorded by the compiler at
92  ;; this higher level of OPTIMIZE DEBUG includes the source location
93  ;; forms. In order for the debugger to use this information, it has to
94  ;; re-READ the source file. In an ordinary installation of SBCL, this
95  ;; re-READing may not work very well, for either of two reasons:
96  ;;   * The sources aren't present on the system in the same location that
97  ;;     they were on the system where SBCL was compiled.
98  ;;   * SBCL is using the standard readtable, without the added hackage
99  ;;     which allows it to handle things like target features.
100  ;; If you want to be able to use the extra debugging information,
101  ;; therefore, be sure to keep the sources around, and run with the
102  ;; readtable configured so that the system sources can be read.
103  ; :sb-show
104
105  ;; Build SBCL with the old CMU CL low level debugger, "ldb". In the
106  ;; ideal world you would not need this unless you are messing with
107  ;; SBCL at a very low level (e.g., trying to diagnose GC problems, or
108  ;; trying to debug assembly code for a port to a new CPU). However,
109  ;; experience shows that sooner or later everyone lose()'s, in which
110  ;; case SB-LDB can at least provide an informative backtrace.
111  :sb-ldb
112
113  ;; This isn't really a target Lisp feature at all, but controls
114  ;; whether the build process produces an after-xc.core file. This
115  ;; can be useful for shortening the edit/compile/debug cycle when
116  ;; you modify SBCL's own source code, as in slam.sh. Otherwise
117  ;; you don't need it.
118  ; :sb-after-xc-core
119
120  ;; Enable extra debugging output in the assem.lisp assembler/scheduler
121  ;; code. (This is the feature which was called :DEBUG in the
122  ;; original CMU CL code.)
123  ; :sb-show-assem
124
125  ;; Setting this makes SBCL more "fluid", i.e. more amenable to
126  ;; modification at runtime, by suppressing various INLINE declarations,
127  ;; compiler macro definitions, FREEZE-TYPE declarations; and by
128  ;; suppressing various burning-our-ships-behind-us actions after
129  ;; initialization is complete; and so forth. This tends to clobber the
130  ;; performance of the system, so unless you have some special need for
131  ;; this when hacking SBCL itself, you don't want this set.
132  ; :sb-fluid
133
134  ;; Enable code for collecting statistics on usage of various operations,
135  ;; useful for performance tuning of the SBCL system itself. This code
136  ;; is probably pretty stale (having not been tested since the fork from
137  ;; base CMU CL) but might nonetheless be a useful starting point for
138  ;; anyone who wants to collect such statistics in the future.
139  ; :sb-dyncount
140
141  ;; Enable code for detecting concurrent accesses to the same hash-table
142  ;; in multiple threads. Note that this implementation is currently
143  ;; (2007-09-11) somewhat too eager: even though in the current implementation
144  ;; multiple readers are thread safe as long as there are no writers, this
145  ;; code will also trap multiple readers.
146  ; :sb-hash-table-debug
147
148  ;; Enabled automatically by make-config.sh for platforms which implement
149  ;; the %READ-CYCLE-COUNTER VOP. Can be disabled manually: affects TIME.
150  ;;
151  ;; FIXME: Should this be :SB-CYCLE-COUNTER instead? If so, then the same goes
152  ;; for :COMPARE-AND-SWAP-VOPS as well, and a bunch of others. Perhaps
153  ;; built-time convenience features like this should all live in eg. SB!INT
154  ;; instead?
155  ;;
156  ; :cycle-counter
157
158  ;; Enabled automatically for platforms which implement complex arithmetic
159  ;; VOPs. Such platforms should implement real-complex, complex-real and
160  ;; complex-complex addition and subtractions (for complex-single-float
161  ;; and complex-double-float). They should also also implement complex-real
162  ;; and real-complex multiplication, complex-real division, and
163  ;; sb!vm::swap-complex, which swaps the real and imaginary parts.
164  ;; Finally, they should implement conjugate and complex-real, real-complex
165  ;; and complex-complex CL:= (complex-complex EQL would usually be a good
166  ;; idea).
167  ;;
168  ; :complex-float-vops
169
170  ;; Enabled automatically for platforms which implement VOPs for EQL
171  ;; of single and double floats.
172  ;;
173  ; :float-eql-vops
174
175  ;; Enabled automatically for platform that can implement inline constants.
176  ;;
177  ;; Such platform must implement 5 functions, in SB!VM:
178  ;; * canonicalize-inline-constant: converts a constant descriptor (list) into
179  ;;    a canonical description, to be used as a key in an EQUAL hash table
180  ;;    and to guide the generation of the constant itself.
181  ;; * inline-constant-value: given a canonical constant descriptor, computes
182  ;;    two values:
183  ;;     1. A label that will be used to emit the constant (usually a
184  ;;         sb!assem:label)
185  ;;     2. A value that will be returned to code generators referring to
186  ;;         the constant (on x86oids, an EA object)
187  ;; * sort-inline-constants: Receives a vector of unique constants;
188  ;;    the car of each entry is the constant descriptor, and the cdr the
189  ;;    corresponding label. Destructively returns a vector of constants
190  ;;    sorted in emission order. It could actually perform arbitrary
191  ;;    modifications to the vector, e.g. to fuse constants of different
192  ;;    size.
193  ;; * emit-constant-segment-header: receives the vector of sorted constants
194  ;;    and a flag (true iff speed > space). Expected to emit padding
195  ;;    of some sort between the ELSEWHERE segment and the constants, or some
196  ;;    metadata.
197  ;; * emit-inline-constant: receives a constant descriptor and its associated
198  ;;    label. Emits the constant.
199  ;;
200  ;; Implementing this features lets VOP generators use sb!c:register-inline-constant
201  ;; to get handles (as returned by sb!vm:inline-constant-value) from constant
202  ;; descriptors.
203  ;;
204  ; :inline-constants
205
206  ;; Peter Van Eynde's increase-bulletproofness code for CMU CL
207  ;;
208  ;; Some of the code which was #+high-security before the fork has now
209  ;; been either made unconditional, deleted, or rewritten into
210  ;; unrecognizability, but some remains. What remains is not maintained
211  ;; or tested in current SBCL, but I haven't gone out of my way to
212  ;; break it, either.
213  ;;
214  ; :high-security
215  ; :high-security-support
216
217  ;; low-level thread primitives support
218  ;;
219  ;; As of SBCL 1.0.33.26, threads are part of the default build on
220  ;; x86oid Linux. Other platforms that support them include
221  ;; x86oid Darwin, FreeBSD, and Solaris.
222  ; :sb-thread
223
224  ;; lutex support
225  ;;
226  ;; While on linux we are able to use futexes for our locking
227  ;; primitive, on other platforms we don't have this luxury. NJF's
228  ;; lutexes present a locking API similar to the futex-based API that
229  ;; allows for sb-thread support on x86 OS X, Solaris and
230  ;; FreeBSD.
231  ;;
232  ; :sb-lutex
233
234  ;; On some operating systems the FS segment register (used for SBCL's
235  ;; thread local storage) is not reliably preserved in signal
236  ;; handlers, so we need to restore its value from the pthread thread
237  ;; local storage.
238  ; :restore-tls-segment-register-from-tls
239
240  ;; On some x86oid operating systems (darwin) SIGTRAP is not reliably
241  ;; delivered for the INT3 instruction, so we use the UD2 instruction
242  ;; which generates SIGILL instead.
243  ; :ud2-breakpoints
244
245  ;; Support for detection of unportable code (when applied to the
246  ;; COMMON-LISP package, or SBCL-internal pacakges) or bad-neighbourly
247  ;; code (when applied to user-level packages), relating to material
248  ;; alteration to packages or to bindings in symbols in packages.
249  :sb-package-locks
250
251  ;; Support for the entirety of the 21-bit character space defined by
252  ;; the Unicode consortium, rather than the classical 8-bit ISO-8859-1
253  ;; character set.
254  :sb-unicode
255
256  ;; Support for a full evaluator that can execute all the CL special
257  ;; forms, as opposed to the traditional SBCL evaluator which called
258  ;; COMPILE for everything complicated.
259  :sb-eval
260
261  ;; Record source location information for variables, classes, conditions,
262  ;; packages, etc. Gives much better information on M-. in Slime, but
263  ;; increases core size by about 100kB.
264  :sb-source-locations
265
266  ;; Record xref data for SBCL internals. This can be rather useful for
267  ;; people who want to develop on SBCL itself because it'll make M-?
268  ;; (slime-edit-uses) work which lists call/expansion/etc. sites.
269  ;; It'll increase the core size by major 5-6mB, though.
270  ; :sb-xref-for-internals
271
272  ;; This affects the definition of a lot of things in bignum.lisp. It
273  ;; doesn't seem to be documented anywhere what systems it might apply
274  ;; to. It doesn't seem to be needed for X86 systems anyway.
275  ; :32x16-divide
276
277  ;; This is set in classic CMU CL, and presumably there it means
278  ;; that the floating point arithmetic implementation
279  ;; conforms to IEEE's standard. Here it definitely means that the
280  ;; floating point arithmetic implementation conforms to IEEE's standard.
281  ;; I (WHN 19990702) haven't tried to verify
282  ;; that it does conform, but it should at least mostly conform (because
283  ;; the underlying x86 hardware tries).
284  :ieee-floating-point
285
286  ;; CMU CL had, and we inherited, code to support 80-bit LONG-FLOAT on the x86
287  ;; architecture. Nothing has been done to actively destroy the long float
288  ;; support, but it hasn't been thoroughly maintained, and needs at least
289  ;; some maintenance before it will work. (E.g. the LONG-FLOAT-only parts of
290  ;; genesis are still implemented in terms of unportable CMU CL functions
291  ;; which are not longer available at genesis time in SBCL.) A deeper
292  ;; problem is SBCL's bootstrap process implicitly assumes that the
293  ;; cross-compilation host will be able to make the same distinctions
294  ;; between floating point types that it does. This assumption is
295  ;; fundamentally sleazy, even though in practice it's unlikely to break down
296  ;; w.r.t. distinguishing SINGLE-FLOAT from DOUBLE-FLOAT; it's much more
297  ;; likely to break down w.r.t. distinguishing DOUBLE-FLOAT from LONG-FLOAT.
298  ;; Still it's likely to be quite doable to get LONG-FLOAT support working
299  ;; again, if anyone's sufficiently motivated.
300  ; :long-float
301
302  ;; Some platforms don't use a 32-bit off_t by default, and thus can't
303  ;; handle files larger than 2GB. This feature will control whether
304  ;; we'll try to use platform-specific compilation options to enable a
305  ;; 64-bit off_t. The intent is for this feature to be automatically
306  ;; enabled by make-config.sh on platforms where it's needed and known
307  ;; to work, you shouldn't be enabling it manually. You might however
308  ;; want to disable it, if you need to pass file descriptors to
309  ;; foreign code that uses a 32-bit off_t.
310  ; :largefile
311
312  ;; Enabled automatically on platforms that have VOPs to compute the
313  ;; high half of a full word-by-word multiplication.  When disabled,
314  ;; SB-KERNEL:%MULTIPLY-HIGH is implemented in terms of
315  ;; SB-BIGNUM:%MULTIPLY.
316  ; :multiply-high-vops
317
318  ;;
319  ;; miscellaneous notes on other things which could have special significance
320  ;; in the *FEATURES* list
321  ;;
322
323  ;; Any target feature which affects binary compatibility of fasl files
324  ;; needs to be recorded in *FEATURES-POTENTIALLY-AFFECTING-FASL-FORMAT*
325  ;; (elsewhere).
326
327  ;; notes on the :NIL and :IGNORE features:
328  ;;
329  ;; #+NIL is used to comment out forms. Occasionally #+IGNORE is used
330  ;; for this too. So don't use :NIL or :IGNORE as the names of features..
331
332  ;; notes on :SB-XC and :SB-XC-HOST features (which aren't controlled by this
333  ;; file, but are instead temporarily pushed onto *FEATURES* or
334  ;; *TARGET-FEATURES* during some phases of cross-compilation):
335  ;;
336  ;; :SB-XC-HOST stands for "cross-compilation host" and is in *FEATURES*
337  ;; during the first phase of cross-compilation bootstrapping, when the
338  ;; host Lisp is being used to compile the cross-compiler.
339  ;;
340  ;; :SB-XC stands for "cross compiler", and is in *FEATURES* during the second
341  ;; phase of cross-compilation bootstrapping, when the cross-compiler is
342  ;; being used to create the first target Lisp.
343
344  ;; notes on the :SB-ASSEMBLING feature (which isn't controlled by
345  ;; this file):
346  ;;
347  ;; This is a flag for whether we're in the assembler. It's
348  ;; temporarily pushed onto the *FEATURES* list in the setup for
349  ;; the ASSEMBLE-FILE function. It would be a bad idea
350  ;; to use it as a name for a permanent feature.
351
352  ;; notes on local features (which are set automatically by the
353  ;; configuration script, and should not be set here unless you
354  ;; really, really know what you're doing):
355  ;;
356  ;; machine architecture features:
357  ;;   :x86
358  ;;      any Intel 386 or better, or compatibles like the AMD K6 or K7
359  ;;   :x86-64
360  ;;      any x86-64 CPU running in 64-bit mode
361  ;;   :alpha
362  ;;      DEC/Compaq Alpha CPU
363  ;;   :sparc
364  ;;      any Sun UltraSPARC (possibly also non-Ultras -- currently untested)
365  ;;   :ppc
366  ;;      any PowerPC CPU
367  ;;   :hppa
368  ;;      any PA-RISC CPU
369  ;;   :mips
370  ;;      any MIPS CPU (in little-endian mode with :little-endian)
371  ;;
372  ;; (CMU CL also had a :pentium feature, which affected the definition
373  ;; of some floating point vops. It was present but not enabled or
374  ;; documented in the CMU CL code that SBCL is derived from, and has
375  ;; now been moved to the backend-subfeatures mechanism.)
376  ;;
377  ;; properties derived from the machine architecture
378  ;;   :control-stack-grows-downward-not-upward
379  ;;     On the X86, the Lisp control stack grows downward. On the
380  ;;     other supported CPU architectures as of sbcl-0.7.1.40, the
381  ;;     system stack grows upward.
382  ;;   Note that there are other stack-related differences between the
383  ;;   X86 port and the other ports. E.g. on the X86, the Lisp control
384  ;;   stack coincides with the C stack, meaning that on the X86 there's
385  ;;   stuff on the control stack that the Lisp-level debugger doesn't
386  ;;   understand very well. As of sbcl-0.7.1.40 things like that are
387  ;;   just parameterized by #!+X86, but it'd probably be better to
388  ;;   use new flags like :CONTROL-STACK-CONTAINS-C-STACK.
389  ;;
390  ;;   :stack-allocatable-closures
391  ;;     The compiler can allocate dynamic-extent closures on stack.
392  ;;
393  ;;   :alien-callbacks
394  ;;     Alien callbacks have been implemented for this platform.
395  ;;
396  ;;   :compare-and-swap-vops
397  ;;     The backend implements compare-and-swap VOPs.
398  ;;
399  ;;   :memory-barrier-vops
400  ;;     Memory barriers (for multi-threaded synchronization) have been
401  ;;     implemented for this platform.
402  ;;
403  ;; operating system features:
404  ;;   :unix    = We're intended to run under some Unix-like OS. (This is not
405  ;;              exclusive with the features which indicate which particular
406  ;;              Unix-like OS we're intended to run under.)
407  ;;   :linux   = We're intended to run under some version of Linux.
408  ;;   :bsd     = We're intended to run under some version of BSD Unix. (This
409  ;;              is not exclusive with the features which indicate which
410  ;;              particular version of BSD we're intended to run under.)
411  ;;   :freebsd = We're intended to run under FreeBSD.
412  ;;   :openbsd = We're intended to run under OpenBSD.
413  ;;   :netbsd  = We're intended to run under NetBSD.
414  ;;   :darwin  = We're intended to run under Darwin (including MacOS X).
415  ;;   :sunos   = We're intended to run under Solaris user environment
416  ;;              with the SunOS kernel.
417  ;;   :hpux    = We're intended to run under HP-UX 11.11 or later
418  ;;   :osf1    = We're intended to run under Tru64 (aka Digital Unix
419  ;;              aka OSF/1).
420  ;;   :win32   = We're intended to under some version of Microsoft Windows.
421  ;; (No others are supported by SBCL as of 1.0.8, but :hpux or :irix
422  ;; support could be ported from CMU CL if anyone is sufficiently
423  ;; motivated to do so.)
424  )