aboutsummaryrefslogtreecommitdiff
path: root/src/arch/wasm/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-01-30 16:23:31 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-01-30 16:23:31 -0700
commitfb7060d3c2e8ce4d7de5560adf8ec4a26fc5f6e8 (patch)
tree3710af0870e1e1d43f44830d6ff3e662761e93ce /src/arch/wasm/CodeGen.zig
parent0c30799d4039c30f95eee29e2c2f8f604e8b9880 (diff)
downloadzig-fb7060d3c2e8ce4d7de5560adf8ec4a26fc5f6e8.tar.gz
zig-fb7060d3c2e8ce4d7de5560adf8ec4a26fc5f6e8.zip
stage2: implement shl_exact and shr_exact
These produce an undefined value when one bits are shifted out. New AIR instruction: shr_exact.
Diffstat (limited to 'src/arch/wasm/CodeGen.zig')
-rw-r--r--src/arch/wasm/CodeGen.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/arch/wasm/CodeGen.zig b/src/arch/wasm/CodeGen.zig
index b58bc81f14..d86e0069cf 100644
--- a/src/arch/wasm/CodeGen.zig
+++ b/src/arch/wasm/CodeGen.zig
@@ -1442,8 +1442,8 @@ fn genInst(self: *Self, inst: Air.Inst.Index) !WValue {
.bool_and => self.airBinOp(inst, .@"and"),
.bool_or => self.airBinOp(inst, .@"or"),
.rem => self.airBinOp(inst, .rem),
- .shl => self.airBinOp(inst, .shl),
- .shr => self.airBinOp(inst, .shr),
+ .shl, .shl_exact => self.airBinOp(inst, .shl),
+ .shr, .shr_exact => self.airBinOp(inst, .shr),
.xor => self.airBinOp(inst, .xor),
.cmp_eq => self.airCmp(inst, .eq),
@@ -1531,7 +1531,6 @@ fn genInst(self: *Self, inst: Air.Inst.Index) !WValue {
.max,
.min,
.assembly,
- .shl_exact,
.shl_sat,
.ret_addr,
.clz,