| ... | ... | @@ -546,7 +546,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 546 | 546 | .cmp_gt => try self.airCmp(inst, .gt), |
| 547 | 547 | .cmp_neq => try self.airCmp(inst, .neq), |
| 548 | 548 | .cmp_vector => @panic("TODO try self.airCmpVector(inst)"), |
| 549 | | .cmp_lt_errors_len => @panic("TODO try self.airCmpLtErrorsLen(inst)"), |
| 549 | .cmp_lt_errors_len => try self.airCmpLtErrorsLen(inst), |
| 550 | 550 | |
| 551 | 551 | .bool_and => @panic("TODO try self.airBoolOp(inst)"), |
| 552 | 552 | .bool_or => @panic("TODO try self.airBoolOp(inst)"), |
| ... | ... | @@ -1299,6 +1299,14 @@ fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void { |
| 1299 | 1299 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 1300 | 1300 | } |
| 1301 | 1301 | |
| 1302 | fn airCmpLtErrorsLen(self: *Self, inst: Air.Inst.Index) !void { |
| 1303 | const un_op = self.air.instructions.items(.data)[inst].un_op; |
| 1304 | const operand = try self.resolveInst(un_op); |
| 1305 | _ = operand; |
| 1306 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airCmpLtErrorsLen for {}", .{self.target.cpu.arch}); |
| 1307 | return self.finishAir(inst, result, .{ un_op, .none, .none }); |
| 1308 | } |
| 1309 | |
| 1302 | 1310 | fn airCondBr(self: *Self, inst: Air.Inst.Index) !void { |
| 1303 | 1311 | const pl_op = self.air.instructions.items(.data)[inst].pl_op; |
| 1304 | 1312 | const condition = try self.resolveInst(pl_op.operand); |