diff options
| author | William Sengir <william@sengir.com> | 2022-03-19 23:44:55 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-21 16:54:19 -0700 |
| commit | 0f4830704171b734bb4a0235fc14809282457dc3 (patch) | |
| tree | f14d426793b2878db30315195c068e6d28ca608d /src/codegen/c.zig | |
| parent | 862e63f535ec8d65e33ed7ea67eb9cf03bfc7d6a (diff) | |
| download | zig-0f4830704171b734bb4a0235fc14809282457dc3.tar.gz zig-0f4830704171b734bb4a0235fc14809282457dc3.zip | |
stage2: add AIR instruction `cmp_vector`
The existing `cmp_*` instructions get their result type from `lhs`, but
vector comparison will always return a vector of bools with only the
length derived from its operands. This necessitates the creation of a
new AIR instruction.
Diffstat (limited to 'src/codegen/c.zig')
| -rw-r--r-- | src/codegen/c.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 23ccdc007b..f5a1036479 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -1715,6 +1715,8 @@ fn genBody(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, OutO .cmp_eq => try airEquality(f, inst, "((", "=="), .cmp_neq => try airEquality(f, inst, "!((", "!="), + .cmp_vector => return f.fail("TODO: C backend: implement binary op for tag '{s}'", .{@tagName(Air.Inst.Tag.cmp_vector)}), + // bool_and and bool_or are non-short-circuit operations .bool_and => try airBinOp(f, inst, " & "), .bool_or => try airBinOp(f, inst, " | "), |
