| ... | @@ -591,8 +591,8 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -591,8 +591,8 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 591 | .struct_field_ptr=> @panic("TODO try self.airStructFieldPtr(inst)"), | 591 | .struct_field_ptr=> @panic("TODO try self.airStructFieldPtr(inst)"), |
| 592 | .struct_field_val=> try self.airStructFieldVal(inst), | 592 | .struct_field_val=> try self.airStructFieldVal(inst), |
| 593 | .array_to_slice => try self.airArrayToSlice(inst), | 593 | .array_to_slice => try self.airArrayToSlice(inst), |
| 594 | .int_to_float => @panic("TODO try self.airIntToFloat(inst)"), | 594 | .int_to_float => try self.airIntToFloat(inst), |
| 595 | .float_to_int => @panic("TODO try self.airFloatToInt(inst)"), | 595 | .float_to_int => try self.airFloatToInt(inst), |
| 596 | .cmpxchg_strong => @panic("TODO try self.airCmpxchg(inst)"), | 596 | .cmpxchg_strong => @panic("TODO try self.airCmpxchg(inst)"), |
| 597 | .cmpxchg_weak => @panic("TODO try self.airCmpxchg(inst)"), | 597 | .cmpxchg_weak => @panic("TODO try self.airCmpxchg(inst)"), |
| 598 | .atomic_rmw => @panic("TODO try self.airAtomicRmw(inst)"), | 598 | .atomic_rmw => @panic("TODO try self.airAtomicRmw(inst)"), |
| ... | @@ -1519,6 +1519,14 @@ fn airFence(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -1519,6 +1519,14 @@ fn airFence(self: *Self, inst: Air.Inst.Index) !void { |
| 1519 | return self.finishAir(inst, .dead, .{ .none, .none, .none }); | 1519 | return self.finishAir(inst, .dead, .{ .none, .none, .none }); |
| 1520 | } | 1520 | } |
| 1521 | | 1521 | |
| | 1522 | fn airFloatToInt(self: *Self, inst: Air.Inst.Index) !void { |
| | 1523 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| | 1524 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airFloatToInt for {}", .{ |
| | 1525 | self.target.cpu.arch, |
| | 1526 | }); |
| | 1527 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| | 1528 | } |
| | 1529 | |
| 1522 | fn airIntCast(self: *Self, inst: Air.Inst.Index) !void { | 1530 | fn airIntCast(self: *Self, inst: Air.Inst.Index) !void { |
| 1523 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; | 1531 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 1524 | if (self.liveness.isUnused(inst)) | 1532 | if (self.liveness.isUnused(inst)) |
| ... | @@ -1537,6 +1545,14 @@ fn airIntCast(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -1537,6 +1545,14 @@ fn airIntCast(self: *Self, inst: Air.Inst.Index) !void { |
| 1537 | return self.fail("TODO implement intCast for {}", .{self.target.cpu.arch}); | 1545 | return self.fail("TODO implement intCast for {}", .{self.target.cpu.arch}); |
| 1538 | } | 1546 | } |
| 1539 | | 1547 | |
| | 1548 | fn airIntToFloat(self: *Self, inst: Air.Inst.Index) !void { |
| | 1549 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| | 1550 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airIntToFloat for {}", .{ |
| | 1551 | self.target.cpu.arch, |
| | 1552 | }); |
| | 1553 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| | 1554 | } |
| | 1555 | |
| 1540 | fn airIsErr(self: *Self, inst: Air.Inst.Index) !void { | 1556 | fn airIsErr(self: *Self, inst: Air.Inst.Index) !void { |
| 1541 | const un_op = self.air.instructions.items(.data)[inst].un_op; | 1557 | const un_op = self.air.instructions.items(.data)[inst].un_op; |
| 1542 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: { | 1558 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: { |