1 /* -----------------------------------------------------------------------------
2 * $Id: MachDeps.h,v 1.5 2001/07/19 09:01:40 simonmar 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 #define FLOAT_SIZE_IN_BYTES SIZEOF_FLOAT
25 #define DOUBLE_SIZE_IN_BYTES SIZEOF_DOUBLE
27 #define SIZEOF_INT8 SIZEOF_CHAR
28 #define ALIGNMENT_INT8 ALIGNMENT_CHAR
29 #define SIZEOF_WORD8 SIZEOF_UNSIGNED_CHAR
30 #define ALIGNMENT_WORD8 ALIGNMENT_UNSIGNED_CHAR
32 #define SIZEOF_INT16 SIZEOF_SHORT
33 #define ALIGNMENT_INT16 ALIGNMENT_SHORT
34 #define SIZEOF_WORD16 SIZEOF_UNSIGNED_SHORT
35 #define ALIGNMENT_WORD16 ALIGNMENT_UNSIGNED_SHORT
37 #if SIZEOF_UNSIGNED_INT == 4
38 #define SIZEOF_INT32 ALIGNMENT_INT
39 #define ALIGNMENT_INT32 SIZEOF_INT
40 #define SIZEOF_WORD32 ALIGNMENT_UNSIGNED_INT
41 #define ALIGNMENT_WORD32 SIZEOF_UNSIGNED_INT
43 #error GHC untested on this architecture: sizeof(unsigned int) != 4
46 #if HAVE_LONG_LONG && SIZEOF_VOID_P < 8
47 /* assume long long is 64 bits */
48 #define SIZEOF_INT64 SIZEOF_LONG_LONG
49 #define ALIGNMENT_INT64 ALIGNMENT_LONG_LONG
50 #define SIZEOF_WORD64 SIZEOF_UNSIGNED_LONG_LONG
51 #define ALIGNMENT_WORD64 ALIGNMENT_UNSIGNED_LONG_LONG
52 #elif SIZEOF_LONG == 8
53 #define SIZEOF_INT64 SIZEOF_LONG
54 #define ALIGNMENT_INT64 ALIGNMENT_LONG
55 #define SIZEOF_WORD64 SIZEOF_UNSIGNED_LONG
56 #define ALIGNMENT_WORD64 ALIGNMENT_UNSIGNED_LONG
58 #error GHC untested on this architecture: sizeof(void *) < 8 and no long longs.