From fbd7e4506f46b73e351e1f3eb5e7cfc16ebbfc1f Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Tue, 7 Jun 2022 19:13:50 +0300 Subject: stage2: implement asm with multiple outputs --- src/AstGen.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/AstGen.zig') diff --git a/src/AstGen.zig b/src/AstGen.zig index 36944c1a8a..831071c479 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -6876,6 +6876,9 @@ fn asmExpr( const constraint = (try astgen.strLitAsString(constraint_token)).index; const has_arrow = token_tags[symbolic_name + 4] == .arrow; if (has_arrow) { + if (output_type_bits != 0) { + return astgen.failNode(output_node, "inline assembly allows up to one output value", .{}); + } output_type_bits |= @as(u32, 1) << @intCast(u5, i); const out_type_node = node_datas[output_node].lhs; const out_type_inst = try typeExpr(gz, scope, out_type_node); @@ -6892,7 +6895,7 @@ fn asmExpr( outputs[i] = .{ .name = name, .constraint = constraint, - .operand = try localVarRef(gz, scope, rl, node, ident_token), + .operand = try localVarRef(gz, scope, .ref, node, ident_token), }; } } -- cgit v1.2.3