aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-04-08 13:41:49 -0700
committerGitHub <noreply@github.com>2021-04-08 13:41:49 -0700
commit9f744f19e7036df9a410f780f3394f6669b8079e (patch)
tree055ef5f9727b51bde13f86805c67b3a4608b8c68 /src/codegen/c.zig
parentd7a89f98765381b4be2ce7626addad07ecfa7208 (diff)
parent6dc35efe4958a0569c4d8576bca84d62264b1d1d (diff)
downloadzig-9f744f19e7036df9a410f780f3394f6669b8079e.tar.gz
zig-9f744f19e7036df9a410f780f3394f6669b8079e.zip
Merge pull request #8464 from gracefuu/grace/wasm-ops
stage2 wasm: Add division and bitwise/boolean ops &, |, ^, and, or
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 874baccf42..0fdf5cb01b 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -632,6 +632,9 @@ pub fn genBody(o: *Object, body: ir.Body) error{ AnalysisFail, OutOfMemory }!voi
.mul => try genBinOp(o, inst.castTag(.sub).?, " * "),
// TODO make this do wrapping multiplication for signed ints
.mulwrap => try genBinOp(o, inst.castTag(.sub).?, " * "),
+ // TODO use a different strategy for div that communicates to the optimizer
+ // that wrapping is UB.
+ .div => try genBinOp(o, inst.castTag(.div).?, " / "),
.constant => unreachable, // excluded from function bodies
.alloc => try genAlloc(o, inst.castTag(.alloc).?),