diff options
author | Ian Lynagh <igloo@earth.li> | 2012-02-17 22:46:27 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-02-17 22:46:27 +0000 |
commit | 7a7f6d703a99045cb9f590c819b795409a090022 (patch) | |
tree | 6b41f4ed5985331007c6d2399845d0ca9930b3da /compiler/codeGen | |
parent | efd78ac548614532d82f6eddf8759632909f677d (diff) | |
download | haskell-7a7f6d703a99045cb9f590c819b795409a090022.tar.gz |
Add a primop for unsigned quotRem; part of #5598
Only amd64 has an efficient implementation currently.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/CgPrimOp.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/codeGen/CgPrimOp.hs b/compiler/codeGen/CgPrimOp.hs index f169c0ce38..9ec99bf4f8 100644 --- a/compiler/codeGen/CgPrimOp.hs +++ b/compiler/codeGen/CgPrimOp.hs @@ -448,6 +448,14 @@ emitPrimOp [res_q, res_r] IntQuotRemOp [arg_x, arg_y] _ CmmHinted arg_y NoHint] CmmMayReturn in stmtC stmt +emitPrimOp [res_q, res_r] WordQuotRemOp [arg_x, arg_y] _ + = let stmt = CmmCall (CmmPrim (MO_U_QuotRem wordWidth)) + [CmmHinted res_q NoHint, + CmmHinted res_r NoHint] + [CmmHinted arg_x NoHint, + CmmHinted arg_y NoHint] + CmmMayReturn + in stmtC stmt emitPrimOp _ op _ _ = pprPanic "emitPrimOp: can't translate PrimOp" (ppr op) |