23.03.2013 Views

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

58<br />

2.8 Spice <strong>Lisp</strong><br />

Spice <strong>Lisp</strong> is an implementation <strong>of</strong> Common <strong>Lisp</strong> written mostly in Common<br />

<strong>Lisp</strong> <strong>and</strong> partly in microcode. The initial implementation <strong>of</strong> Spice <strong>Lisp</strong> was done<br />

by the Spice <strong>Lisp</strong> Group at Carnegie-Mellon University (CMU) on the Perq, a<br />

user-microcodable machine built by Perq <strong>Systems</strong> Corporation.<br />

2.8.1 Data Types<br />

The Perq is a 16-bit machine, but the <strong>Lisp</strong> instruction set deals with 32-bit<br />

immediate <strong>and</strong> pointer objects. The typing scheme described here will probably<br />

be retained in other implementations <strong>of</strong> Spice <strong>Lisp</strong>. The most significant 5 bits<br />

<strong>of</strong> a 32 bit-object determine its type. Immediate objects (such as characters <strong>and</strong><br />

fixnums) use the low-order bits to hold information.<br />

Type (5) Immediate Data (27)<br />

Pointer objects (such as CONSes <strong>and</strong> arrays) have an additional 2-bit space<br />

field below the type field. All 32 bits are used as the virtual address <strong>of</strong> a piece <strong>of</strong><br />

storage.<br />

Type (5) Space (2) Other Address Bits (25)<br />

Fixnums <strong>and</strong> short floats use two consecutive type codes each to encode<br />

positive <strong>and</strong> negative numbers. This yields 28 bits <strong>of</strong> precision. Fixnums look like<br />

this:<br />

And short floats like this:<br />

Type (4) Two’s Complement Integer (28)<br />

Type (4) Sign (1) Exponent (8) Mantissa (19)<br />

CONSes are pointer types. Two consecutive words <strong>of</strong> storage at the virtual<br />

address specified by the pointer hold the CAR <strong>and</strong> CDR <strong>of</strong> the CONS.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!