home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v92.tgz / v92.tar / v92 / src / h / cpuconf.h < prev    next >
C/C++ Source or Header  |  1996-03-22  |  9KB  |  322 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".  Note that
  17.  *  WordBits is the number of bits in an Icon integer, not necessarily
  18.  *  the number of bits in an int (given by IntBits).  For example,
  19.  *  in MS-DOS an Icon integer is a long, not an int.
  20.  *
  21.  *  MaxStrLen must not be so large as to overlap flags.
  22.  */
  23.  
  24. /*
  25.  * 64-bit words.
  26.  */
  27.  
  28. #if WordBits == 64
  29.  
  30. #ifndef MinLong
  31. #define MinLong  ((long int)0x8000000000000000) /* smallest long integer */
  32. #endif
  33.  
  34. #ifndef MaxLong
  35. #define MaxLong  ((long int)0x7fffffffffffffff) /* largest long integer */
  36. #endif
  37.  
  38. #define MaxStrLen 017777777777L /* maximum string length */
  39.  
  40. #ifndef MaxNegInt
  41. #define MaxNegInt "-9223372036854775808"
  42. #endif
  43.  
  44. #ifndef F_Nqual
  45. #define F_Nqual 0x8000000000000000    /* set if NOT string qualifier */
  46. #endif                    /* F_Nqual */
  47. #ifndef F_Var
  48. #define F_Var    0x4000000000000000    /* set if variable */
  49. #endif                    /* F_Var */
  50. #ifndef F_Ptr
  51. #define F_Ptr    0x1000000000000000    /* set if value field is pointer */
  52. #endif                    /* F_Ptr */
  53. #ifndef F_Typecode
  54. #define F_Typecode  0x2000000000000000    /* set if dword includes type code */
  55. #endif                    /* F_Typecode */
  56.  
  57. #endif                    /* WordBits == 64 */
  58.  
  59. /*
  60.  * 32-bit words.
  61.  */
  62.  
  63. #if WordBits == 32
  64.  
  65. #define MaxLong  ((long int)017777777777L)   /* largest long integer */
  66. #define MinLong  ((long int)020000000000L)   /* smallest long integer */
  67.  
  68. #define MaxNegInt "-2147483648"
  69.  
  70. #define MaxStrLen         0777777777    /* maximum string length */
  71.  
  72. #define F_Nqual 0x80000000        /* set if NOT string qualifier */
  73. #define F_Var    0x40000000        /* set if variable */
  74. #define F_Ptr    0x10000000        /* set if value field is pointer */
  75. #define F_Typecode  0x20000000    /* set if dword includes type code */
  76. #endif                    /* WordBits == 32 */
  77.  
  78. /* Values that depend on the number of bits in an int (not necessarily
  79.  * the same as the number of bits in a word).
  80.  */
  81.  
  82. #if IntBits == 64
  83. #define LogIntBits            6    /* log of IntBits */
  84. #define MaxUnsigned 01777777777777777777777L /* largest unsigned integer */
  85. #define MaxInt         0777777777777777777777L /* largest int */
  86. /*
  87.  * Cset initialization and access macros.
  88.  */
  89. #define fwd(w0, w1, w2, w3) \
  90.  ((w0)&0xffff | ((unsigned)(w1)&0xffff)<<16 | ((unsigned)(w2)&0xffff)<<32 \
  91.  | ((unsigned)(w3)&0xffff)<<48)
  92. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  93.  {fwd(w0,w1,w2,w3),fwd(w4,w5,w6,w7),fwd(w8,w9,wa,wb),fwd(wc,wd,we,wf)}
  94. #define Cset32(b,c) (*CsetPtr(b,c)>>(32*CsetOff((b)>>5)))  /* 32 bits of cset */
  95. #endif                    /* IntBits == 64 */
  96.  
  97. #if IntBits == 32
  98. #define LogIntBits            5    /* log of IntBits */
  99. #define MaxUnsigned      037777777777    /* largest unsigned integer */
  100. #define MaxInt           017777777777    /* largest int */
  101. /*
  102.  * Cset initialization and access macros.
  103.  */
  104. #define twd(w0,w1)    ((w0)&0xffff | ((unsigned)w1)<<16)
  105. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  106.     {twd(w0,w1),twd(w2,w3),twd(w4,w5),twd(w6,w7), \
  107.      twd(w8,w9),twd(wa,wb),twd(wc,wd),twd(we,wf)}
  108. #define Cset32(b,c) (*CsetPtr(b,c))    /* 32 bits of cset */
  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. #ifndef MaxListSlots
  117. #define MaxListSlots 8000        /* largest list-element block */
  118. #endif                    /* MaxListSlots */
  119.  
  120. /*
  121.  * Cset initialization and access macros.
  122.  */
  123. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  124.     {w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf}
  125. #define Cset32(b,c) (((unsigned long)(unsigned int)(*CsetPtr((b)+16,c))<<16) | \
  126.    ((unsigned long)(unsigned int)(*CsetPtr(b,c))))  /* 32 bits of cset */
  127. #endif                    /* IntBits == 16 */
  128.  
  129. #ifndef LogHuge
  130. #define LogHuge 309            /* maximum base-10 exp+1 of real */
  131. #endif                    /* LogHuge */
  132.  
  133. #ifndef Big
  134. #define Big 9007199254740992.        /* larger than 2^53 lose precision */
  135. #endif                    /* Big */
  136.  
  137. #ifndef Precision
  138. #define Precision 10            /* digits in string from real */
  139. #endif                    /* Precision */
  140.  
  141. /*
  142.  * Parameters that configure tables and sets:
  143.  *
  144.  *  HSlots    Initial number of hash buckets; must be a power of 2.
  145.  *  LogHSlots    Log to the base 2 of HSlots.
  146.  *
  147.  *  HSegs    Maximum number of hash bin segments; the maximum number of
  148.  *        hash bins is HSlots * 2 ^ (HSegs - 1).
  149.  *
  150.  *        If Hsegs is increased above 12, the arrays log2h[] and segsize[]
  151.  *        in the runtime system will need modification.
  152.  *
  153.  *  MaxHLoad    Maximum loading factor; more hash bins are allocated when
  154.  *        the average bin exceeds this many entries.
  155.  *
  156.  *  MinHLoad    Minimum loading factor; if a newly created table (e.g. via
  157.  *        copy()) is more lightly loaded than this, bins are combined.
  158.  *
  159.  *  Because splitting doubles the number of hash bins, and combining halves it,
  160.  *  MaxHLoad should be at least twice MinHLoad.
  161.  */
  162.  
  163. #ifndef HSlots
  164. #if IntBits == 16
  165. #define HSlots     4
  166. #define LogHSlots  2
  167. #else
  168. #define HSlots     8
  169. #define LogHSlots  3
  170. #endif                    /* IntBits */
  171. #endif                    /* HSlots */
  172.  
  173. #if ((1 << LogHSlots) != HSlots)
  174. Deliberate Syntax Error -- HSlots and LogHSlots are inconsistent
  175. #endif                    /* HSlots / LogHSlots consistency */
  176.  
  177. #ifndef HSegs
  178. #if IntBits == 16
  179. #define HSegs      6
  180. #else
  181. #define HSegs     10
  182. #endif                    /* IntBits */
  183. #endif                    /* HSegs */
  184.  
  185. #ifndef MinHLoad
  186. #define MinHLoad  1
  187. #endif                    /* MinHLoad */
  188.  
  189. #ifndef MaxHLoad
  190. #define MaxHLoad  5
  191. #endif                    /* MaxHLoad */
  192.  
  193. /*
  194.  * The number of bits in each base-B digit; the type DIGIT (unsigned int)
  195.  *  in rt.h must be large enough to hold this many bits.
  196.  *  It must be at least 2 and at most WordBits / 2.
  197.  */
  198.  
  199. #define NB           (WordBits / 2)
  200.  
  201. /*
  202.  * The number of decimal digits at which the image lf a large integer
  203.  * goes from exact to approximate (to avoid possible long delays in
  204.  * conversion from large integer to string because of its quadratic
  205.  * complexity).
  206.  */
  207.  
  208. #define MaxDigits    30
  209.  
  210. /*
  211.  * Memory sizing. 
  212.  */
  213.  
  214. #ifndef AlcMax
  215. #define AlcMax 25
  216. #endif                    /* AlcMax */
  217.  
  218. /*
  219.  * Maximum sized block that can be allocated (via malloc() or such).
  220.  */
  221.  
  222. #ifndef MaxBlock
  223. #if IntBits == 16
  224. #define MaxBlock 65000            /* leaves room for malloc header */
  225. #else                    /* IntBits == 16 */
  226. #define MaxBlock MaxUnsigned
  227. #endif                    /* IntBits == 16 */
  228. #endif                    /* MaxBlock */
  229.  
  230. /*
  231.  * What follows is default memory sizing. Implementations with special
  232.  *  requirements may specify these values in define.h.
  233.  */
  234.  
  235. #ifndef MaxStrSpace
  236. #if IntBits == 16
  237. #define MaxStrSpace            65000    /* size of the string space in bytes */
  238. #else                    /* IntBits == 16 */
  239. #define MaxStrSpace           500000    /* size of the string space in bytes */
  240. #endif                    /* IntBits == 16 */
  241. #endif                    /* MaxStrSpace */
  242.  
  243. #ifndef MaxAbrSize
  244. #if IntBits == 16
  245. #define MaxAbrSize            65000    /* size of the block region in bytes */
  246. #else                    /* IntBits == 16 */
  247. #define MaxAbrSize           500000    /* size of the block region in bytes */
  248. #endif                    /* IntBits == 16 */
  249. #endif                    /* MaxAbrSize */
  250.  
  251. #ifndef MStackSize
  252. #ifdef MultiThread
  253. #define MStackSize        20000    /* size of the main stack in words */
  254. #else                    /* MultiThread */
  255. #define MStackSize        10000    /* size of the main stack in words */
  256. #endif                    /* MultiThread */
  257. #endif                    /* MStackSize */
  258.  
  259. #ifndef StackSize
  260. #define StackSize          2000    /* words in co-expression stack */
  261. #endif                    /* StackSize */
  262.  
  263. #ifndef QualLstSize
  264. #define QualLstSize         5000    /* size of qualifier pointer region */
  265. #endif                    /* QualLstSize */
  266.  
  267. #ifndef ActStkBlkEnts
  268. #ifdef Coexpr
  269. #define ActStkBlkEnts           25    /* number of entries in an astkblk */
  270. #else                    /* Coexpr */
  271. #define ActStkBlkEnts            1    /* number of entries in an astkblk */
  272. #endif                    /* Coexpr */
  273. #endif                    /* ActStkBlkEnts */
  274.  
  275. #ifndef RegionCushion
  276. #define RegionCushion              10    /* % memory cushion to avoid thrashing*/
  277. #endif                    /* RegionCushion */
  278.  
  279. #ifndef RegionGrowth
  280. #define RegionGrowth          200    /* % region growth when full */
  281. #endif                    /* RegionGrowth */
  282.  
  283. /*
  284.  * Minimum regions sizes (presently not used).
  285.  */
  286.  
  287. #ifndef MinStatSize
  288. #ifdef Coexpr
  289. #define MinStatSize        10240    /* size of the static region in bytes*/
  290. #else                    /* Coexpr */
  291. #define MinStatSize         1024    /* size of static region in bytes */
  292. #endif                    /* Coexpr */
  293. #endif                    /* MinStatSize */
  294.  
  295. #ifndef MinStrSpace
  296. #define MinStrSpace         5000    /* size of the string space in bytes */
  297. #endif                    /* MinStrSpace */
  298.  
  299. #ifndef MinAbrSize
  300. #define MinAbrSize         5000    /* size of the block region in bytes */
  301. #endif                    /* MinAbrSize */
  302.  
  303. #ifndef MinMStackSize
  304. #define MinMStackSize         2000    /* size of the main stack in words */
  305. #endif                    /* MinMStackSize */
  306.  
  307. #ifndef MinStackSize
  308. #define MinStackSize         1000    /* words in co-expression stack */
  309. #endif                    /* MinStackSize */
  310.  
  311. #ifndef MinQualLstSize
  312. #define MinQualLstSize          500    /* size of qualifier pointer region */
  313. #endif                    /* MinQualLstSize */
  314.  
  315. #ifndef GranSize
  316. #define GranSize                64    /* storage allocation granule size */
  317. #endif                    /* GranSize */
  318.  
  319. #ifndef Sqlinc
  320. #define Sqlinc        128*sizeof(dptr *)     /* qualifier pointer list increment */
  321. #endif                    /* Sqlinc */
  322.