projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2003-10-29 18:10:25 by simonpj]
[ghc-hetmet.git]
/
ghc
/
compiler
/
absCSyn
/
AbsCUtils.lhs
diff --git
a/ghc/compiler/absCSyn/AbsCUtils.lhs
b/ghc/compiler/absCSyn/AbsCUtils.lhs
index
893f88a
..
24067c0
100644
(file)
--- a/
ghc/compiler/absCSyn/AbsCUtils.lhs
+++ b/
ghc/compiler/absCSyn/AbsCUtils.lhs
@@
-31,8
+31,7
@@
import Unique ( Unique{-instance Eq-} )
import UniqSupply ( uniqFromSupply, uniqsFromSupply, splitUniqSupply,
UniqSupply )
import CmdLineOpts ( opt_EmitCExternDecls, opt_Unregisterised )
import UniqSupply ( uniqFromSupply, uniqsFromSupply, splitUniqSupply,
UniqSupply )
import CmdLineOpts ( opt_EmitCExternDecls, opt_Unregisterised )
-import ForeignCall ( ForeignCall(..), CCallSpec(..),
- isDynamicTarget, isCasmTarget )
+import ForeignCall ( ForeignCall(..), CCallSpec(..), isDynamicTarget )
import StgSyn ( StgOp(..) )
import CoreSyn ( AltCon(..) )
import SMRep ( arrPtrsHdrSize, arrWordsHdrSize, fixedHdrSize )
import StgSyn ( StgOp(..) )
import CoreSyn ( AltCon(..) )
import SMRep ( arrPtrsHdrSize, arrWordsHdrSize, fixedHdrSize )
@@
-343,8
+342,8
@@
flatAbsC (CSwitch discrim alts deflt)
returnFlt ( (tag, alt_heres), alt_tops )
flatAbsC stmt@(COpStmt results (StgFCallOp (CCall ccall@(CCallSpec target _ _)) uniq) args _)
returnFlt ( (tag, alt_heres), alt_tops )
flatAbsC stmt@(COpStmt results (StgFCallOp (CCall ccall@(CCallSpec target _ _)) uniq) args _)
- | is_dynamic -- Emit a typedef if its a dynamic call
- || (opt_EmitCExternDecls && not (isCasmTarget target)) -- or we want extern decls
+ | is_dynamic -- Emit a typedef if its a dynamic call
+ || (opt_EmitCExternDecls) -- or we want extern decls
= returnFlt (stmt, CCallTypedef is_dynamic ccall uniq results args)
where
is_dynamic = isDynamicTarget target
= returnFlt (stmt, CCallTypedef is_dynamic ccall uniq results args)
where
is_dynamic = isDynamicTarget target
@@
-424,13
+423,6
@@
flatAbsC stmt@(CRetVector _ _ _ _) = returnFlt (AbsCNop, stmt)
flatAbsC stmt@(CModuleInitBlock _ _ _) = returnFlt (AbsCNop, stmt)
\end{code}
flatAbsC stmt@(CModuleInitBlock _ _ _) = returnFlt (AbsCNop, stmt)
\end{code}
-\begin{code}
-flat_maybe :: Maybe AbstractC -> FlatM (Maybe AbstractC, AbstractC)
-flat_maybe Nothing = returnFlt (Nothing, AbsCNop)
-flat_maybe (Just abs_c) = flatAbsC abs_c `thenFlt` \ (heres, tops) ->
- returnFlt (Just heres, tops)
-\end{code}
-
%************************************************************************
%* *
\subsection[flat-simultaneous]{Doing things simultaneously}
%************************************************************************
%* *
\subsection[flat-simultaneous]{Doing things simultaneously}
@@
-607,6
+599,7
@@
mkHalfWord_HIADDR res arg
let
hw_shift = mkIntCLit (wORD_SIZE_IN_BITS `quot` 2)
let
hw_shift = mkIntCLit (wORD_SIZE_IN_BITS `quot` 2)
+# if WORDS_BIGENDIAN
a_hw_mask1
= CMachOpStmt t_hw_mask1
MO_Nat_Shl [CLit (mkMachWord 1), hw_shift] Nothing
a_hw_mask1
= CMachOpStmt t_hw_mask1
MO_Nat_Shl [CLit (mkMachWord 1), hw_shift] Nothing
@@
-614,12
+607,11
@@
mkHalfWord_HIADDR res arg
= CMachOpStmt t_hw_mask2
MO_Nat_Sub [t_hw_mask1, CLit (mkMachWord 1)] Nothing
final
= CMachOpStmt t_hw_mask2
MO_Nat_Sub [t_hw_mask1, CLit (mkMachWord 1)] Nothing
final
-# if WORDS_BIGENDIAN
= CSequential [ a_hw_mask1, a_hw_mask2,
CMachOpStmt res MO_Nat_And [arg, t_hw_mask2] Nothing
]
# else
= CSequential [ a_hw_mask1, a_hw_mask2,
CMachOpStmt res MO_Nat_And [arg, t_hw_mask2] Nothing
]
# else
- = CMachOpStmt res MO_Nat_Shr [arg, hw_shift] Nothing
+ final = CMachOpStmt res MO_Nat_Shr [arg, hw_shift] Nothing
# endif
in
returnFlt final
# endif
in
returnFlt final
@@
-664,7
+656,7
@@
mk_OSBI_ref offw rep base idx
doIndexOffForeignObjOp maybe_post_read_cast rep res addr idx
doIndexOffForeignObjOp maybe_post_read_cast rep res addr idx
- = mkBasicIndexedRead fixedHdrSize maybe_post_read_cast rep res addr idx
+ = mkBasicIndexedRead 0 maybe_post_read_cast rep res (mkDerefOff WordRep addr fixedHdrSize) idx
doIndexOffAddrOp maybe_post_read_cast rep res addr idx
= mkBasicIndexedRead 0 maybe_post_read_cast rep res addr idx
doIndexOffAddrOp maybe_post_read_cast rep res addr idx
= mkBasicIndexedRead 0 maybe_post_read_cast rep res addr idx