[project @ 2004-08-13 10:45:16 by simonmar]
[ghc-hetmet.git] / ghc / includes / StgMacros.h
index 8ac041a..bb1fcf6 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.55 2003/07/31 10:07:02 simonmar Exp $
+ * $Id: StgMacros.h,v 1.57 2003/11/12 17:27:04 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -447,6 +447,11 @@ EXTFUN_RTS(stg_gen_block);
 // 
 // This looks like it can't work - we're overwriting the contents of
 // the THUNK with slop!  Perhaps this never worked??? --SDM
+// The problem is that with eager-black-holing we currently perform
+// the black-holing operation at the *beginning* of the basic block,
+// when we still need the contents of the thunk.
+// Perhaps the thing to do is to overwrite it at the *end* of the
+// basic block, when we've already sucked out the thunk's contents? -- SLPJ
 //
 // Todo: maybe use SET_HDR() and remove LDV_recordCreate()?
 // 
@@ -478,24 +483,24 @@ EXTFUN_RTS(stg_gen_block);
               guaranteed to be StgWord aligned.
    -------------------------------------------------------------------------- */
 
-static inline void       ASSIGN_FLT (W_ [], StgFloat);
-static inline StgFloat    PK_FLT     (W_ []);
+INLINE_HEADER void       ASSIGN_FLT (W_ [], StgFloat);
+INLINE_HEADER StgFloat    PK_FLT     (W_ []);
 
 #if ALIGNMENT_FLOAT <= ALIGNMENT_LONG
 
-static inline void     ASSIGN_FLT(W_ p_dest[], StgFloat src) { *(StgFloat *)p_dest = src; }
-static inline StgFloat PK_FLT    (W_ p_src[])                { return *(StgFloat *)p_src; }
+INLINE_HEADER void     ASSIGN_FLT(W_ p_dest[], StgFloat src) { *(StgFloat *)p_dest = src; }
+INLINE_HEADER StgFloat PK_FLT    (W_ p_src[])                { return *(StgFloat *)p_src; }
 
 #else  /* ALIGNMENT_FLOAT > ALIGNMENT_UNSIGNED_INT */
 
-static inline void ASSIGN_FLT(W_ p_dest[], StgFloat src)
+INLINE_HEADER void ASSIGN_FLT(W_ p_dest[], StgFloat src)
 {
     float_thing y;
     y.f = src;
     *p_dest = y.fu;
 }
 
