@@ -113,6 +113,8 @@ primitives =
113 (2, LB8Or) total,
113 (2, LB8Or) total,
114 Prim (UN "prim__xorB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin xor)
114 Prim (UN "prim__xorB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin xor)
115 (2, LB8Xor) total,
115 (2, LB8Xor) total,
116+ Prim (UN "prim__complB8") (ty [B8Type] B8Type) 1 (b8Un complement)
117+ (1, LB8Compl) total,
116 Prim (UN "prim__zextB8_16") (ty [B8Type] B16Type) 1 zext8_16
118 Prim (UN "prim__zextB8_16") (ty [B8Type] B16Type) 1 zext8_16
117 (1, LB8Z16) total,
119 (1, LB8Z16) total,
118 Prim (UN "prim__zextB8_32") (ty [B8Type] B32Type) 1 zext8_32
120 Prim (UN "prim__zextB8_32") (ty [B8Type] B32Type) 1 zext8_32
@@ -162,6 +164,8 @@ primitives =
162 (2, LB16Or) total,
164 (2, LB16Or) total,
163 Prim (UN "prim__xorB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin xor)
165 Prim (UN "prim__xorB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin xor)
164 (2, LB16Xor) total,
166 (2, LB16Xor) total,
167+ Prim (UN "prim__complB16") (ty [B16Type] B16Type) 1 (b8Un complement)
168+ (1, LB16Compl) total,
165 Prim (UN "prim__zextB16_32") (ty [B16Type] B32Type) 1 zext16_32
169 Prim (UN "prim__zextB16_32") (ty [B16Type] B32Type) 1 zext16_32
166 (1, LB16Z32) total,
170 (1, LB16Z32) total,
167 Prim (UN "prim__zextB16_64") (ty [B16Type] B64Type) 1 zext16_64
171 Prim (UN "prim__zextB16_64") (ty [B16Type] B64Type) 1 zext16_64
@@ -209,6 +213,8 @@ primitives =
209 (2, LB32Or) total,
213 (2, LB32Or) total,
210 Prim (UN "prim__xorB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin xor)
214 Prim (UN "prim__xorB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin xor)
211 (2, LB32Xor) total,
215 (2, LB32Xor) total,
216+ Prim (UN "prim__complB32") (ty [B32Type] B32Type) 1 (b32Un complement)
217+ (1, LB32Compl) total,
212 Prim (UN "prim__zextB32_64") (ty [B32Type] B64Type) 1 zext32_64
218 Prim (UN "prim__zextB32_64") (ty [B32Type] B64Type) 1 zext32_64
213 (1, LB32Z64) total,
219 (1, LB32Z64) total,
214 Prim (UN "prim__sextB32_64") (ty [B32Type] B64Type) 1 sext32_64
220 Prim (UN "prim__sextB32_64") (ty [B32Type] B64Type) 1 sext32_64
@@ -254,6 +260,8 @@ primitives =
254 (2, LB64Or) total,
260 (2, LB64Or) total,
255 Prim (UN "prim__xorB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin xor)
261 Prim (UN "prim__xorB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin xor)
256 (2, LB64Xor) total,
262 (2, LB64Xor) total,
263+ Prim (UN "prim__complB64") (ty [B64Type] B64Type) 1 (b64Un complement)
264+ (1, LB64Compl) total,
257 Prim (UN "prim__truncB64_8") (ty [B64Type] B8Type) 1 trunc64_8
265 Prim (UN "prim__truncB64_8") (ty [B64Type] B8Type) 1 trunc64_8
258 (1, LB64T8) total,
266 (1, LB64T8) total,
259 Prim (UN "prim__truncB64_16") (ty [B64Type] B16Type) 1 trunc64_16
267 Prim (UN "prim__truncB64_16") (ty [B64Type] B16Type) 1 trunc64_16
@@ -450,15 +458,27 @@ b64ToStr _ = Nothing
450b8Bin op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (B8 (op x y))
458b8Bin op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (B8 (op x y))
451b8Bin _ _ = Nothing
459b8Bin _ _ = Nothing
461+b8Un op [VConstant (B8 x)] = Just $ VConstant (B8 (op x))
453b16Bin op [VConstant (B16 x), VConstant (B16 y)] = Just $ VConstant (B16 (op x y))
464b16Bin op [VConstant (B16 x), VConstant (B16 y)] = Just $ VConstant (B16 (op x y))
454b16Bin _ _ = Nothing
465b16Bin _ _ = Nothing
467+b16Un op [VConstant (B16 x)] = Just $ VConstant (B16 (op x))
456b32Bin op [VConstant (B32 x), VConstant (B32 y)] = Just $ VConstant (B32 (op x y))
470b32Bin op [VConstant (B32 x), VConstant (B32 y)] = Just $ VConstant (B32 (op x y))
457b32Bin _ _ = Nothing
471b32Bin _ _ = Nothing
473+b32Un op [VConstant (B32 x)] = Just $ VConstant (B32 (op x))
459b64Bin op [VConstant (B64 x), VConstant (B64 y)] = Just $ VConstant (B64 (op x y))
476b64Bin op [VConstant (B64 x), VConstant (B64 y)] = Just $ VConstant (B64 (op x y))
460b64Bin _ _ = Nothing
477b64Bin _ _ = Nothing
479+b64Un op [VConstant (B64 x)] = Just $ VConstant (B64 (op x))
462b8Cmp op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (I (if (op x y) then 1 else 0))
482b8Cmp op [VConstant (B8 x), VConstant (B8 y)] = Just $ VConstant (I (if (op x y) then 1 else 0))
463b8Cmp _ _ = Nothing
483b8Cmp _ _ = Nothing