diff options
| author | gracefu <81774659+gracefuu@users.noreply.github.com> | 2021-04-08 05:24:17 +0800 |
|---|---|---|
| committer | gracefu <81774659+gracefuu@users.noreply.github.com> | 2021-04-08 05:26:56 +0800 |
| commit | 4c71942f84261e9872cd27139c45b6d5fb1ab6c7 (patch) | |
| tree | 29edf638919b456298339933be1ac9ec68893054 /src/codegen/c.zig | |
| parent | bcc371618fd71185e71a889c09eb68733ca66842 (diff) | |
| download | zig-4c71942f84261e9872cd27139c45b6d5fb1ab6c7.tar.gz zig-4c71942f84261e9872cd27139c45b6d5fb1ab6c7.zip | |
stage2: Add .div to ir.zig
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 876f86ed02..d3ddbdeef9 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -582,6 +582,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).?), |
