TC-machine-2.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. From boyer@jumpjibe.stanford.edu Fri Jun 9 14:17:09 1995
  2. Received: from jumpjibe.stanford.edu (jumpjibe.Stanford.EDU [36.4.0.23]) by gluttony.isc.tamu.edu (8.6.11/8.6.11) with ESMTP id OAA24615 for <des@isc.tamu.edu>; Fri, 9 Jun 1995 14:17:07 -0500
  3. Received: (from boyer@localhost) by jumpjibe.stanford.edu (8.6.10/8.6.10) id MAA15164 for des@isc.tamu.edu; Fri, 9 Jun 1995 12:17:24 -0700
  4. Message-Id: <199506091917.MAA15164@jumpjibe.stanford.edu>
  5. From: boyer@jumpjibe.stanford.edu (Brent Boyer)
  6. Date: Fri, 9 Jun 1995 12:17:24 PDT
  7. In-Reply-To: David Stewart <des@isc.tamu.edu>
  8. "Re: Meschach setup question" (Jun 8, 19:07)
  9. X-Mailer: Mail User's Shell (7.2.0 10/31/90)
  10. To: David Stewart <des@isc.tamu.edu>
  11. Subject: Re: Meschach setup question
  12. Content-Length: 9498
  13. X-Lines: 369
  14. Status: RO
  15. david,
  16. did this file get thru to you last nite? (someone else told
  17. me that i sent it them instead; maybe i accidentally cced it to them).
  18. -brent
  19. below is the new machine.h file for Macs:
  20. /* ================================================================================ */
  21. /* machine.h. Generated automatically by configure. */
  22. /* Any machine specific stuff goes here */
  23. /* Add details necessary for your own installation here! */
  24. /* RCS id: $Id: machine.h.in,v 1.2 1994/03/13 23:07:30 des Exp $ */
  25. /* This is for use with "configure" -- if you are not using configure
  26. then use machine.van for the "vanilla" version of machine.h */
  27. /* Note special macros: ANSI_C (ANSI C syntax)
  28. SEGMENTED (segmented memory machine e.g. MS-DOS)
  29. MALLOCDECL (declared if malloc() etc have
  30. been declared) */
  31. /* ================================================================================ */
  32. /* #undef const */ /* leave this commented out -- THINK C has no keyword named "const" */
  33. /* #undef MALLOCDECL */ /* leave this commented out -- THINK C doesn't supply <malloc.h> */
  34. #define NOT_SEGMENTED 1 /* this must #defined -- Mac's don't have segmented memory */
  35. #undef HAVE_MEMORY_H /* make sure this is #undefined -- THINK C doesn't supply <memory.h> */
  36. #undef HAVE_COMPLEX_H /* make sure this is #undefined -- THINK C doesn't supply <complex.h> */
  37. #undef HAVE_MALLOC_H /* make sure this is #undefined -- THINK C doesn't supply <malloc.h> */
  38. #define STDC_HEADERS 1 /* this must be #defined -- it will cause precisely two effects below:
  39. 1) the macros MEM_COPY(...) & MEM_ZERO(...) will be correctly
  40. defined using memmove(...) & memset(...)
  41. 2) the macro ANSI_C will be #defined */
  42. #undef HAVE_BCOPY /* make sure this is #undefined -- bcopy is for a BSD system? */
  43. #undef HAVE_BZERO /* make sure this is #undefined -- bzero is for a BSD system? */
  44. /* #undef CHAR0ISDBL0 1 */ /* for safety, this should be commented out (Dave Stewart's advice) */
  45. #define WORDS_BIGENDIAN 1 /* 68K Macs use big endian microprocessors */
  46. #undef U_INT_DEF /* make sure this is #undefined (Dave Stewart's advice) */
  47. #define VARARGS 1 /* this must be #defined (Dave Stewart's advice) */
  48. /* ================================================================================ */
  49. /* for prototypes */
  50. #define HAVE_PROTOTYPES 1 /* this must be #defined (Dave Stewart's advice) */
  51. #define HAVE_PROTOTYPES_IN_STRUCT 1 /* this must be #defined (Dave Stewart's advice) */
  52. /* for inclusion into C++ files */
  53. #ifdef __cplusplus /* (Note: THINK C must #define this somewhere, since it is used in "ctype.h") */
  54. #define ANSI_C 1
  55. #ifndef HAVE_PROTOTYPES
  56. #define HAVE_PROTOTYPES 1
  57. #endif
  58. #ifndef HAVE_PROTOTYPES_IN_STRUCT
  59. #define HAVE_PROTOTYPES_IN_STRUCT 1
  60. #endif
  61. #endif /* __cplusplus */
  62. /* example usage: VEC *PROTO(v_get,(int dim)); */
  63. #ifdef HAVE_PROTOTYPES
  64. #define PROTO(name,args) name args
  65. #else
  66. #define PROTO(name,args) name()
  67. #endif /* HAVE_PROTOTYPES */
  68. #ifdef HAVE_PROTOTYPES_IN_STRUCT
  69. /* PROTO_() is to be used instead of PROTO() in struct's and typedef's */
  70. #define PROTO_(name,args) name args
  71. #else
  72. #define PROTO_(name,args) name()
  73. #endif /* HAVE_PROTOTYPES_IN_STRUCT */
  74. /* ================================================================================ */
  75. /* for basic or larger versions */
  76. #define COMPLEX 1 /* this must be #defined (I want all the complex routines) */
  77. #define SPARSE 1 /* this must be #defined (I want all the sparse routines) */
  78. /* ================================================================================ */
  79. /* for loop unrolling */
  80. /* #undef VUNROLL */
  81. /* #undef MUNROLL */
  82. /* ================================================================================ */
  83. /* for segmented memory */
  84. #ifndef NOT_SEGMENTED
  85. #define SEGMENTED
  86. #endif
  87. /* ================================================================================ */
  88. /* if the system has malloc.h */
  89. #ifdef HAVE_MALLOC_H
  90. #define MALLOCDECL 1
  91. #include <malloc.h>
  92. #endif
  93. /* ================================================================================ */
  94. /* any compiler should have this header */
  95. /* if not, change it */
  96. #include <stdio.h>
  97. /* ================================================================================ */
  98. /* Check for ANSI C memmove and memset */
  99. #ifdef STDC_HEADERS
  100. /* standard copy & zero functions */
  101. #define MEM_COPY(from,to,size) memmove((to),(from),(size))
  102. #define MEM_ZERO(where,size) memset((where),'\0',(size))
  103. #ifndef ANSI_C
  104. #define ANSI_C 1
  105. #endif
  106. #endif
  107. /* ================================================================================ */
  108. /* standard headers */
  109. #ifdef ANSI_C
  110. #include <stdlib.h>
  111. #include <stddef.h>
  112. #include <string.h>
  113. #include <float.h>
  114. #include <math.h> /* #include <math.h> so that the macro HUGE_VAL will be available to us */
  115. #endif
  116. /* ================================================================================ */
  117. /* if have bcopy & bzero and no alternatives yet known, use them */
  118. #ifdef HAVE_BCOPY
  119. #ifndef MEM_COPY
  120. /* nonstandard copy function */
  121. #define MEM_COPY(from,to,size) bcopy((char *)(from),(char *)(to),(int)(size))
  122. #endif
  123. #endif
  124. #ifdef HAVE_BZERO
  125. #ifndef MEM_ZERO
  126. /* nonstandard zero function */
  127. #define MEM_ZERO(where,size) bzero((char *)(where),(int)(size))
  128. #endif
  129. #endif
  130. /* ================================================================================ */
  131. /* if the system has complex.h */
  132. #ifdef HAVE_COMPLEX_H
  133. #include <complex.h>
  134. #endif
  135. /* ================================================================================ */
  136. /* If prototypes are available & ANSI_C not yet defined, then define it,
  137. but don't include any header files as the proper ANSI C headers
  138. aren't here */
  139. #ifdef HAVE_PROTOTYPES
  140. #ifndef ANSI_C
  141. #define ANSI_C 1
  142. #endif
  143. #endif
  144. /* ================================================================================ */
  145. /* floating point precision */
  146. /* you can choose single, double or long double (if available) precision */
  147. #define FLOAT 1
  148. #define DOUBLE 2
  149. #define LONG_DOUBLE 3
  150. /* #undef REAL_FLT */
  151. /* #undef REAL_DBL */ /* leave these both commented out, so that the dafault of double is used */
  152. /* choose double precision by default */
  153. #ifndef REAL_DBL
  154. #ifndef REAL_FLT
  155. #define REAL_DBL 1 /* this is what we want: all reals to be of type double */
  156. #endif
  157. #endif
  158. /* single precision */
  159. #ifdef REAL_FLT
  160. #define Real float
  161. #define LongReal float
  162. #define REAL FLOAT
  163. #define LONGREAL FLOAT
  164. #endif
  165. /* double precision */
  166. #ifdef REAL_DBL
  167. #define Real double
  168. #define LongReal double
  169. #define REAL DOUBLE
  170. #define LONGREAL DOUBLE
  171. #endif
  172. /* Note: under THINK C, the type "double" gets mapped to the type "long double" as long as you DO NOT turn on
  173. the "8-byte doubles" option.
  174. Recall: this project was compiled with the "8-byte doubles" option turned OFF (so double == long double)
  175. Also Recall: this project was compiled with the "Generate 68881 instructions" and "Native floating-point format"
  176. options turned ON; this means that double will be a 96 bit MC68881 floating point extended
  177. precision type; these options give the best speed.
  178. (See the THINK C 6.0 User's Guide, pp. 313-317)
  179. --Brent Boyer 6/7/95 */
  180. /* ================================================================================ */
  181. /* machine epsilon or unit roundoff error */
  182. /* This is correct on most IEEE Real precision systems */
  183. #ifdef DBL_EPSILON
  184. #if REAL == DOUBLE
  185. #define MACHEPS DBL_EPSILON
  186. #elif REAL == FLOAT
  187. #define MACHEPS FLT_EPSILON
  188. #elif REAL == LONGDOUBLE
  189. #define MACHEPS LDBL_EPSILON
  190. #endif
  191. #endif
  192. #define F_MACHEPS 1.19209e-07
  193. #define D_MACHEPS 2.22045e-16
  194. /* Note: the extended precision floating point type we are using actually has DBL_EPSILON = 1.08420E-19
  195. (THINK C 6.0 User's Guide, p. 317); out of caution, I will let the above value for D_MACHEPS
  196. stay the same.
  197. --Brent Boyer 6/7/95 */
  198. #ifndef MACHEPS
  199. #if REAL == DOUBLE
  200. #define MACHEPS D_MACHEPS
  201. #elif REAL == FLOAT
  202. #define MACHEPS F_MACHEPS
  203. #elif REAL == LONGDOUBLE
  204. #define MACHEPS D_MACHEPS
  205. #endif
  206. #endif
  207. /* #undef M_MACHEPS */
  208. /********************
  209. #ifdef DBL_EPSILON
  210. #define MACHEPS DBL_EPSILON
  211. #endif
  212. #ifdef M_MACHEPS
  213. #ifndef MACHEPS
  214. #define MACHEPS M_MACHEPS
  215. #endif
  216. #endif
  217. ********************/
  218. /* ================================================================================ */
  219. #define M_MAX_INT 2147483647 /* this value only works if ints are 32 bits */
  220. /* Recall: this project was compiled with the "4-byte ints" option turned ON (so int == long int <==> 32 bits);
  221. if you do not turn this option on, then ints will be 16 bits so that you will need to do
  222. #define M_MAX_INT 32767 instead
  223. --Brent Boyer 6/7/95 */
  224. #ifdef M_MAX_INT
  225. #ifndef MAX_RAND
  226. #define MAX_RAND ((double)(M_MAX_INT))
  227. #endif
  228. #endif
  229. /* ================================================================================ */
  230. /* for non-ANSI systems */
  231. /* we #included <math.h> above precisely so that HUGE_VAL will be #defined here */
  232. #ifndef HUGE_VAL
  233. #define HUGE_VAL HUGE
  234. #else
  235. #ifndef HUGE
  236. #define HUGE HUGE_VAL /* actually, since HUGE is used in several Meschach routines, you need this
  237. line to be executed even on ANSI systems */
  238. #endif
  239. #endif
  240. /* ================================================================================ */
  241. #ifdef ANSI_C
  242. extern int isatty(int);
  243. #endif