@@ -74,8 +74,27 @@ primitives =
7474 (2, LGt) total,
7575 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
7676 (2, LGe) total,
77+
78+ Prim (UN "prim__addW8") (ty [W8Type, W8Type] W8Type) 2 (w8Bin (+))
79+ (2, LW8Plus) total,
80+ Prim (UN "prim__subW8") (ty [W8Type, W8Type] W8Type) 2 (w8Bin (-))
81+ (2, LW8Minus) total,
82+ Prim (UN "prim__mulW8") (ty [W8Type, W8Type] W8Type) 2 (w8Bin (*))
83+ (2, LW8Times) total,
84+
85+ Prim (UN "prim__addW16") (ty [W16Type, W16Type] W16Type) 2 (w16Bin (+))
86+ (2, LW16Plus) total,
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,
91+
92+ Prim (UN "prim__intToWord8") (ty [IType] W8Type) 1 intToWord8
93+ (1, LW8) total,
94+ Prim (UN "prim__intToWord16") (ty [IType] W16Type) 1 intToWord16
95+ (1, LW16) total,
96+
7797 Prim (UN "prim__addBigInt") (ty [BIType, BIType] BIType) 2 (bBin (+))
78−
7998 (2, LBPlus) total,
8099 Prim (UN "prim__subBigInt") (ty [BIType, BIType] BIType) 2 (bBin (-))
81100 (2, LBMinus) total,
@@ -226,6 +245,20 @@ bsBin _ _ = Nothing
226245sBin op [VConstant (Str x), VConstant (Str y)] = Just $ VConstant (Str (op x y))
227246sBin _ _ = Nothing
228247
248+w8Bin op [VConstant (W8 x), VConstant (W8 y)] = Just $ VConstant (W8 (op x y))
249+w8Bin _ _ = Nothing
250+
251+w16Bin op [VConstant (W16 x), VConstant (W16 y)] = Just $ VConstant (W16 (op x y))
252+w16Bin _ _ = Nothing
253+
254+w32Bin op [VConstant (W32 x), VConstant (W32 y)] = Just $ VConstant (W32 (op x y))
255+w32Bin _ _ = Nothing
256+
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
261+
229262c_intToStr [VConstant (I x)] = Just $ VConstant (Str (show x))
230263c_intToStr _ = Nothing
231264c_strToInt [VConstant (Str x)] = case reads x of