summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc/compiler/nativeGen/StixPrim.lhs26
-rw-r--r--ghc/includes/mkNativeHdr.c4
2 files changed, 22 insertions, 8 deletions
diff --git a/ghc/compiler/nativeGen/StixPrim.lhs b/ghc/compiler/nativeGen/StixPrim.lhs
index e7909b8277..c70a2373e6 100644
--- a/ghc/compiler/nativeGen/StixPrim.lhs
+++ b/ghc/compiler/nativeGen/StixPrim.lhs
@@ -295,13 +295,25 @@ load_thread_state
])
: StAssignReg PtrRep
stgHpLim
- (StMachOp MO_Nat_Add
- [StInd PtrRep
- (StMachOp MO_Nat_Add
- [StReg stgCurrentNursery,
- StInt (toInteger (BDESCR_START * BYTES_PER_WORD))]),
- StInt (toInteger (bLOCK_SIZE - (1 * BYTES_PER_WORD)))
- ])
+ (StIndex Word8Rep
+ (StInd PtrRep
+ (StIndex PtrRep (StReg stgCurrentNursery)
+ (StInt (toInteger BDESCR_START))
+ )
+ )
+ (StMachOp MO_Nat_Sub
+ [StMachOp MO_NatU_Mul
+ [StInd WordRep
+ (StIndex PtrRep (StReg stgCurrentNursery)
+ (StInt (toInteger BDESCR_BLOCKS))),
+ StInt (toInteger bLOCK_SIZE{-in bytes-})
+ ],
+ StInt (1 * BYTES_PER_WORD)
+ ]
+ )
+
+ )
+
: xs
)
\end{code}
diff --git a/ghc/includes/mkNativeHdr.c b/ghc/includes/mkNativeHdr.c
index b1500d5397..ebc951fbf7 100644
--- a/ghc/includes/mkNativeHdr.c
+++ b/ghc/includes/mkNativeHdr.c
@@ -1,5 +1,5 @@
/* --------------------------------------------------------------------------
- * $Id: mkNativeHdr.c,v 1.7 2001/12/12 18:12:46 sewardj Exp $
+ * $Id: mkNativeHdr.c,v 1.8 2002/01/08 10:36:24 sewardj Exp $
*
* (c) The GHC Team, 1992-1998
*
@@ -52,6 +52,7 @@
#define BDESCR_START OFFSET(bd, bd.start)
#define BDESCR_FREE OFFSET(bd, bd.free)
+#define BDESCR_BLOCKS OFFSET(bd, bd.blocks)
StgRegTable RegTable;
@@ -116,6 +117,7 @@ main()
printf("#define BDESCR_START %d\n", BDESCR_START);
printf("#define BDESCR_FREE %d\n", BDESCR_FREE);
+ printf("#define BDESCR_BLOCKS %d\n", BDESCR_BLOCKS);
printf("\n-- FILE size for the Native Code Generator\n");