From b19cd2efd159e3dac6cb113f2c81d718853cdccb Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 21 Aug 2000 13:34:44 +0000 Subject: [PATCH] [project @ 2000-08-21 13:34:44 by simonmar] Add touch# and foreignObjToAddr#. --- ghc/compiler/nativeGen/StixPrim.lhs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/nativeGen/StixPrim.lhs b/ghc/compiler/nativeGen/StixPrim.lhs index 6f5e37c..388bb86 100644 --- a/ghc/compiler/nativeGen/StixPrim.lhs +++ b/ghc/compiler/nativeGen/StixPrim.lhs @@ -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} -- 1.7.10.4