commit 2c9ab03b0b9400d5e063d81fe6ff92a8fe4242f4 (tree)
parent 5b0134e3edd87d3818cd68e2ae6cb70a454a5c3b
Author: Koakuma <koachan@protonmail.com>
Date: Wed, 29 Jun 2022 22:58:47 +0700
stage2: sparc64: Add airCmpLtErrorsLen placeholder
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/arch/sparc64/CodeGen.zig b/src/arch/sparc64/CodeGen.zig
@@ -546,7 +546,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void {
.cmp_gt => try self.airCmp(inst, .gt),
.cmp_neq => try self.airCmp(inst, .neq),
.cmp_vector => @panic("TODO try self.airCmpVector(inst)"),
- .cmp_lt_errors_len => @panic("TODO try self.airCmpLtErrorsLen(inst)"),
+ .cmp_lt_errors_len => try self.airCmpLtErrorsLen(inst),
.bool_and => @panic("TODO try self.airBoolOp(inst)"),
.bool_or => @panic("TODO try self.airBoolOp(inst)"),
@@ -1299,6 +1299,14 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void {
return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none });
}
+fn airCmpLtErrorsLen(self: *Self, inst: Air.Inst.Index) !void {
+ const un_op = self.air.instructions.items(.data)[inst].un_op;
+ const operand = try self.resolveInst(un_op);
+ _ = operand;
+ const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airCmpLtErrorsLen for {}", .{self.target.cpu.arch});
+ return self.finishAir(inst, result, .{ un_op, .none, .none });
+}
+
fn airCondBr(self: *Self, inst: Air.Inst.Index) !void {
const pl_op = self.air.instructions.items(.data)[inst].pl_op;
const condition = try self.resolveInst(pl_op.operand);