| ... | @@ -585,7 +585,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -585,7 +585,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 585 | .fpext => @panic("TODO try self.airFpext(inst)"), | 585 | .fpext => @panic("TODO try self.airFpext(inst)"), |
| 586 | .intcast => try self.airIntCast(inst), | 586 | .intcast => try self.airIntCast(inst), |
| 587 | .trunc => @panic("TODO try self.airTrunc(inst)"), | 587 | .trunc => @panic("TODO try self.airTrunc(inst)"), |
| 588 | .bool_to_int => @panic("TODO try self.airBoolToInt(inst)"), | 588 | .bool_to_int => try self.airBoolToInt(inst), |
| 589 | .is_non_null => try self.airIsNonNull(inst), | 589 | .is_non_null => try self.airIsNonNull(inst), |
| 590 | .is_non_null_ptr => @panic("TODO try self.airIsNonNullPtr(inst)"), | 590 | .is_non_null_ptr => @panic("TODO try self.airIsNonNullPtr(inst)"), |
| 591 | .is_null => try self.airIsNull(inst), | 591 | .is_null => try self.airIsNull(inst), |
| ... | @@ -985,6 +985,13 @@ fn airBinOp(self: *Self, inst: Air.Inst.Index, tag: Air.Inst.Tag) !void { | ... | @@ -985,6 +985,13 @@ fn airBinOp(self: *Self, inst: Air.Inst.Index, tag: Air.Inst.Tag) !void { |
| 985 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); | 985 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 986 | } | 986 | } |
| 987 | | 987 | |
| | 988 | fn airBoolToInt(self: *Self, inst: Air.Inst.Index) !void { |
| | 989 | const un_op = self.air.instructions.items(.data)[inst].un_op; |
| | 990 | const operand = try self.resolveInst(un_op); |
| | 991 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else operand; |
| | 992 | return self.finishAir(inst, result, .{ un_op, .none, .none }); |
| | 993 | } |
| | 994 | |
| 988 | fn airPtrArithmetic(self: *Self, inst: Air.Inst.Index, tag: Air.Inst.Tag) !void { | 995 | fn airPtrArithmetic(self: *Self, inst: Air.Inst.Index, tag: Air.Inst.Tag) !void { |
| 989 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; | 996 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| 990 | const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data; | 997 | const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data; |