@@ -38,14 +38,22 @@ primitives =
38 (2, LMinus) total,
38 (2, LMinus) total,
39 Prim (UN "prim__mulInt") (ty [IType, IType] IType) 2 (iBin (*))
39 Prim (UN "prim__mulInt") (ty [IType, IType] IType) 2 (iBin (*))
40 (2, LTimes) total,
40 (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)
42 (2, LDiv) partial,
42 (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)
44 (2, LMod) partial,
44 (2, LMod) partial,
45 Prim (UN "prim__andInt") (ty [IType, IType] IType) 2 (iBin (.&.))
45 Prim (UN "prim__andInt") (ty [IType, IType] IType) 2 (iBin (.&.))
46 (2, LAnd) partial,
46 (2, LAnd) partial,
47 Prim (UN "prim__orInt") (ty [IType, IType] IType) 2 (iBin (.|.))
47 Prim (UN "prim__orInt") (ty [IType, IType] IType) 2 (iBin (.|.))
48 (2, LOr) partial,
48 (2, LOr) partial,
49+ Prim (UN "prim__xorInt") (ty [IType, IType] IType) 2 (iBin xor)
51+ Prim (UN "prim__shLInt") (ty [IType, IType] IType) 2 (iBin shiftL)
53+ Prim (UN "prim__shRInt") (ty [IType, IType] IType) 2 (iBin shiftR)
55+ Prim (UN "prim__complInt") (ty [IType] IType) 1 (iUn complement)
49 Prim (UN "prim__eqInt") (ty [IType, IType] IType) 2 (biBin (==))
57 Prim (UN "prim__eqInt") (ty [IType, IType] IType) 2 (biBin (==))
50 (2, LEq) total,
58 (2, LEq) total,
51 Prim (UN "prim__ltInt") (ty [IType, IType] IType) 2 (biBin (<))
59 Prim (UN "prim__ltInt") (ty [IType, IType] IType) 2 (biBin (<))
@@ -73,9 +81,9 @@ primitives =
73 (2, LBMinus) total,
81 (2, LBMinus) total,
74 Prim (UN "prim__mulBigInt") (ty [BIType, BIType] BIType) 2 (bBin (*))
82 Prim (UN "prim__mulBigInt") (ty [BIType, BIType] BIType) 2 (bBin (*))
75 (2, LBTimes) total,
83 (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)
77 (2, LBDiv) partial,
85 (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)
79 (2, LBMod) partial,
87 (2, LBMod) partial,
80 Prim (UN "prim__eqBigInt") (ty [BIType, BIType] IType) 2 (bbBin (==))
88 Prim (UN "prim__eqBigInt") (ty [BIType, BIType] IType) 2 (bbBin (==))
81 (2, LBEq) total,
89 (2, LBEq) total,
@@ -184,6 +192,9 @@ primitives =
184p_believeMe [_,_,x] = Just x
192p_believeMe [_,_,x] = Just x
185p_believeMe _ = Nothing
193p_believeMe _ = Nothing
195+iUn op [VConstant (I x)] = Just $ VConstant (I (op x))
187iBin op [VConstant (I x), VConstant (I y)] = Just $ VConstant (I (op x y))
198iBin op [VConstant (I x), VConstant (I y)] = Just $ VConstant (I (op x y))
188iBin _ _ = Nothing
199iBin _ _ = Nothing