[project @ 2000-04-05 14:26:31 by panne]
[ghc-hetmet.git] / ghc / includes / TailCalls.h
index b59abb4..f0fd6a6 100644 (file)
@@ -1,5 +1,7 @@
 /* -----------------------------------------------------------------------------
- * $Id: TailCalls.h,v 1.2 1998/12/02 13:21:43 simonm Exp $
+ * $Id: TailCalls.h,v 1.5 2000/04/05 14:26:31 panne Exp $
+ *
+ * (c) The GHC Team, 1998-1999
  *
  * Stuff for implementing proper tail jumps.
  *
@@ -48,7 +50,7 @@ extern void __DISCARD__(void);
       goto *target;                    \
     }
 
-#endif i386_TARGET_ARCH
+#endif /* i386_TARGET_ARCH */
 
 /* -----------------------------------------------------------------------------
    Tail calling on Sparc
@@ -66,7 +68,7 @@ extern void __DISCARD__(void);
 #define FB_
 #define FE_
 
-#endif sparc_TARGET_ARCH
+#endif /* sparc_TARGET_ARCH */
 
 /* -----------------------------------------------------------------------------
    Tail calling on Alpha
@@ -85,15 +87,28 @@ register void *_procedure __asm__("$27");
 #define FB_
 #define FE_
 
-#endif alpha_TARGET_ARCH
+#endif /* alpha_TARGET_ARCH */
+
+/* -----------------------------------------------------------------------------
+   Tail calling on HP
+   -------------------------------------------------------------------------- */
+
+#ifdef hppa1_1_hp_hpux_TARGET
 
-/*
+#define JMP_(cont)                             \
+    do { void *_procedure = (void *)(cont);    \
+         goto *_procedure;                     \
+       } while(0)
+
+#endif /* hppa1_1_hp_hpux_TARGET */
+
+/* -----------------------------------------------------------------------------
   FUNBEGIN and FUNEND.
 
   These are markers indicating the start and end of Real Code in a
   function.  All instructions between the actual start and end of the
   function and these markers is shredded by the mangler.
-  */
+  -------------------------------------------------------------------------- */
 
 #ifndef FB_
 #define FB_    __asm__ volatile ("--- BEGIN ---");
@@ -105,5 +120,4 @@ register void *_procedure __asm__("$27");
 
 #endif /* !USE_MINIINTERPRETER */
 
-#endif TAILCALLS_H
-
+#endif /* TAILCALLS_H */