aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2021-12-18 04:42:13 +0100
committerRobin Voetter <robin@voetter.nl>2021-12-21 01:41:51 +0100
commitf3d635b6683ba4a53f82ae8087b1cf78552abac5 (patch)
treebd038a7404df4e79170915e07528694768f44f7c /src/codegen/c.zig
parent28bcd7dbdda7fb2c2fe80dbdb5981479a04e973a (diff)
downloadzig-f3d635b6683ba4a53f82ae8087b1cf78552abac5.tar.gz
zig-f3d635b6683ba4a53f82ae8087b1cf78552abac5.zip
stage2: @addWithOverflow
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index f54ae7f76d..b086d15b48 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -1155,6 +1155,8 @@ fn genBody(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, OutO
.mul_sat => try airSatOp(f, inst, "muls_"),
.shl_sat => try airSatOp(f, inst, "shls_"),
+ .add_with_overflow => try airAddWithOverflow(f, inst),
+
.min => try airMinMax(f, inst, "<"),
.max => try airMinMax(f, inst, ">"),
@@ -1864,6 +1866,12 @@ fn airSatOp(f: *Function, inst: Air.Inst.Index, fn_op: [*:0]const u8) !CValue {
return ret;
}
+fn airAddWithOverflow(f: *Function, inst: Air.Inst.Index) !CValue {
+ _ = f;
+ _ = inst;
+ return f.fail("TODO add with overflow", .{});
+}
+
fn airNot(f: *Function, inst: Air.Inst.Index) !CValue {
if (f.liveness.isUnused(inst))
return CValue.none;