authorgravatar for twostepted@gmail.comTravis Staloch <twostepted@gmail.com> 2021-09-08 16:30:11-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-28 17:03:43-07:00
logbdb90a07bbf0fdedca71f5deace7087bc562b437
treef62be4936977a1af845abe6687bc624618eed22a
parentdcbc52ec85d00fbd3603c314aaaab98fb3866892

sat-arithmetic: fixups zig fmt / astcheck


2 files changed, 6 insertions(+), 7 deletions(-)

src/AstGen.zig+1-1
......@@ -2786,7 +2786,7 @@ fn assignShift(
27862786fn assignShiftSat(
27872787 gz: *GenZir,
27882788 scope: *Scope,
2789 infix_node: ast.Node.Index,
2789 infix_node: Ast.Node.Index,
27902790 op_inst_tag: Zir.Inst.Tag,
27912791) InnerError!void {
27922792 try emitDbgNode(gz, infix_node);
src/codegen/c.zig+5-6
......@@ -1317,7 +1317,6 @@ fn airWrapOp(
13171317fn airSatOp(
13181318 o: *Object,
13191319 inst: Air.Inst.Index,
1320 str_op: [*:0]const u8,
13211320 fn_op: [*:0]const u8,
13221321) !CValue {
13231322 if (o.liveness.isUnused(inst))
......@@ -1328,12 +1327,12 @@ fn airSatOp(
13281327 const int_info = inst_ty.intInfo(o.dg.module.getTarget());
13291328 const bits = int_info.bits;
13301329
1331 // if it's an unsigned int with non-arbitrary bit size then we can just add
1332 const ok_bits = switch (bits) {
1333 8, 16, 32, 64, 128 => true,
1334 else => false,
1335 };
1330 switch (bits) {
1331 8, 16, 32, 64, 128 => {},
1332 else => return o.dg.fail("TODO: C backend: airSatOp for non power of 2 integers", .{}),
1333 }
13361334
1335 // if it's an unsigned int with non-arbitrary bit size then we can just add
13371336 if (bits > 64) {
13381337 return f.fail("TODO: C backend: airSatOp for large integers", .{});
13391338 }