[project @ 2000-08-21 13:34:44 by simonmar]
authorsimonmar <unknown>
Mon, 21 Aug 2000 13:34:44 +0000 (13:34 +0000)
committersimonmar <unknown>
Mon, 21 Aug 2000 13:34:44 +0000 (13:34 +0000)
Add touch# and foreignObjToAddr#.

ghc/compiler/nativeGen/StixPrim.lhs

index 6f5e37c..388bb86 100644 (file)
@@ -24,8 +24,6 @@ import CLabel         ( mkIntlikeClosureLabel, mkCharlikeClosureLabel,
                          mkMAP_FROZEN_infoLabel, mkForeignLabel )
 import Outputable
 
-import Char            ( ord, isAlpha, isDigit )
-
 #include "NCG.h"
 \end{code}
 
@@ -336,6 +334,19 @@ primCode [rr] ReadMutVarOp [aa]
      returnUs (\xs -> assign : xs)
 \end{code}
 
+ForeignObj# primops.
+
+\begin{code}
+primCode [rr] ForeignObjToAddrOp [fo]
+  = let code =  StAssign AddrRep (amodeToStix rr)
+                  (StInd AddrRep 
+                       (StIndex PtrRep (amodeToStix fo) fixedHS))
+    in
+    returnUs (\xs -> code : xs)
+
+primCode [] TouchOp [_] = returnUs id
+\end{code}
+
 Now the more mundane operations.
 
 \begin{code}