Commit 4d69b633 authored by simonmar's avatar simonmar
Browse files

[project @ 2002-03-26 10:30:44 by simonmar]

Changes to support powerpc-apple-macosx

From: Wolfgang Thaller <wolfgang.thaller@gmx.net>
parent f0e0a108
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: TailCalls.h,v 1.7 2001/02/14 10:33:05 simonmar Exp $ * $Id: TailCalls.h,v 1.8 2002/03/26 10:30:44 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
#else #else
extern void __DISCARD__(void);
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Tail calling on x86 Tail calling on x86
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#if i386_TARGET_ARCH #if i386_TARGET_ARCH
extern void __DISCARD__(void);
/* Note about discard: possibly there to fool GCC into clearing up /* Note about discard: possibly there to fool GCC into clearing up
before we do the jump eg. if there are some arguments left on the C before we do the jump eg. if there are some arguments left on the C
stack that GCC hasn't popped yet. Also possibly to fool any stack that GCC hasn't popped yet. Also possibly to fool any
...@@ -151,6 +151,30 @@ but uses $$dyncall if necessary to cope, just in case you aren't. ...@@ -151,6 +151,30 @@ but uses $$dyncall if necessary to cope, just in case you aren't.
#endif /* hppa1_1_hp_hpux_TARGET */ #endif /* hppa1_1_hp_hpux_TARGET */
/* -----------------------------------------------------------------------------
Tail calling on PowerPC
-------------------------------------------------------------------------- */
#ifdef powerpc_TARGET_ARCH
#define JMP_(cont) \
{ \
void *target; \
target = (void *)(cont); \
goto *target; \
}
/*
I would _love_ to use the following instead,
but GCC fails to generate code for it if it is called for a casted
data pointer - which is exactly what we are going to do...
#define JMP_(cont) ((F_) (cont))()
*/
#endif /* sparc_TARGET_ARCH */
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
FUNBEGIN and FUNEND. FUNBEGIN and FUNEND.
...@@ -168,6 +192,7 @@ but uses $$dyncall if necessary to cope, just in case you aren't. ...@@ -168,6 +192,7 @@ but uses $$dyncall if necessary to cope, just in case you aren't.
* it just doesn't choose to do it at the moment. * it just doesn't choose to do it at the moment.
* -= chak * -= chak
*/ */
#ifndef FB_ #ifndef FB_
#define FB_ __asm__ volatile ("--- BEGIN ---"); __DISCARD__ (); #define FB_ __asm__ volatile ("--- BEGIN ---"); __DISCARD__ ();
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment