-/* -*- mode: hugs-c; -*- */
+
/* -----------------------------------------------------------------------------
- * $Id: Assembler.h,v 1.4 1999/02/05 16:02:18 simonm Exp $
+ * $Id: Assembler.h,v 1.10 1999/10/26 17:27:35 sewardj Exp $
*
* (c) The GHC Team 1994-1998.
*
/* The following can be passed to C */
CHAR_REP = 'C',
INT_REP = 'I',
-#ifdef PROVIDE_INT64
- INT64_REP = 'z',
-#endif
-#ifdef PROVIDE_INTEGER
INTEGER_REP = 'Z',
-#endif
-#ifdef PROVIDE_WORD
WORD_REP = 'W',
-#endif
-#ifdef PROVIDE_ADDR
ADDR_REP = 'A',
-#endif
FLOAT_REP = 'F',
DOUBLE_REP = 'D',
-#ifdef PROVIDE_STABLE
STABLE_REP = 's', /* StablePtr a */
-#endif
#ifdef PROVIDE_FOREIGN
FOREIGN_REP = 'f', /* ForeignObj */
#endif
#ifdef PROVIDE_WEAK
WEAK_REP = 'w', /* Weak a */
#endif
-#ifdef PROVIDE_ARRAY
BARR_REP = 'x', /* PrimByteArray a */
MUTBARR_REP = 'm', /* PrimMutableByteArray s a */
-#endif
/* The following can't be passed to C */
PTR_REP = 'P',
IO_REP = 'i', /* IO a */
HANDLER_REP = 'H', /* Exception -> IO a */
ERROR_REP = 'E', /* Exception */
-#ifdef PROVIDE_ARRAY
ARR_REP = 'X', /* PrimArray a */
REF_REP = 'R', /* Ref s a */
MUTARR_REP = 'M', /* PrimMutableArray s a */
-#endif
#ifdef PROVIDE_CONCURRENT
THREADID_REP = 'T', /* ThreadId */
MVAR_REP = 'r', /* MVar a */
* Allocating (top level) heap objects
* ------------------------------------------------------------------------*/
-extern AsmBCO asmBeginBCO ( void );
+extern AsmBCO asmBeginBCO ( int /*StgExpr*/ e );
extern void asmEndBCO ( AsmBCO bco );
-extern AsmBCO asmBeginContinuation ( AsmSp sp );
+extern AsmBCO asmBeginContinuation ( AsmSp sp, int /*List*/ alts );
extern void asmEndContinuation ( AsmBCO bco );
extern AsmObject asmMkObject ( AsmClosure c );
extern AsmClosure asmClosureOfObject ( AsmObject obj );
extern void asmMarkObject ( AsmObject obj );
+extern int asmRepSizeW ( AsmRep rep );
+
/* --------------------------------------------------------------------------
* Generating instruction streams
* ------------------------------------------------------------------------*/
extern AsmSp asmBeginCase ( AsmBCO bco );
extern void asmEndCase ( AsmBCO bco );
extern AsmSp asmContinuation ( AsmBCO bco, AsmBCO ret_addr );
-
+
extern AsmSp asmBeginAlt ( AsmBCO bco );
extern void asmEndAlt ( AsmBCO bco, AsmSp sp );
extern AsmPc asmTest ( AsmBCO bco, AsmWord tag );
/* push unboxed Ints, Floats, etc */
extern void asmConstInt ( AsmBCO bco, AsmInt x );
-#ifdef PROVIDE_ADDR
extern void asmConstAddr ( AsmBCO bco, AsmAddr x );
-#endif
-#ifdef PROVIDE_WORD
extern void asmConstWord ( AsmBCO bco, AsmWord x );
-#endif
extern void asmConstChar ( AsmBCO bco, AsmChar x );
extern void asmConstFloat ( AsmBCO bco, AsmFloat x );
extern void asmConstDouble ( AsmBCO bco, AsmDouble x );
-#ifdef PROVIDE_INT64
-extern void asmConstInt64 ( AsmBCO bco, AsmInt64 x );
-#endif
-#ifdef PROVIDE_INTEGER
extern void asmConstInteger ( AsmBCO bco, AsmString x );
-#endif
/* Which monad (if any) does the primop live in? */
typedef enum {
extern AsmSp asmBeginPrim ( AsmBCO bco );
extern void asmEndPrim ( AsmBCO bco, const AsmPrim* prim, AsmSp base );
+extern AsmBCO asm_BCO_catch ( void );
+extern AsmBCO asm_BCO_raise ( void );
+extern AsmBCO asm_BCO_seq ( void );
+
+
/* --------------------------------------------------------------------------
* Heap manipulation
* ------------------------------------------------------------------------*/
extern AsmVar asmClosure ( AsmBCO bco, AsmObject p );
+extern AsmVar asmGHCClosure ( AsmBCO bco, AsmObject p );
extern AsmVar asmAllocCONSTR ( AsmBCO bco, AsmInfo info );
* C-call and H-call
* ------------------------------------------------------------------------*/
-extern const AsmPrim ccall_Id;
-extern const AsmPrim ccall_IO;
+extern const AsmPrim ccall_ccall_Id;
+extern const AsmPrim ccall_ccall_IO;
+extern const AsmPrim ccall_stdcall_Id;
+extern const AsmPrim ccall_stdcall_IO;
typedef struct {
- char * arg_tys;
- int arg_size;
- char * result_tys;
- int result_size;
+ unsigned int num_args;
+ char* arg_tys;
+ unsigned int num_results;
+ char* result_tys;
} CFunDescriptor;
-typedef struct {
- char * arg_tys;
- char * result_tys;
-} HFunDescriptor;
-
CFunDescriptor* mkDescriptor( char* as, char* rs );
/*-------------------------------------------------------------------------*/