home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / icon / Source / h / Cpuconf < prev    next >
Encoding:
Text File  |  1990-07-19  |  5.5 KB  |  194 lines

  1. /*
  2.  *  Configuration parameters that depend on computer architecture.
  3.  *  Some depend on values defined in config.h, which is always
  4.  *  included before this file.
  5.  */
  6.  
  7. #ifndef CStateSize
  8. #define CStateSize 15            /* size of C state for co-expressions */
  9. #endif                    /* CStateSize */
  10.  
  11. /*
  12.  * The following definitions depend on the sizes of ints and pointers.
  13.  */
  14.  
  15. /*
  16.  * Most of the present implementations use 32-bit "words".  The section
  17.  *  for 64-bit words is tentative and untested.  16-bit words are no
  18.  *  longer supported.  Note that WordBits is the number of bits in an Icon
  19.  *  integer, not necessarily the number of bits in an int (given by IntBits).
  20.  *  For example, in MS-DOS an Icon integer is a long, not an int.
  21.  *
  22.  *  MaxStrLen must not be so large as to overlap flags.
  23.  */
  24.  
  25. /*
  26.  * 64-bit words.  NOTE:  This section is under construction!
  27.  */
  28.  
  29. #if WordBits == 64
  30.  
  31. #ifndef MinLong
  32. #define MinLong  ((long int)0x8000000000000000) /* smallest long integer */
  33. #endif
  34.  
  35. #ifndef MaxLong
  36. #define MaxLong  ((long int)0x7fffffffffffffff) /* largest long integer */
  37. #endif
  38.  
  39. #define MaxDigits 40        /* maximum number of digits in images */
  40. #define MaxStrLen 017777777777L /* maximum string length */
  41.  
  42. #ifndef MaxNegInt
  43. #define MaxNegInt "-9223372036854775808"
  44. #endif
  45.  
  46. #ifndef F_Nqual
  47. #define F_Nqual 0x8000000000000000    /* set if NOT string qualifier */
  48. #endif
  49. #ifndef F_Var
  50. #define F_Var    0x4000000000000000    /* set if variable */
  51. #endif
  52. #ifndef F_Tvar
  53. #define F_Tvar    0x2000000000000000    /* set if trapped variable */
  54. #endif
  55. #ifndef F_Ptr
  56. #define F_Ptr    0x1000000000000000    /* set if value field is pointer */
  57. #endif
  58.  
  59. #endif                    /* WordBits == 64 */
  60.  
  61. /*
  62.  * 32-bit words.
  63.  */
  64.  
  65. #if WordBits == 32
  66.  
  67. #define MaxLong  ((long int)017777777777L)   /* largest long integer */
  68. #define MinLong  ((long int)020000000000L)   /* smallest long integer */
  69. #define MaxDigits 20        /* maximum number of digits in images */
  70.  
  71. #define MaxNegInt "-2147483648"
  72.  
  73. #define MaxStrLen         0777777777    /* maximum string length */
  74.  
  75. #define F_Nqual 0x80000000        /* set if NOT string qualifier */
  76. #define F_Var    0x40000000        /* set if variable */
  77. #define F_Tvar    0x20000000        /* set if trapped variable */
  78. #define F_Ptr    0x10000000        /* set if value field is pointer */
  79. #endif                    /* WordBits == 32 */
  80.  
  81. /* Values that depend on the number of bits in an int (not necessarily
  82.  * the same as the number of bits in a word).
  83.  */
  84.  
  85. #if IntBits == 64
  86. #define LogIntBits            6    /* log of IntBits */
  87. #define MaxUnsigned 01777777777777777777777L /* largest unsigned integer */
  88. #define MaxInt         0777777777777777777777L /* largest int */
  89. /*
  90.  * Cset initialization macros.
  91.  */
  92. #define fwd(w0, w1, w2, w3) \
  93.  ((w0)&0xffff | ((w1)&0xffff)<<16 | ((w2)&0xffff)<<32 | ((w3)&0xffff)<<48)
  94. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  95.  {fwd(w0,w1,w2,w3),fwd(w4,w5,w6,w7),fwd(w8,w9,wa,wb),fwd(wc,wd,we,wf)}
  96. #endif                    /* IntBits == 64 */
  97.  
  98. #if IntBits == 32
  99. #define LogIntBits            5    /* log of IntBits */
  100. #define MaxUnsigned      037777777777    /* largest unsigned integer */
  101. #define MaxInt           07777777777    /* largest int */
  102. /*
  103.  * Cset initialization macros.
  104.  */
  105. #define twd(w0,w1)    ((w0)&0xffff | (w1)<<16)
  106. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  107.     {twd(w0,w1),twd(w2,w3),twd(w4,w5),twd(w6,w7), \
  108.      twd(w8,w9),twd(wa,wb),twd(wc,wd),twd(we,wf)}
  109. #endif                    /* IntBits == 32 */
  110.  
  111. #if IntBits == 16
  112. #define LogIntBits                4    /* log of IntBits */
  113. #define MaxUnsigned ((unsigned int)0177777)    /* largest unsigned integer */
  114. #define MaxInt              077777    /* largest int */
  115. /*
  116.  * Cset initialization macro.
  117.  */
  118. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  119.     {w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf}
  120. #endif                    /* IntBits == 16 */
  121.  
  122. #ifndef LogHuge
  123. #define LogHuge 309            /* maximum base-10 exp+1 of real */
  124. #endif                    /* LogHuge */
  125.  
  126. #ifndef Big
  127. #define Big 9007199254740992.        /* larger than 2^53 lose precision */
  128. #endif                    /* Big */
  129.  
  130. #ifndef Precision
  131. #define Precision 10            /* digits in string from real */
  132. #endif                    /* Precision */
  133.  
  134. /*
  135.  * Parameters that configure tables and sets:
  136.  *
  137.  *  HSlots    Initial number of hash buckets; must be a power of 2.
  138.  *  LogHSlots    Log to the base 2 of HSlots.
  139.  *
  140.  *  HSegs    Maximum number of hash bin segments; the maximum number of
  141.  *        hash bins is HSlots * 2 ^ (HSegs - 1).
  142.  *
  143.  *        If Hsegs is increased above 12, the arrays log2[] and segsize[]
  144.  *        in iconx will need modification.
  145.  *
  146.  *  MaxHLoad    Maximum loading factor; more hash bins are allocated when
  147.  *        the average bin exceeds this many entries.
  148.  *
  149.  *  MinHLoad    Minimum loading factor; if a newly created table (e.g. via
  150.  *        copy()) is more lightly loaded than this, bins are combined.
  151.  *
  152.  *  Because splitting doubles the number of hash bins, and combining halves it,
  153.  *  MaxHLoad should be at least twice MinHLoad.
  154.  */
  155.  
  156. #ifndef HSlots
  157. #if IntBits == 16
  158. #define HSlots     4
  159. #define LogHSlots  2
  160. #else
  161. #define HSlots     8
  162. #define LogHSlots  3
  163. #endif                    /* IntBits */
  164. #endif                    /* HSlots */
  165.  
  166. #if ((1 << LogHSlots) != HSlots)
  167. Deliberate Syntax Error -- HSlots and LogHSlots are inconsistent
  168. #endif                    /* HSlots / LogHSlots consistency */
  169.  
  170. #ifndef HSegs
  171. #if IntBits == 16
  172. #define HSegs      6
  173. #else
  174. #define HSegs     10
  175. #endif                    /* IntBits */
  176. #endif                    /* HSegs */
  177.  
  178. #ifndef MinHLoad
  179. #define MinHLoad  1
  180. #endif                    /* MinHLoad */
  181.  
  182. #ifndef MaxHLoad
  183. #define MaxHLoad  5
  184. #endif                    /* MaxHLoad */
  185.  
  186. /*
  187.  * The number of bits in each base-B digit; the type DIGIT (unsigned int)
  188.  *  in rt.h must be large enough to hold this many bits.
  189.  *  It must be at least 2 and at most WordBits / 2.
  190.  */
  191.  
  192. #define NB           (WordBits / 2)
  193.  
  194.