aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-11 13:48:28 -0500
committerGitHub <noreply@github.com>2022-03-11 13:48:28 -0500
commit4c1cc4d8d91af459e5ac1e20b744c7dc9b5b8da3 (patch)
tree8ee7c3b7f2b4c66e9ed8599b9c5164b78d1cc43c /src/codegen/c.zig
parent5fbae9cd6fe7a53d85ad6dd20cab75f7b835f0ad (diff)
parent03b8206f27485f871fc489f884ffbc276d61877c (diff)
downloadzig-4c1cc4d8d91af459e5ac1e20b744c7dc9b5b8da3.tar.gz
zig-4c1cc4d8d91af459e5ac1e20b744c7dc9b5b8da3.zip
Merge pull request #11120 from Vexu/stage2
Stage2: make std.rand tests pass
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 4a30bf023b..c179b65046 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -1716,6 +1716,7 @@ fn genBody(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, OutO
.tag_name => try airTagName(f, inst),
.error_name => try airErrorName(f, inst),
.splat => try airSplat(f, inst),
+ .shuffle => try airShuffle(f, inst),
.aggregate_init => try airAggregateInit(f, inst),
.union_init => try airUnionInit(f, inst),
.prefetch => try airPrefetch(f, inst),
@@ -3557,6 +3558,21 @@ fn airSplat(f: *Function, inst: Air.Inst.Index) !CValue {
return f.fail("TODO: C backend: implement airSplat", .{});
}
+fn airShuffle(f: *Function, inst: Air.Inst.Index) !CValue {
+ if (f.liveness.isUnused(inst)) return CValue.none;
+
+ const inst_ty = f.air.typeOfIndex(inst);
+ const ty_op = f.air.instructions.items(.data)[inst].ty_op;
+ const operand = try f.resolveInst(ty_op.operand);
+ const writer = f.object.writer();
+ const local = try f.allocLocal(inst_ty, .Const);
+ try writer.writeAll(" = ");
+
+ _ = operand;
+ _ = local;
+ return f.fail("TODO: C backend: implement airShuffle", .{});
+}
+
fn airAggregateInit(f: *Function, inst: Air.Inst.Index) !CValue {
if (f.liveness.isUnused(inst)) return CValue.none;