rts/includes: Fix up .dir-locals.el
[ghc.git] / includes / MachDeps.h
index 8e6db3e..f176ef8 100644 (file)
@@ -7,6 +7,10 @@
  *
  * NB: Keep in sync with HsFFI.h and StgTypes.h.
  * NB: THIS FILE IS INCLUDED IN HASKELL SOURCE!
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ *   http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
  * ---------------------------------------------------------------------------*/
 
 #ifndef MACHDEPS_H
 #define SIZEOF_HSINT            SIZEOF_VOID_P
 #define ALIGNMENT_HSINT         ALIGNMENT_VOID_P
 
-#define SIZEOF_HSWORD          SIZEOF_VOID_P
-#define ALIGNMENT_HSWORD       ALIGNMENT_VOID_P
+#define SIZEOF_HSWORD           SIZEOF_VOID_P
+#define ALIGNMENT_HSWORD        ALIGNMENT_VOID_P
 
-#define SIZEOF_HSDOUBLE                SIZEOF_DOUBLE
-#define ALIGNMENT_HSDOUBLE     ALIGNMENT_DOUBLE
+#define SIZEOF_HSDOUBLE         SIZEOF_DOUBLE
+#define ALIGNMENT_HSDOUBLE      ALIGNMENT_DOUBLE
 
-#define SIZEOF_HSFLOAT         SIZEOF_FLOAT
-#define ALIGNMENT_HSFLOAT      ALIGNMENT_FLOAT
+#define SIZEOF_HSFLOAT          SIZEOF_FLOAT
+#define ALIGNMENT_HSFLOAT       ALIGNMENT_FLOAT
 
 #define SIZEOF_HSPTR            SIZEOF_VOID_P
 #define ALIGNMENT_HSPTR         ALIGNMENT_VOID_P
 #define SIZEOF_WORD32           SIZEOF_UNSIGNED_INT
 #define ALIGNMENT_WORD32        ALIGNMENT_UNSIGNED_INT
 
-#if HAVE_LONG_LONG && SIZEOF_VOID_P < 8
-/* assume long long is 64 bits */
-#define SIZEOF_INT64            SIZEOF_LONG_LONG
-#define ALIGNMENT_INT64         ALIGNMENT_LONG_LONG
-#define SIZEOF_WORD64           SIZEOF_UNSIGNED_LONG_LONG
-#define ALIGNMENT_WORD64        ALIGNMENT_UNSIGNED_LONG_LONG
-#elif SIZEOF_LONG == 8
+#if SIZEOF_LONG == 8
 #define SIZEOF_INT64            SIZEOF_LONG
 #define ALIGNMENT_INT64         ALIGNMENT_LONG
 #define SIZEOF_WORD64           SIZEOF_UNSIGNED_LONG
 #define ALIGNMENT_WORD64        ALIGNMENT_UNSIGNED_LONG
+#elif HAVE_LONG_LONG && SIZEOF_LONG_LONG == 8
+#define SIZEOF_INT64            SIZEOF_LONG_LONG
+#define ALIGNMENT_INT64         ALIGNMENT_LONG_LONG
+#define SIZEOF_WORD64           SIZEOF_UNSIGNED_LONG_LONG
+#define ALIGNMENT_WORD64        ALIGNMENT_UNSIGNED_LONG_LONG
 #else
-#error GHC untested on this architecture: sizeof(void *) < 8 and no long longs.
+#error Cannot find a 64bit type.
 #endif
 
 #ifndef WORD_SIZE_IN_BITS
 #if SIZEOF_HSWORD == 4
 #define WORD_SIZE_IN_BITS       32
+#define WORD_SIZE_IN_BITS_FLOAT 32.0
 #else 
 #define WORD_SIZE_IN_BITS       64
+#define WORD_SIZE_IN_BITS_FLOAT 64.0
 #endif
 #endif