summaryrefslogtreecommitdiff
path: root/includes/stg/HaskellMachRegs.h
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-08-06 17:34:12 +0100
committerIan Lynagh <ian@well-typed.com>2012-08-06 17:49:22 +0100
commit8e7fb28fc89eb9b99c747698f41995c269cd1090 (patch)
treee1180d9b772e03c41fe5058682b81bb32f610d08 /includes/stg/HaskellMachRegs.h
parent6997bb5ec1b1e755d954e910d76322ad1963f94b (diff)
downloadhaskell-8e7fb28fc89eb9b99c747698f41995c269cd1090.tar.gz
Start separating out the RTS and Haskell imports of MachRegs.h
No functional differences yet
Diffstat (limited to 'includes/stg/HaskellMachRegs.h')
-rw-r--r--includes/stg/HaskellMachRegs.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/includes/stg/HaskellMachRegs.h b/includes/stg/HaskellMachRegs.h
new file mode 100644
index 0000000000..7a16f47fde
--- /dev/null
+++ b/includes/stg/HaskellMachRegs.h
@@ -0,0 +1,47 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2011
+ *
+ * Registers used in STG code. Might or might not correspond to
+ * actual machine registers.
+ *
+ * Do not #include this file directly: #include "Rts.h" instead.
+ *
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
+ * ---------------------------------------------------------------------------*/
+
+#ifndef HASKELLMACHREGS_H
+#define HASKELLMACHREGS_H
+
+/*
+ * Defining NO_REGS causes no global registers to be used. NO_REGS is
+ * typically defined by GHC, via a command-line option passed to gcc,
+ * when the -funregisterised flag is given.
+ *
+ * NB. When NO_REGS is on, calling & return conventions may be
+ * different. For example, all function arguments will be passed on
+ * the stack, and components of an unboxed tuple will be returned on
+ * the stack rather than in registers.
+ */
+#ifdef NO_REGS
+
+#define MACHREGS_NO_REGS 1
+
+#else
+
+#define MACHREGS_NO_REGS 0
+
+#define MACHREGS_i386 i386_TARGET_ARCH
+#define MACHREGS_x86_64 x86_64_TARGET_ARCH
+#define MACHREGS_powerpc (powerpc_TARGET_ARCH || powerpc64_TARGET_ARCH || rs6000_TARGET_ARCH)
+#define MACHREGS_sparc sparc_TARGET_ARCH
+#define MACHREGS_arm arm_TARGET_ARCH
+#define MACHREGS_darwin darwin_TARGET_OS
+
+#endif
+
+#include "stg/MachRegs.h"
+
+#endif /* HASKELLMACHREGS_H */