-static inline StgFloat PK_FLT(W_ p_src[])
+INLINE_HEADER StgFloat PK_FLT(W_ p_src[])
 {
     float_thing y;
     y.fu = *p_src;
@@ -506,11 +511,11 @@ static inline StgFloat PK_FLT(W_ p_src[])
 
 #if ALIGNMENT_DOUBLE <= ALIGNMENT_LONG
 
-static inline void       ASSIGN_DBL (W_ [], StgDouble);
-static inline StgDouble   PK_DBL     (W_ []);
+INLINE_HEADER void       ASSIGN_DBL (W_ [], StgDouble);
+INLINE_HEADER StgDouble   PK_DBL     (W_ []);
 
-static inline void      ASSIGN_DBL(W_ p_dest[], StgDouble src) { *(StgDouble *)p_dest = src; }
-static inline StgDouble PK_DBL    (W_ p_src[])                 { return *(StgDouble *)p_src; }
+INLINE_HEADER void      ASSIGN_DBL(W_ p_dest[], StgDouble src) { *(StgDouble *)p_dest = src; }
+INLINE_HEADER StgDouble PK_DBL    (W_ p_src[])                 { return *(StgDouble *)p_src; }
 
 #else  /* ALIGNMENT_DOUBLE > ALIGNMENT_LONG */
 
@@ -536,8 +541,8 @@ static inline StgDouble PK_DBL    (W_ p_src[])                 { return *(StgDou
 
 #else /* ! sparc_TARGET_ARCH */
 
-static inline void       ASSIGN_DBL (W_ [], StgDouble);
-static inline StgDouble   PK_DBL     (W_ []);
+INLINE_HEADER void       ASSIGN_DBL (W_ [], StgDouble);
+INLINE_HEADER StgDouble   PK_DBL     (W_ []);
 
 typedef struct
   { StgWord dhi;
@@ -549,7 +554,7 @@ typedef union
     unpacked_double du;
   } double_thing;
 
-static inline void ASSIGN_DBL(W_ p_dest[], StgDouble src)
+INLINE_HEADER void ASSIGN_DBL(W_ p_dest[], StgDouble src)
 {
     double_thing y;
     y.d = src;
@@ -565,7 +570,7 @@ static inline void ASSIGN_DBL(W_ p_dest[], StgDouble src)
        *(p_dest+1) = ((double_thing) src).du.dlo \
 */
 
-static inline StgDouble PK_DBL(W_ p_src[])
+INLINE_HEADER StgDouble PK_DBL(W_ p_src[])
 {
     double_thing y;
     y.du.dhi = p_src[0];
@@ -594,7 +599,7 @@ typedef union
     unpacked_double_word wu;
   } word64_thing;
 
-static inline void ASSIGN_Word64(W_ p_dest[], StgWord64 src)
+INLINE_HEADER void ASSIGN_Word64(W_ p_dest[], StgWord64 src)
 {
     word64_thing y;
     y.w = src;
@@ -602,7 +607,7 @@ static inline void ASSIGN_Word64(W_ p_dest[], StgWord64 src)
     p_dest[1] = y.wu.dlo;
 }
 
-static inline StgWord64 PK_Word64(W_ p_src[])
+INLINE_HEADER StgWord64 PK_Word64(W_ p_src[])
 {
     word64_thing y;
     y.wu.dhi = p_src[0];
@@ -610,7 +615,7 @@ static inline StgWord64 PK_Word64(W_ p_src[])
     return(y.w);
 }
 
-static inline void ASSIGN_Int64(W_ p_dest[], StgInt64 src)
+INLINE_HEADER void ASSIGN_Int64(W_ p_dest[], StgInt64 src)
 {
     int64_thing y;
     y.i = src;
@@ -618,7 +623,7 @@ static inline void ASSIGN_Int64(W_ p_dest[], StgInt64 src)
     p_dest[1] = y.iu.dlo;
 }
 
-static inline StgInt64 PK_Int64(W_ p_src[])
+INLINE_HEADER StgInt64 PK_Int64(W_ p_src[])
 {
     int64_thing y;
     y.iu.dhi = p_src[0];
@@ -628,22 +633,22 @@ static inline StgInt64 PK_Int64(W_ p_src[])
 
 #elif SIZEOF_VOID_P == 8
 
-static inline void ASSIGN_Word64(W_ p_dest[], StgWord64 src)
+INLINE_HEADER void ASSIGN_Word64(W_ p_dest[], StgWord64 src)
 {
        p_dest[0] = src;
 }
 
-static inline StgWord64 PK_Word64(W_ p_src[])
+INLINE_HEADER StgWord64 PK_Word64(W_ p_src[])
 {
     return p_src[0];
 }
 
-static inline void ASSIGN_Int64(W_ p_dest[], StgInt64 src)
+INLINE_HEADER void ASSIGN_Int64(W_ p_dest[], StgInt64 src)
 {
     p_dest[0] = src;
 }
 
-static inline StgInt64 PK_Int64(W_ p_src[])
+INLINE_HEADER StgInt64 PK_Int64(W_ p_src[])
 {
     return p_src[0];
 }
@@ -705,7 +710,7 @@ extern DLL_IMPORT_RTS const StgPolyInfoTable stg_catch_frame_info;
 
 #if IN_STG_CODE
 
-static __inline__ void
+INLINE_HEADER void
 SaveThreadState(void)
 {
   StgTSO *tso;
@@ -727,7 +732,7 @@ SaveThreadState(void)
 #endif
 }
 
-static __inline__ void 
+INLINE_HEADER void 
 LoadThreadState (void)
 {
   StgTSO *tso;