1 /* -----------------------------------------------------------------------------
2 * $Id: MachDeps.h,v 1.4 2000/01/25 14:39:14 panne Exp $
4 * (c) The GRASP/AQUA Project, Glasgow University, 1998
5 * (c) The GHC Team, 1998-1999
7 * Definitions that characterise machine specific properties of basic
8 * Stg types provided as unboxed types (mirrors the typedefs in
11 * NB: THIS FILE IS INCLUDED IN HASKELL SOURCE!
12 * ---------------------------------------------------------------------------*/
19 #define CHAR_SIZE_IN_BYTES 1
20 #define ADDR_SIZE_IN_BYTES SIZEOF_VOID_P
21 #define INT_SIZE_IN_BYTES SIZEOF_LONG
22 #define WORD_SIZE_IN_BYTES SIZEOF_LONG
24 #if SIZEOF_DOUBLE == SIZEOF_VOID_P
25 #define FLOAT_SIZE_IN_BYTES SIZEOF_DOUBLE
26 #define DOUBLE_SIZE_IN_BYTES SIZEOF_DOUBLE
28 #define FLOAT_SIZE_IN_BYTES SIZEOF_FLOAT
29 #define DOUBLE_SIZE_IN_BYTES SIZEOF_DOUBLE
32 #define SIZEOF_INT8 SIZEOF_CHAR
33 #define ALIGNMENT_INT8 ALIGNMENT_CHAR
34 #define SIZEOF_WORD8 SIZEOF_UNSIGNED_CHAR
35 #define ALIGNMENT_WORD8 ALIGNMENT_UNSIGNED_CHAR
37 #define SIZEOF_INT16 SIZEOF_SHORT
38 #define ALIGNMENT_INT16 ALIGNMENT_SHORT
39 #define SIZEOF_WORD16 SIZEOF_UNSIGNED_SHORT
40 #define ALIGNMENT_WORD16 ALIGNMENT_UNSIGNED_SHORT
42 #if SIZEOF_UNSIGNED_INT == 4
43 #define SIZEOF_INT32 ALIGNMENT_INT
44 #define ALIGNMENT_INT32 SIZEOF_INT
45 #define SIZEOF_WORD32 ALIGNMENT_UNSIGNED_INT
46 #define ALIGNMENT_WORD32 SIZEOF_UNSIGNED_INT
48 #error GHC untested on this architecture: sizeof(unsigned int) != 4
51 #if HAVE_LONG_LONG && SIZEOF_VOID_P < 8
52 /* assume long long is 64 bits */
53 #define SIZEOF_INT64 SIZEOF_LONG_LONG
54 #define ALIGNMENT_INT64 ALIGNMENT_LONG_LONG
55 #define SIZEOF_WORD64 SIZEOF_UNSIGNED_LONG_LONG
56 #define ALIGNMENT_WORD64 ALIGNMENT_UNSIGNED_LONG_LONG
57 #elif SIZEOF_LONG == 8
58 #define SIZEOF_INT64 SIZEOF_LONG
59 #define ALIGNMENT_INT64 ALIGNMENT_LONG
60 #define SIZEOF_WORD64 SIZEOF_UNSIGNED_LONG
61 #define ALIGNMENT_WORD64 ALIGNMENT_UNSIGNED_LONG
63 #error GHC untested on this architecture: sizeof(void *) < 8 and no long longs.