platform-64.scm 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ; Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. ; Essential constants for 32-bit platforms.
  3. ; Fundamental parameters
  4. (define bytes-per-cell 8)
  5. (define log-bytes-per-cell 3)
  6. (define bits-per-byte 8)
  7. (define bits-per-cell (* bits-per-byte bytes-per-cell))
  8. (define addressing-units-per-cell bytes-per-cell)
  9. ; This is actually the mimimum for the different PreScheme implementations.
  10. ; The Scheme version of PreScheme leaves 30 bits for PreScheme's fixnums.
  11. ; There have to be enough bits to represent the largest fixnum in the system.
  12. ; USEFUL-BITS-PER-WORD is not written in the image.
  13. (define s48-useful-bits-per-word 62) ; in Scheme48
  14. (define c-useful-bits-per-word 64) ; when compiled
  15. ; Addresses
  16. ;
  17. ; An "addressing unit" is the smallest quantum of storage addressed by
  18. ; an address on a particular machine. On a DEC-20, 3600, or other
  19. ; word-addressed architecture there is one addressing unit per cell. On
  20. ; the VAX or 68000, though, the addressing unit is the byte, of which there
  21. ; are 4 to a cell.
  22. ;
  23. ; Note: by a "byte" is meant enough bits to store a bytecode. That
  24. ; probably means either 7, 8, or 9 bits.
  25. ;
  26. ; If the addressing unit is smaller than a cell each address will have some
  27. ; number of "unused bits" at its low end. On a byte-addressable machine with
  28. ; 32 bit addresses, there are two.
  29. (define unused-field-width log-bytes-per-cell)
  30. ; Descriptors
  31. ; A descriptor describes a Scheme object.
  32. ; A descriptor is represented as an integer whose low two bits are
  33. ; tag bits. The high bits contain information whose format and
  34. ; meaning are dependent on the tag.
  35. (define tag-field-width 2)
  36. (define data-field-width (- bits-per-cell tag-field-width))
  37. ; Immediates
  38. ; This streamlines 8-bit-byte-oriented implementations.
  39. (define immediate-type-field-width
  40. (- bits-per-byte tag-field-width))
  41. ; Pre-Scheme
  42. (define pre-scheme-integer-size bits-per-cell)