summaryrefslogtreecommitdiff
path: root/compiler/prelude/primops.txt.pp
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-02-14 21:26:18 +0000
committerIan Lynagh <igloo@earth.li>2012-02-14 23:08:26 +0000
commit7bfb7bfc6da981ef827b1a166c8cbfb5b29a25a4 (patch)
tree64f62969824858ce141d89bc52ffc7e71ed236f9 /compiler/prelude/primops.txt.pp
parent8c0196b48d043fe16eb5b2d343f5544b7fdd5004 (diff)
downloadhaskell-7bfb7bfc6da981ef827b1a166c8cbfb5b29a25a4.tar.gz
Define a quotRem CallishMachOp; fixes #5598
This means we no longer do a division twice when we are using quotRem (on platforms on which the op is supported; currently only amd64).
Diffstat (limited to 'compiler/prelude/primops.txt.pp')
-rw-r--r--compiler/prelude/primops.txt.pp5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index 48dd76873a..183bd35db4 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -210,6 +210,11 @@ primop IntRemOp "remInt#" Dyadic
{Satisfies \texttt{(quotInt\# x y) *\# y +\# (remInt\# x y) == x}.}
with can_fail = True
+primop IntQuotRemOp "quotRemInt#" GenPrimOp
+ Int# -> Int# -> (# Int#, Int# #)
+ {Rounds towards zero.}
+ with can_fail = True
+
primop IntNegOp "negateInt#" Monadic Int# -> Int#
primop IntAddCOp "addIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
{Add with carry. First member of result is (wrapped) sum;