@@ -77,6 +77,8 @@ primitives =
77 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
77 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
78 (2, LGe) total,
78 (2, LGe) total,
80+ Prim (UN "prim__b8ToStr") (ty [B8Type] StrType) 1 (b8ToStr)
80 Prim (UN "prim__addB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (+))
82 Prim (UN "prim__addB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (+))
81 (2, LB8Plus) total,
83 (2, LB8Plus) total,
82 Prim (UN "prim__subB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (-))
84 Prim (UN "prim__subB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (-))
@@ -100,6 +102,8 @@ primitives =
100 Prim (UN "prim__sextB8_64") (ty [B8Type] B64Type) 1 sext8_64
102 Prim (UN "prim__sextB8_64") (ty [B8Type] B64Type) 1 sext8_64
101 (1, LB8Z64) total,
103 (1, LB8Z64) total,
105+ Prim (UN "prim__b16ToStr") (ty [B16Type] StrType) 1 (b16ToStr)
103 Prim (UN "prim__addB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (+))
107 Prim (UN "prim__addB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (+))
104 (2, LB16Plus) total,
108 (2, LB16Plus) total,
105 Prim (UN "prim__subB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (-))
109 Prim (UN "prim__subB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (-))
@@ -121,6 +125,8 @@ primitives =
121 Prim (UN "prim__truncB16_8") (ty [B16Type] B8Type) 1 trunc16_8
125 Prim (UN "prim__truncB16_8") (ty [B16Type] B8Type) 1 trunc16_8
122 (1, LB16T8) total,
126 (1, LB16T8) total,
128+ Prim (UN "prim__b32ToStr") (ty [B32Type] StrType) 1 (b32ToStr)
124 Prim (UN "prim__addB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (+))
130 Prim (UN "prim__addB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (+))
125 (2, LB32Plus) total,
131 (2, LB32Plus) total,
126 Prim (UN "prim__subB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (-))
132 Prim (UN "prim__subB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (-))
@@ -140,6 +146,8 @@ primitives =
140 Prim (UN "prim__truncB32_16") (ty [B32Type] B16Type) 1 trunc32_16
146 Prim (UN "prim__truncB32_16") (ty [B32Type] B16Type) 1 trunc32_16
141 (1, LB32T16) total,
147 (1, LB32T16) total,
149+ Prim (UN "prim__b64ToStr") (ty [B64Type] StrType) 1 (b64ToStr)
143 Prim (UN "prim__addB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (+))
151 Prim (UN "prim__addB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (+))
144 (2, LB64Plus) total,
152 (2, LB64Plus) total,
145 Prim (UN "prim__subB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (-))
153 Prim (UN "prim__subB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (-))
@@ -331,6 +339,18 @@ s32div x y = fromIntegral (fromIntegral x `div` fromIntegral y :: Int32)
331s64div :: Word64 -> Word64 -> Word64
339s64div :: Word64 -> Word64 -> Word64
332s64div x y = fromIntegral (fromIntegral x `div` fromIntegral y :: Int64)
340s64div x y = fromIntegral (fromIntegral x `div` fromIntegral y :: Int64)
342+b8ToStr [VConstant (B8 x)] = Just $ VConstant (Str (show x))
345+b16ToStr [VConstant (B16 x)] = Just $ VConstant (Str (show x))
348+b32ToStr [VConstant (B32 x)] = Just $ VConstant (Str (show x))
351+b64ToStr [VConstant (B64 x)] = Just $ VConstant (Str (show x))
334b8Bin op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (B8 (op x y))
354b8Bin op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (B8 (op x y))
335b8Bin _ _ = Nothing
355b8Bin _ _ = Nothing