diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2011-07-07 20:48:48 -0400 |
---|---|---|
committer | Edward Z. Yang <ezyang@mit.edu> | 2011-07-07 20:49:13 -0400 |
commit | 82c9f3f0f42e917b113d2174f468e86074b895cc (patch) | |
tree | 741b139aa98b301195f51c54aab9c1534ccfb8bd /compiler/codeGen/StgCmmPrim.hs | |
parent | dd391759500ab2b6abd23d502ade7ff8946c780f (diff) | |
download | haskell-82c9f3f0f42e917b113d2174f468e86074b895cc.tar.gz |
Port 'Add two new primops seq# and spark#' (be54417) to new codegen.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'compiler/codeGen/StgCmmPrim.hs')
-rw-r--r-- | compiler/codeGen/StgCmmPrim.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs index 1a6d05e6e6..c71d285735 100644 --- a/compiler/codeGen/StgCmmPrim.hs +++ b/compiler/codeGen/StgCmmPrim.hs @@ -210,6 +210,18 @@ emitPrimOp [res] ParOp [arg] (CmmLit (CmmLabel (mkCmmCodeLabel rtsPackageId (fsLit "newSpark")))) [(CmmReg (CmmGlobal BaseReg), AddrHint), (arg,AddrHint)] +emitPrimOp [res] SparkOp [arg] + = do + -- returns the value of arg in res. We're going to therefore + -- refer to arg twice (once to pass to newSpark(), and once to + -- assign to res), so put it in a temporary. + tmp <- assignTemp arg + emitCCall + [] + (CmmLit (CmmLabel (mkCmmCodeLabel rtsPackageId (fsLit "newSpark")))) + [(CmmReg (CmmGlobal BaseReg), AddrHint), ((CmmReg (CmmLocal tmp)), AddrHint)] + emit (mkAssign (CmmLocal res) (CmmReg (CmmLocal tmp))) + emitPrimOp [res] ReadMutVarOp [mutv] = emit (mkAssign (CmmLocal res) (cmmLoadIndexW mutv fixedHdrSize gcWord)) |