rESERVED_STACK_WORDS )
import CLabel ( mkIntlikeClosureLabel, mkCharlikeClosureLabel,
mkMAP_FROZEN_infoLabel, mkForeignLabel )
+import CallConv ( cCallConv )
import Outputable
import FastTypes
\begin{code}
-- NB: ordering of clauses somewhere driven by
-- the desire to getting sane patt-matching behavior
-primCode res@[sr,dr] IntegerNegOp arg@[sa,da]
- = gmpNegate (sr,dr) (sa,da)
-
primCode [res] IntegerCmpOp args@[sa1,da1, sa2,da2]
= gmpCompare res (sa1,da1, sa2,da2)
primCode [res] Word2IntOp [arg]
= simpleCoercion IntRep res arg
+
+primCode [res] AddrToHValueOp [arg]
+ = simpleCoercion PtrRep res arg
\end{code}
\begin{code}
ToDo: saving/restoring of volatile regs around ccalls.
+JRS, 001113: always do the call of suspendThread and resumeThread as a ccall
+rather than inheriting the calling convention of the thing which we're really
+calling.
+
\begin{code}
primCode lhs (CCallOp (CCall (StaticTarget fn) is_asm may_gc cconv)) rhs
| is_asm = error "ERROR: Native code generator can't handle casm"
id = StReg (StixTemp uniq IntRep)
suspend = StAssign IntRep id
- (StCall SLIT("suspendThread") cconv IntRep [stgBaseReg])
- resume = StCall SLIT("resumeThread") cconv VoidRep [id]
+ (StCall SLIT("suspendThread") {-no:cconv-} cCallConv
+ IntRep [stgBaseReg])
+ resume = StCall SLIT("resumeThread") {-no:cconv-} cCallConv
+ VoidRep [id]
in
returnUs (\xs -> save (suspend : ccall : resume : load xs))