@@ -77,6 +77,16 @@ 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__ltB8") (ty [B8Type, B8Type] IType) 2 (b8Cmp (<))
82+ Prim (UN "prim__lteB8") (ty [B8Type, B8Type] IType) 2 (b8Cmp (<=))
84+ Prim (UN "prim__eqB8") (ty [B8Type, B8Type] IType) 2 (b8Cmp (==))
86+ Prim (UN "prim__gteB8") (ty [B8Type, B8Type] IType) 2 (b8Cmp (>))
88+ Prim (UN "prim__gtB8") (ty [B8Type, B8Type] IType) 2 (b8Cmp (>=))
80 Prim (UN "prim__b8ToStr") (ty [B8Type] StrType) 1 (b8ToStr)
90 Prim (UN "prim__b8ToStr") (ty [B8Type] StrType) 1 (b8ToStr)
81 (1, LB8Str) total,
91 (1, LB8Str) total,
82 Prim (UN "prim__addB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (+))
92 Prim (UN "prim__addB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (+))
@@ -116,6 +126,16 @@ primitives =
116 Prim (UN "prim__sextB8_64") (ty [B8Type] B64Type) 1 sext8_64
126 Prim (UN "prim__sextB8_64") (ty [B8Type] B64Type) 1 sext8_64
117 (1, LB8Z64) total,
127 (1, LB8Z64) total,
129+ Prim (UN "prim__ltB16") (ty [B16Type, B16Type] IType) 2 (b16Cmp (<))
131+ Prim (UN "prim__lteB16") (ty [B16Type, B16Type] IType) 2 (b16Cmp (<=))
133+ Prim (UN "prim__eqB16") (ty [B16Type, B16Type] IType) 2 (b16Cmp (==))
135+ Prim (UN "prim__gteB16") (ty [B16Type, B16Type] IType) 2 (b16Cmp (>))
137+ Prim (UN "prim__gtB16") (ty [B16Type, B16Type] IType) 2 (b16Cmp (>=))
119 Prim (UN "prim__b16ToStr") (ty [B16Type] StrType) 1 (b16ToStr)
139 Prim (UN "prim__b16ToStr") (ty [B16Type] StrType) 1 (b16ToStr)
120 (1, LB16Str) total,
140 (1, LB16Str) total,
121 Prim (UN "prim__addB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (+))
141 Prim (UN "prim__addB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (+))
@@ -153,6 +173,16 @@ primitives =
153 Prim (UN "prim__truncB16_8") (ty [B16Type] B8Type) 1 trunc16_8
173 Prim (UN "prim__truncB16_8") (ty [B16Type] B8Type) 1 trunc16_8
154 (1, LB16T8) total,
174 (1, LB16T8) total,
176+ Prim (UN "prim__ltB32") (ty [B32Type, B32Type] IType) 2 (b32Cmp (<))
178+ Prim (UN "prim__lteB32") (ty [B32Type, B32Type] IType) 2 (b32Cmp (<=))
180+ Prim (UN "prim__eqB32") (ty [B32Type, B32Type] IType) 2 (b32Cmp (==))
182+ Prim (UN "prim__gteB32") (ty [B32Type, B32Type] IType) 2 (b32Cmp (>))
184+ Prim (UN "prim__gtB32") (ty [B32Type, B32Type] IType) 2 (b32Cmp (>=))
156 Prim (UN "prim__b32ToStr") (ty [B32Type] StrType) 1 (b32ToStr)
186 Prim (UN "prim__b32ToStr") (ty [B32Type] StrType) 1 (b32ToStr)
157 (1, LB32Str) total,
187 (1, LB32Str) total,
158 Prim (UN "prim__addB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (+))
188 Prim (UN "prim__addB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (+))
@@ -188,6 +218,16 @@ primitives =
188 Prim (UN "prim__truncB32_16") (ty [B32Type] B16Type) 1 trunc32_16
218 Prim (UN "prim__truncB32_16") (ty [B32Type] B16Type) 1 trunc32_16
189 (1, LB32T16) total,
219 (1, LB32T16) total,
221+ Prim (UN "prim__ltB64") (ty [B64Type, B64Type] IType) 2 (b64Cmp (<))
223+ Prim (UN "prim__lteB64") (ty [B64Type, B64Type] IType) 2 (b64Cmp (<=))
225+ Prim (UN "prim__eqB64") (ty [B64Type, B64Type] IType) 2 (b64Cmp (==))
227+ Prim (UN "prim__gteB64") (ty [B64Type, B64Type] IType) 2 (b64Cmp (>))
229+ Prim (UN "prim__gtB64") (ty [B64Type, B64Type] IType) 2 (b64Cmp (>=))
191 Prim (UN "prim__b64ToStr") (ty [B64Type] StrType) 1 (b64ToStr)
231 Prim (UN "prim__b64ToStr") (ty [B64Type] StrType) 1 (b64ToStr)
192 (1, LB64Str) total,
232 (1, LB64Str) total,
193 Prim (UN "prim__addB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (+))
233 Prim (UN "prim__addB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (+))
@@ -419,6 +459,18 @@ b32Bin _ _ = Nothing
419b64Bin op [VConstant (B64 x), VConstant (B64 y)] = Just $ VConstant (B64 (op x y))
459b64Bin op [VConstant (B64 x), VConstant (B64 y)] = Just $ VConstant (B64 (op x y))
420b64Bin _ _ = Nothing
460b64Bin _ _ = Nothing
462+b8Cmp op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (I (if (op x y) then 1 else 0))
465+b16Cmp op [VConstant (B16 x), VConstant (B16 y)] = Just $ VConstant (I (if (op x y) then 1 else 0))
468+b32Cmp op [VConstant (B32 x), VConstant (B32 y)] = Just $ VConstant (I (if (op x y) then 1 else 0))
471+b64Cmp op [VConstant (B64 x), VConstant (B64 y)] = Just $ VConstant (I (if (op x y) then 1 else 0))
422toB8 x = VConstant (B8 (fromIntegral x))
474toB8 x = VConstant (B8 (fromIntegral x))
423toB16 x = VConstant (B16 (fromIntegral x))
475toB16 x = VConstant (B16 (fromIntegral x))
424toB32 x = VConstant (B32 (fromIntegral x))
476toB32 x = VConstant (B32 (fromIntegral x))