@@ -74,8 +74,27 @@ primitives =
74 (2, LGt) total,
74 (2, LGt) total,
75 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
75 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
76 (2, LGe) total,
76 (2, LGe) total,
78+ Prim (UN "prim__addW8") (ty [W8Type, W8Type] W8Type) 2 (w8Bin (+))
80+ Prim (UN "prim__subW8") (ty [W8Type, W8Type] W8Type) 2 (w8Bin (-))
82+ Prim (UN "prim__mulW8") (ty [W8Type, W8Type] W8Type) 2 (w8Bin (*))
85+ Prim (UN "prim__addW16") (ty [W16Type, W16Type] W16Type) 2 (w16Bin (+))
87+ Prim (UN "prim__subW16") (ty [W16Type, W16Type] W16Type) 2 (w16Bin (-))
88+ (2, LW16Minus) total,
89+ Prim (UN "prim__mulW16") (ty [W16Type, W16Type] W16Type) 2 (w16Bin (*))
90+ (2, LW16Times) total,
92+ Prim (UN "prim__intToWord8") (ty [IType] W8Type) 1 intToWord8
94+ Prim (UN "prim__intToWord16") (ty [IType] W16Type) 1 intToWord16
77 Prim (UN "prim__addBigInt") (ty [BIType, BIType] BIType) 2 (bBin (+))
97 Prim (UN "prim__addBigInt") (ty [BIType, BIType] BIType) 2 (bBin (+))
79 (2, LBPlus) total,
98 (2, LBPlus) total,
80 Prim (UN "prim__subBigInt") (ty [BIType, BIType] BIType) 2 (bBin (-))
99 Prim (UN "prim__subBigInt") (ty [BIType, BIType] BIType) 2 (bBin (-))
81 (2, LBMinus) total,
100 (2, LBMinus) total,
@@ -226,6 +245,20 @@ bsBin _ _ = Nothing
226sBin op [VConstant (Str x), VConstant (Str y)] = Just $ VConstant (Str (op x y))
245sBin op [VConstant (Str x), VConstant (Str y)] = Just $ VConstant (Str (op x y))
227sBin _ _ = Nothing
246sBin _ _ = Nothing
248+w8Bin op [VConstant (W8 x), VConstant (W8 y)] = Just $ VConstant (W8 (op x y))
251+w16Bin op [VConstant (W16 x), VConstant (W16 y)] = Just $ VConstant (W16 (op x y))
254+w32Bin op [VConstant (W32 x), VConstant (W32 y)] = Just $ VConstant (W32 (op x y))
257+intToWord8 [VConstant (I x)] = Just $ VConstant (W8 $ fromIntegral x)
258+intToWord8 _ = Nothing
259+intToWord16 [VConstant (I x)] = Just $ VConstant (W16 $ fromIntegral x)
260+intToWord16 _ = Nothing
229c_intToStr [VConstant (I x)] = Just $ VConstant (Str (show x))
262c_intToStr [VConstant (I x)] = Just $ VConstant (Str (show x))
230c_intToStr _ = Nothing
263c_intToStr _ = Nothing
231c_strToInt [VConstant (Str x)] = case reads x of
264c_strToInt [VConstant (Str x)] = case reads x of