summaryrefslogtreecommitdiff
path: root/compiler/prelude/PrelRules.lhs
diff options
context:
space:
mode:
authorJan Stolarek <jan.stolarek@p.lodz.pl>2013-02-15 13:10:36 +0100
committerSimon Marlow <marlowsd@gmail.com>2013-02-18 09:37:49 +0000
commit29e86f9b178d3cf436629641ec1f2502c67f0347 (patch)
treecbc66f8bb4e25c803f2a48ced1a54eb8ea0ab063 /compiler/prelude/PrelRules.lhs
parent1bb33135e0f46369dd8ddbf8b71f87fc211511e8 (diff)
downloadhaskell-29e86f9b178d3cf436629641ec1f2502c67f0347.tar.gz
Primitive bitwise operations on Int# (Fixes #7689)
Diffstat (limited to 'compiler/prelude/PrelRules.lhs')
-rw-r--r--compiler/prelude/PrelRules.lhs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs
index 2e55e497d7..079ab0cc98 100644
--- a/compiler/prelude/PrelRules.lhs
+++ b/compiler/prelude/PrelRules.lhs
@@ -100,6 +100,15 @@ primOpRules nm IntRemOp = mkPrimOpRule nm 2 [ nonZeroLit 1 >> binaryLit (intO
retLit zeroi
, equalArgs >> retLit zeroi
, equalArgs >> retLit zeroi ]
+primOpRules nm AndIOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 (.&.))
+ , idempotent
+ , zeroElem zeroi ]
+primOpRules nm OrIOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 (.|.))
+ , idempotent
+ , identityDynFlags zeroi ]
+primOpRules nm XorIOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 xor)
+ , identityDynFlags zeroi
+ , equalArgs >> retLit zeroi ]
primOpRules nm IntNegOp = mkPrimOpRule nm 1 [ unaryLit negOp
, inversePrimOp IntNegOp ]
primOpRules nm ISllOp = mkPrimOpRule nm 2 [ binaryLit (intOp2 Bits.shiftL)