@@ -89,6 +89,20 @@ primitives =
8989 (2, LB8UDiv) total,
9090 Prim (UN "prim__sdivB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin s8div)
9191 (2, LB8SDiv) total,
92+ Prim (UN "prim__shlB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (\x y -> shiftL x (fromIntegral y)))
93+ (2, LB8Shl) total,
94+ Prim (UN "prim__lshrB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (\x y -> shiftR x (fromIntegral y)))
95+ (2, LB8AShr) total,
96+ Prim (UN "prim__ashrB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (\x y -> fromIntegral $
97+ shiftR (fromIntegral x :: Int8)
98+ (fromIntegral y)))
99+ (2, LB8LShr) total,
100+ Prim (UN "prim__andB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (.&.))
101+ (2, LB8And) total,
102+ Prim (UN "prim__orB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin (.|.))
103+ (2, LB8Or) total,
104+ Prim (UN "prim__xorB8") (ty [B8Type, B8Type] B8Type) 2 (b8Bin xor)
105+ (2, LB8Xor) total,
92106 Prim (UN "prim__zextB8_16") (ty [B8Type] B16Type) 1 zext8_16
93107 (1, LB8Z16) total,
94108 Prim (UN "prim__zextB8_32") (ty [B8Type] B32Type) 1 zext8_32
@@ -114,6 +128,20 @@ primitives =
114128 (2, LB16UDiv) total,
115129 Prim (UN "prim__sdivB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin s16div)
116130 (2, LB16SDiv) total,
131+ Prim (UN "prim__shlB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (\x y -> shiftL x (fromIntegral y)))
132+ (2, LB16Shl) total,
133+ Prim (UN "prim__lshrB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (\x y -> shiftR x (fromIntegral y)))
134+ (2, LB16AShr) total,
135+ Prim (UN "prim__ashrB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (\x y -> fromIntegral $
136+ shiftR (fromIntegral x :: Int16)
137+ (fromIntegral y)))
138+ (2, LB16LShr) total,
139+ Prim (UN "prim__andB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (.&.))
140+ (2, LB16And) total,
141+ Prim (UN "prim__orB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin (.|.))
142+ (2, LB16Or) total,
143+ Prim (UN "prim__xorB16") (ty [B16Type, B16Type] B16Type) 2 (b16Bin xor)
144+ (2, LB16Xor) total,
117145 Prim (UN "prim__zextB16_32") (ty [B16Type] B32Type) 1 zext16_32
118146 (1, LB16Z32) total,
119147 Prim (UN "prim__zextB16_64") (ty [B16Type] B64Type) 1 zext16_64
@@ -137,6 +165,20 @@ primitives =
137165 (2, LB32UDiv) total,
138166 Prim (UN "prim__sdivB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin s32div)
139167 (2, LB32SDiv) total,
168+ Prim (UN "prim__shlB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (\x y -> shiftL x (fromIntegral y)))
169+ (2, LB32Shl) total,
170+ Prim (UN "prim__lshrB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (\x y -> shiftR x (fromIntegral y)))
171+ (2, LB32AShr) total,
172+ Prim (UN "prim__ashrB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (\x y -> fromIntegral $
173+ shiftR (fromIntegral x :: Int32)
174+ (fromIntegral y)))
175+ (2, LB32LShr) total,
176+ Prim (UN "prim__andB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (.&.))
177+ (2, LB32And) total,
178+ Prim (UN "prim__orB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin (.|.))
179+ (2, LB32Or) total,
180+ Prim (UN "prim__xorB32") (ty [B32Type, B32Type] B32Type) 2 (b32Bin xor)
181+ (2, LB32Xor) total,
140182 Prim (UN "prim__zextB32_64") (ty [B32Type] B64Type) 1 zext32_64
141183 (1, LB32Z64) total,
142184 Prim (UN "prim__sextB32_64") (ty [B32Type] B64Type) 1 sext32_64
@@ -158,6 +200,20 @@ primitives =
158200 (2, LB64UDiv) total,
159201 Prim (UN "prim__sdivB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin s64div)
160202 (2, LB64SDiv) total,
203+ Prim (UN "prim__shlB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (\x y -> shiftL x (fromIntegral y)))
204+ (2, LB64Shl) total,
205+ Prim (UN "prim__lshrB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (\x y -> shiftR x (fromIntegral y)))
206+ (2, LB64AShr) total,
207+ Prim (UN "prim__ashrB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (\x y -> fromIntegral $
208+ shiftR (fromIntegral x :: Int64)
209+ (fromIntegral y)))
210+ (2, LB64LShr) total,
211+ Prim (UN "prim__andB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (.&.))
212+ (2, LB64And) total,
213+ Prim (UN "prim__orB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin (.|.))
214+ (2, LB64Or) total,
215+ Prim (UN "prim__xorB64") (ty [B64Type, B64Type] B64Type) 2 (b64Bin xor)
216+ (2, LB64Xor) total,
161217 Prim (UN "prim__truncB64_8") (ty [B64Type] B8Type) 1 trunc64_8
162218 (1, LB64T8) total,
163219 Prim (UN "prim__truncB64_16") (ty [B64Type] B16Type) 1 trunc64_16