@@ -38,14 +38,22 @@ primitives =
3838 (2, LMinus) total,
3939 Prim (UN "prim__mulInt") (ty [IType, IType] IType) 2 (iBin (*))
4040 (2, LTimes) total,
41− Prim (UN "prim__divInt") (ty [IType, IType] IType) 2 (iBin (div))
41+ Prim (UN "prim__divInt") (ty [IType, IType] IType) 2 (iBin div)
4242 (2, LDiv) partial,
43− Prim (UN "prim__modInt") (ty [IType, IType] IType) 2 (iBin (mod))
43+ Prim (UN "prim__modInt") (ty [IType, IType] IType) 2 (iBin mod)
4444 (2, LMod) partial,
4545 Prim (UN "prim__andInt") (ty [IType, IType] IType) 2 (iBin (.&.))
4646 (2, LAnd) partial,
4747 Prim (UN "prim__orInt") (ty [IType, IType] IType) 2 (iBin (.|.))
4848 (2, LOr) partial,
49+ Prim (UN "prim__xorInt") (ty [IType, IType] IType) 2 (iBin xor)
50+ (2, LXOr) partial,
51+ Prim (UN "prim__shLInt") (ty [IType, IType] IType) 2 (iBin shiftL)
52+ (2, LSHL) partial,
53+ Prim (UN "prim__shRInt") (ty [IType, IType] IType) 2 (iBin shiftR)
54+ (2, LSHR) partial,
55+ Prim (UN "prim__complInt") (ty [IType] IType) 1 (iUn complement)
56+ (1, LCompl) partial,
4957 Prim (UN "prim__eqInt") (ty [IType, IType] IType) 2 (biBin (==))
5058 (2, LEq) total,
5159 Prim (UN "prim__ltInt") (ty [IType, IType] IType) 2 (biBin (<))
@@ -73,9 +81,9 @@ primitives =
7381 (2, LBMinus) total,
7482 Prim (UN "prim__mulBigInt") (ty [BIType, BIType] BIType) 2 (bBin (*))
7583 (2, LBTimes) total,
76− Prim (UN "prim__divBigInt") (ty [BIType, BIType] BIType) 2 (bBin (div))
84+ Prim (UN "prim__divBigInt") (ty [BIType, BIType] BIType) 2 (bBin div)
7785 (2, LBDiv) partial,
78− Prim (UN "prim__modBigInt") (ty [BIType, BIType] BIType) 2 (bBin (mod))
86+ Prim (UN "prim__modBigInt") (ty [BIType, BIType] BIType) 2 (bBin mod)
7987 (2, LBMod) partial,
8088 Prim (UN "prim__eqBigInt") (ty [BIType, BIType] IType) 2 (bbBin (==))
8189 (2, LBEq) total,
@@ -184,6 +192,9 @@ primitives =
184192p_believeMe [_,_,x] = Just x
185193p_believeMe _ = Nothing
186194
195+iUn op [VConstant (I x)] = Just $ VConstant (I (op x))
196+iUn _ _ = Nothing
197+
187198iBin op [VConstant (I x), VConstant (I y)] = Just $ VConstant (I (op x y))
188199iBin _ _ = Nothing
189200