| ... | @@ -6,6 +6,7 @@ const log = std.log.scoped(.codegen); | ... | @@ -6,6 +6,7 @@ const log = std.log.scoped(.codegen); |
| 6 | const tracking_log = std.log.scoped(.tracking); | 6 | const tracking_log = std.log.scoped(.tracking); |
| 7 | const verbose_tracking_log = std.log.scoped(.verbose_tracking); | 7 | const verbose_tracking_log = std.log.scoped(.verbose_tracking); |
| 8 | const wip_mir_log = std.log.scoped(.wip_mir); | 8 | const wip_mir_log = std.log.scoped(.wip_mir); |
| | 9 | const Writer = std.io.Writer; |
| 9 | | 10 | |
| 10 | const Air = @import("../../Air.zig"); | 11 | const Air = @import("../../Air.zig"); |
| 11 | const Allocator = std.mem.Allocator; | 12 | const Allocator = std.mem.Allocator; |
| ... | @@ -524,52 +525,47 @@ pub const MCValue = union(enum) { | ... | @@ -524,52 +525,47 @@ pub const MCValue = union(enum) { |
| 524 | }; | 525 | }; |
| 525 | } | 526 | } |
| 526 | | 527 | |
| 527 | pub fn format( | 528 | pub fn format(mcv: MCValue, bw: *Writer, comptime _: []const u8) Writer.Error!void { |
| 528 | mcv: MCValue, | | |
| 529 | comptime _: []const u8, | | |
| 530 | _: std.fmt.FormatOptions, | | |
| 531 | writer: anytype, | | |
| 532 | ) @TypeOf(writer).Error!void { | | |
| 533 | switch (mcv) { | 529 | switch (mcv) { |
| 534 | .none, .unreach, .dead, .undef => try writer.print("({s})", .{@tagName(mcv)}), | 530 | .none, .unreach, .dead, .undef => try bw.print("({s})", .{@tagName(mcv)}), |
| 535 | .immediate => |pl| try writer.print("0x{x}", .{pl}), | 531 | .immediate => |pl| try bw.print("0x{x}", .{pl}), |
| 536 | .memory => |pl| try writer.print("[ds:0x{x}]", .{pl}), | 532 | .memory => |pl| try bw.print("[ds:0x{x}]", .{pl}), |
| 537 | inline .eflags, .register => |pl| try writer.print("{s}", .{@tagName(pl)}), | 533 | inline .eflags, .register => |pl| try bw.print("{s}", .{@tagName(pl)}), |
| 538 | .register_pair => |pl| try writer.print("{s}:{s}", .{ @tagName(pl[1]), @tagName(pl[0]) }), | 534 | .register_pair => |pl| try bw.print("{s}:{s}", .{ @tagName(pl[1]), @tagName(pl[0]) }), |
| 539 | .register_triple => |pl| try writer.print("{s}:{s}:{s}", .{ | 535 | .register_triple => |pl| try bw.print("{s}:{s}:{s}", .{ |
| 540 | @tagName(pl[2]), @tagName(pl[1]), @tagName(pl[0]), | 536 | @tagName(pl[2]), @tagName(pl[1]), @tagName(pl[0]), |
| 541 | }), | 537 | }), |
| 542 | .register_quadruple => |pl| try writer.print("{s}:{s}:{s}:{s}", .{ | 538 | .register_quadruple => |pl| try bw.print("{s}:{s}:{s}:{s}", .{ |
| 543 | @tagName(pl[3]), @tagName(pl[2]), @tagName(pl[1]), @tagName(pl[0]), | 539 | @tagName(pl[3]), @tagName(pl[2]), @tagName(pl[1]), @tagName(pl[0]), |
| 544 | }), | 540 | }), |
| 545 | .register_offset => |pl| try writer.print("{s} + 0x{x}", .{ @tagName(pl.reg), pl.off }), | 541 | .register_offset => |pl| try bw.print("{s} + 0x{x}", .{ @tagName(pl.reg), pl.off }), |
| 546 | .register_overflow => |pl| try writer.print("{s}:{s}", .{ | 542 | .register_overflow => |pl| try bw.print("{s}:{s}", .{ |
| 547 | @tagName(pl.eflags), | 543 | @tagName(pl.eflags), |
| 548 | @tagName(pl.reg), | 544 | @tagName(pl.reg), |
| 549 | }), | 545 | }), |
| 550 | .register_mask => |pl| try writer.print("mask({s},{}):{c}{s}", .{ | 546 | .register_mask => |pl| try bw.print("mask({s},{f}):{c}{s}", .{ |
| 551 | @tagName(pl.info.kind), | 547 | @tagName(pl.info.kind), |
| 552 | pl.info.scalar, | 548 | pl.info.scalar, |
| 553 | @as(u8, if (pl.info.inverted) '!' else ' '), | 549 | @as(u8, if (pl.info.inverted) '!' else ' '), |
| 554 | @tagName(pl.reg), | 550 | @tagName(pl.reg), |
| 555 | }), | 551 | }), |
| 556 | .indirect => |pl| try writer.print("[{s} + 0x{x}]", .{ @tagName(pl.reg), pl.off }), | 552 | .indirect => |pl| try bw.print("[{s} + 0x{x}]", .{ @tagName(pl.reg), pl.off }), |
| 557 | .indirect_load_frame => |pl| try writer.print("[[{} + 0x{x}]]", .{ pl.index, pl.off }), | 553 | .indirect_load_frame => |pl| try bw.print("[[{} + 0x{x}]]", .{ pl.index, pl.off }), |
| 558 | .load_frame => |pl| try writer.print("[{} + 0x{x}]", .{ pl.index, pl.off }), | 554 | .load_frame => |pl| try bw.print("[{} + 0x{x}]", .{ pl.index, pl.off }), |
| 559 | .lea_frame => |pl| try writer.print("{} + 0x{x}", .{ pl.index, pl.off }), | 555 | .lea_frame => |pl| try bw.print("{} + 0x{x}", .{ pl.index, pl.off }), |
| 560 | .load_nav => |pl| try writer.print("[nav:{d}]", .{@intFromEnum(pl)}), | 556 | .load_nav => |pl| try bw.print("[nav:{d}]", .{@intFromEnum(pl)}), |
| 561 | .lea_nav => |pl| try writer.print("nav:{d}", .{@intFromEnum(pl)}), | 557 | .lea_nav => |pl| try bw.print("nav:{d}", .{@intFromEnum(pl)}), |
| 562 | .load_uav => |pl| try writer.print("[uav:{d}]", .{@intFromEnum(pl.val)}), | 558 | .load_uav => |pl| try bw.print("[uav:{d}]", .{@intFromEnum(pl.val)}), |
| 563 | .lea_uav => |pl| try writer.print("uav:{d}", .{@intFromEnum(pl.val)}), | 559 | .lea_uav => |pl| try bw.print("uav:{d}", .{@intFromEnum(pl.val)}), |
| 564 | .load_lazy_sym => |pl| try writer.print("[lazy:{s}:{d}]", .{ @tagName(pl.kind), @intFromEnum(pl.ty) }), | 560 | .load_lazy_sym => |pl| try bw.print("[lazy:{s}:{d}]", .{ @tagName(pl.kind), @intFromEnum(pl.ty) }), |
| 565 | .lea_lazy_sym => |pl| try writer.print("lazy:{s}:{d}", .{ @tagName(pl.kind), @intFromEnum(pl.ty) }), | 561 | .lea_lazy_sym => |pl| try bw.print("lazy:{s}:{d}", .{ @tagName(pl.kind), @intFromEnum(pl.ty) }), |
| 566 | .load_extern_func => |pl| try writer.print("[extern:{d}]", .{@intFromEnum(pl)}), | 562 | .load_extern_func => |pl| try bw.print("[extern:{d}]", .{@intFromEnum(pl)}), |
| 567 | .lea_extern_func => |pl| try writer.print("extern:{d}", .{@intFromEnum(pl)}), | 563 | .lea_extern_func => |pl| try bw.print("extern:{d}", .{@intFromEnum(pl)}), |
| 568 | .elementwise_args => |pl| try writer.print("elementwise:{d}:[{} + 0x{x}]", .{ | 564 | .elementwise_args => |pl| try bw.print("elementwise:{d}:[{} + 0x{x}]", .{ |
| 569 | pl.regs, pl.frame_index, pl.frame_off, | 565 | pl.regs, pl.frame_index, pl.frame_off, |
| 570 | }), | 566 | }), |
| 571 | .reserved_frame => |pl| try writer.print("(dead:{})", .{pl}), | 567 | .reserved_frame => |pl| try bw.print("(dead:{})", .{pl}), |
| 572 | .air_ref => |pl| try writer.print("(air:0x{x})", .{@intFromEnum(pl)}), | 568 | .air_ref => |pl| try bw.print("(air:0x{x})", .{@intFromEnum(pl)}), |
| 573 | } | 569 | } |
| 574 | } | 570 | } |
| 575 | }; | 571 | }; |
| ... | @@ -639,7 +635,7 @@ const InstTracking = struct { | ... | @@ -639,7 +635,7 @@ const InstTracking = struct { |
| 639 | .reserved_frame => |index| self.long = .{ .load_frame = .{ .index = index } }, | 635 | .reserved_frame => |index| self.long = .{ .load_frame = .{ .index = index } }, |
| 640 | else => unreachable, | 636 | else => unreachable, |
| 641 | } | 637 | } |
| 642 | tracking_log.debug("spill {} from {} to {}", .{ inst, self.short, self.long }); | 638 | tracking_log.debug("spill {f} from {f} to {f}", .{ inst, self.short, self.long }); |
| 643 | try cg.genCopy(cg.typeOfIndex(inst), self.long, self.short, .{}); | 639 | try cg.genCopy(cg.typeOfIndex(inst), self.long, self.short, .{}); |
| 644 | for (self.short.getRegs()) |reg| if (reg.isClass(.x87)) try cg.asmRegister(.{ .f_, .free }, reg); | 640 | for (self.short.getRegs()) |reg| if (reg.isClass(.x87)) try cg.asmRegister(.{ .f_, .free }, reg); |
| 645 | } | 641 | } |
| ... | @@ -672,7 +668,7 @@ const InstTracking = struct { | ... | @@ -672,7 +668,7 @@ const InstTracking = struct { |
| 672 | else => {}, // TODO process stack allocation death | 668 | else => {}, // TODO process stack allocation death |
| 673 | } | 669 | } |
| 674 | self.reuseFrame(); | 670 | self.reuseFrame(); |
| 675 | tracking_log.debug("{} => {} (spilled)", .{ inst, self.* }); | 671 | tracking_log.debug("{f} => {f} (spilled)", .{ inst, self.* }); |
| 676 | } | 672 | } |
| 677 | | 673 | |
| 678 | fn verifyMaterialize(self: InstTracking, target: InstTracking) void { | 674 | fn verifyMaterialize(self: InstTracking, target: InstTracking) void { |
| ... | @@ -749,7 +745,7 @@ const InstTracking = struct { | ... | @@ -749,7 +745,7 @@ const InstTracking = struct { |
| 749 | else => target.long, | 745 | else => target.long, |
| 750 | } else target.long; | 746 | } else target.long; |
| 751 | self.short = target.short; | 747 | self.short = target.short; |
| 752 | tracking_log.debug("{} => {} (materialize)", .{ inst, self.* }); | 748 | tracking_log.debug("{f} => {f} (materialize)", .{ inst, self.* }); |
| 753 | } | 749 | } |
| 754 | | 750 | |
| 755 | fn resurrect(self: *InstTracking, function: *CodeGen, inst: Air.Inst.Index, scope_generation: u32) !void { | 751 | fn resurrect(self: *InstTracking, function: *CodeGen, inst: Air.Inst.Index, scope_generation: u32) !void { |
| ... | @@ -757,7 +753,7 @@ const InstTracking = struct { | ... | @@ -757,7 +753,7 @@ const InstTracking = struct { |
| 757 | .dead => |die_generation| if (die_generation >= scope_generation) { | 753 | .dead => |die_generation| if (die_generation >= scope_generation) { |
| 758 | self.reuseFrame(); | 754 | self.reuseFrame(); |
| 759 | try function.getValue(self.short, inst); | 755 | try function.getValue(self.short, inst); |
| 760 | tracking_log.debug("{} => {} (resurrect)", .{ inst, self.* }); | 756 | tracking_log.debug("{f} => {f} (resurrect)", .{ inst, self.* }); |
| 761 | }, | 757 | }, |
| 762 | else => {}, | 758 | else => {}, |
| 763 | } | 759 | } |
| ... | @@ -768,7 +764,7 @@ const InstTracking = struct { | ... | @@ -768,7 +764,7 @@ const InstTracking = struct { |
| 768 | try function.freeValue(self.short, opts); | 764 | try function.freeValue(self.short, opts); |
| 769 | if (self.long == .none) self.long = self.short; | 765 | if (self.long == .none) self.long = self.short; |
| 770 | self.short = .{ .dead = function.scope_generation }; | 766 | self.short = .{ .dead = function.scope_generation }; |
| 771 | tracking_log.debug("{} => {} (death)", .{ inst, self.* }); | 767 | tracking_log.debug("{f} => {f} (death)", .{ inst, self.* }); |
| 772 | } | 768 | } |
| 773 | | 769 | |
| 774 | fn reuse( | 770 | fn reuse( |
| ... | @@ -778,13 +774,13 @@ const InstTracking = struct { | ... | @@ -778,13 +774,13 @@ const InstTracking = struct { |
| 778 | old_inst: Air.Inst.Index, | 774 | old_inst: Air.Inst.Index, |
| 779 | ) void { | 775 | ) void { |
| 780 | self.short = .{ .dead = function.scope_generation }; | 776 | self.short = .{ .dead = function.scope_generation }; |
| 781 | tracking_log.debug("{?} => {} (reuse {})", .{ new_inst, self.*, old_inst }); | 777 | tracking_log.debug("{?f} => {f} (reuse {f})", .{ new_inst, self.*, old_inst }); |
| 782 | } | 778 | } |
| 783 | | 779 | |
| 784 | fn liveOut(self: *InstTracking, function: *CodeGen, inst: Air.Inst.Index) void { | 780 | fn liveOut(self: *InstTracking, function: *CodeGen, inst: Air.Inst.Index) void { |
| 785 | for (self.getRegs()) |reg| { | 781 | for (self.getRegs()) |reg| { |
| 786 | if (function.register_manager.isRegFree(reg)) { | 782 | if (function.register_manager.isRegFree(reg)) { |
| 787 | tracking_log.debug("{} => {} (live-out)", .{ inst, self.* }); | 783 | tracking_log.debug("{f} => {f} (live-out)", .{ inst, self.* }); |
| 788 | continue; | 784 | continue; |
| 789 | } | 785 | } |
| 790 | | 786 | |
| ... | @@ -812,18 +808,13 @@ const InstTracking = struct { | ... | @@ -812,18 +808,13 @@ const InstTracking = struct { |
| 812 | // Perform side-effects of freeValue manually. | 808 | // Perform side-effects of freeValue manually. |
| 813 | function.register_manager.freeReg(reg); | 809 | function.register_manager.freeReg(reg); |
| 814 | | 810 | |
| 815 | tracking_log.debug("{} => {} (live-out {})", .{ inst, self.*, tracked_inst }); | 811 | tracking_log.debug("{f} => {f} (live-out {f})", .{ inst, self.*, tracked_inst }); |
| 816 | } | 812 | } |
| 817 | } | 813 | } |
| 818 | | 814 | |
| 819 | pub fn format( | 815 | pub fn format(tracking: InstTracking, bw: *Writer, comptime _: []const u8) Writer.Error!void { |
| 820 | tracking: InstTracking, | 816 | if (!std.meta.eql(tracking.long, tracking.short)) try bw.print("|{f}| ", .{tracking.long}); |
| 821 | comptime _: []const u8, | 817 | try bw.print("{f}", .{tracking.short}); |
| 822 | _: std.fmt.FormatOptions, | | |
| 823 | writer: anytype, | | |
| 824 | ) @TypeOf(writer).Error!void { | | |
| 825 | if (!std.meta.eql(tracking.long, tracking.short)) try writer.print("|{}| ", .{tracking.long}); | | |
| 826 | try writer.print("{}", .{tracking.short}); | | |
| 827 | } | 818 | } |
| 828 | }; | 819 | }; |
| 829 | | 820 | |
| ... | @@ -939,7 +930,7 @@ pub fn generate( | ... | @@ -939,7 +930,7 @@ pub fn generate( |
| 939 | function.inst_tracking.putAssumeCapacityNoClobber(temp.toIndex(), .init(.none)); | 930 | function.inst_tracking.putAssumeCapacityNoClobber(temp.toIndex(), .init(.none)); |
| 940 | } | 931 | } |
| 941 | | 932 | |
| 942 | wip_mir_log.debug("{}:", .{fmtNav(func.owner_nav, ip)}); | 933 | wip_mir_log.debug("{f}:", .{fmtNav(func.owner_nav, ip)}); |
| 943 | | 934 | |
| 944 | try function.frame_allocs.resize(gpa, FrameIndex.named_count); | 935 | try function.frame_allocs.resize(gpa, FrameIndex.named_count); |
| 945 | function.frame_allocs.set( | 936 | function.frame_allocs.set( |
| ... | @@ -1097,15 +1088,10 @@ const FormatNavData = struct { | ... | @@ -1097,15 +1088,10 @@ const FormatNavData = struct { |
| 1097 | ip: *const InternPool, | 1088 | ip: *const InternPool, |
| 1098 | nav_index: InternPool.Nav.Index, | 1089 | nav_index: InternPool.Nav.Index, |
| 1099 | }; | 1090 | }; |
| 1100 | fn formatNav( | 1091 | fn formatNav(data: FormatNavData, w: *Writer) Writer.Error!void { |
| 1101 | data: FormatNavData, | 1092 | try w.print("{f}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)}); |
| 1102 | comptime _: []const u8, | | |
| 1103 | _: std.fmt.FormatOptions, | | |
| 1104 | writer: anytype, | | |
| 1105 | ) @TypeOf(writer).Error!void { | | |
| 1106 | try writer.print("{}", .{data.ip.getNav(data.nav_index).fqn.fmt(data.ip)}); | | |
| 1107 | } | 1093 | } |
| 1108 | fn fmtNav(nav_index: InternPool.Nav.Index, ip: *const InternPool) std.fmt.Formatter(formatNav) { | 1094 | fn fmtNav(nav_index: InternPool.Nav.Index, ip: *const InternPool) std.fmt.Formatter(FormatNavData, formatNav) { |
| 1109 | return .{ .data = .{ | 1095 | return .{ .data = .{ |
| 1110 | .ip = ip, | 1096 | .ip = ip, |
| 1111 | .nav_index = nav_index, | 1097 | .nav_index = nav_index, |
| ... | @@ -1116,15 +1102,14 @@ const FormatAirData = struct { | ... | @@ -1116,15 +1102,14 @@ const FormatAirData = struct { |
| 1116 | self: *CodeGen, | 1102 | self: *CodeGen, |
| 1117 | inst: Air.Inst.Index, | 1103 | inst: Air.Inst.Index, |
| 1118 | }; | 1104 | }; |
| 1119 | fn formatAir( | 1105 | fn formatAir(data: FormatAirData, w: *std.io.Writer) Writer.Error!void { |
| 1120 | data: FormatAirData, | 1106 | // not acceptable implementation because it ignores `w`: |
| 1121 | comptime _: []const u8, | 1107 | //data.self.air.dumpInst(data.inst, data.self.pt, data.self.liveness); |
| 1122 | _: std.fmt.FormatOptions, | 1108 | _ = data; |
| 1123 | writer: anytype, | 1109 | _ = w; |
| 1124 | ) @TypeOf(writer).Error!void { | 1110 | @panic("TODO: unimplemented"); |
| 1125 | data.self.air.dumpInst(data.inst, data.self.pt, data.self.liveness); | | |
| 1126 | } | 1111 | } |
| 1127 | fn fmtAir(self: *CodeGen, inst: Air.Inst.Index) std.fmt.Formatter(formatAir) { | 1112 | fn fmtAir(self: *CodeGen, inst: Air.Inst.Index) std.fmt.Formatter(FormatAirData, formatAir) { |
| 1128 | return .{ .data = .{ .self = self, .inst = inst } }; | 1113 | return .{ .data = .{ .self = self, .inst = inst } }; |
| 1129 | } | 1114 | } |
| 1130 | | 1115 | |
| ... | @@ -1132,12 +1117,7 @@ const FormatWipMirData = struct { | ... | @@ -1132,12 +1117,7 @@ const FormatWipMirData = struct { |
| 1132 | self: *CodeGen, | 1117 | self: *CodeGen, |
| 1133 | inst: Mir.Inst.Index, | 1118 | inst: Mir.Inst.Index, |
| 1134 | }; | 1119 | }; |
| 1135 | fn formatWipMir( | 1120 | fn formatWipMir(data: FormatWipMirData, w: *Writer) Writer.Error!void { |
| 1136 | data: FormatWipMirData, | | |
| 1137 | comptime _: []const u8, | | |
| 1138 | _: std.fmt.FormatOptions, | | |
| 1139 | writer: anytype, | | |
| 1140 | ) @TypeOf(writer).Error!void { | | |
| 1141 | var lower: Lower = .{ | 1121 | var lower: Lower = .{ |
| 1142 | .target = data.self.target, | 1122 | .target = data.self.target, |
| 1143 | .allocator = data.self.gpa, | 1123 | .allocator = data.self.gpa, |
| ... | @@ -1152,11 +1132,11 @@ fn formatWipMir( | ... | @@ -1152,11 +1132,11 @@ fn formatWipMir( |
| 1152 | lower.err_msg.?.deinit(data.self.gpa); | 1132 | lower.err_msg.?.deinit(data.self.gpa); |
| 1153 | lower.err_msg = null; | 1133 | lower.err_msg = null; |
| 1154 | } | 1134 | } |
| 1155 | try writer.writeAll(lower.err_msg.?.msg); | 1135 | try w.writeAll(lower.err_msg.?.msg); |
| 1156 | return; | 1136 | return; |
| 1157 | }, | 1137 | }, |
| 1158 | error.OutOfMemory, error.InvalidInstruction, error.CannotEncode => |e| { | 1138 | error.OutOfMemory, error.InvalidInstruction, error.CannotEncode => |e| { |
| 1159 | try writer.writeAll(switch (e) { | 1139 | try w.writeAll(switch (e) { |
| 1160 | error.OutOfMemory => "Out of memory", | 1140 | error.OutOfMemory => "Out of memory", |
| 1161 | error.InvalidInstruction => "CodeGen failed to find a viable instruction.", | 1141 | error.InvalidInstruction => "CodeGen failed to find a viable instruction.", |
| 1162 | error.CannotEncode => "CodeGen failed to encode the instruction.", | 1142 | error.CannotEncode => "CodeGen failed to encode the instruction.", |
| ... | @@ -1165,14 +1145,14 @@ fn formatWipMir( | ... | @@ -1165,14 +1145,14 @@ fn formatWipMir( |
| 1165 | }, | 1145 | }, |
| 1166 | else => |e| return e, | 1146 | else => |e| return e, |
| 1167 | }).insts) |lowered_inst| { | 1147 | }).insts) |lowered_inst| { |
| 1168 | if (!first) try writer.writeAll("\ndebug(wip_mir): "); | 1148 | if (!first) try w.writeAll("\ndebug(wip_mir): "); |
| 1169 | try writer.print(" | {}", .{lowered_inst}); | 1149 | try w.print(" | {f}", .{lowered_inst}); |
| 1170 | first = false; | 1150 | first = false; |
| 1171 | } | 1151 | } |
| 1172 | if (first) { | 1152 | if (first) { |
| 1173 | const ip = &data.self.pt.zcu.intern_pool; | 1153 | const ip = &data.self.pt.zcu.intern_pool; |
| 1174 | const mir_inst = lower.mir.instructions.get(data.inst); | 1154 | const mir_inst = lower.mir.instructions.get(data.inst); |
| 1175 | try writer.print(" | .{s}", .{@tagName(mir_inst.ops)}); | 1155 | try w.print(" | .{s}", .{@tagName(mir_inst.ops)}); |
| 1176 | switch (mir_inst.ops) { | 1156 | switch (mir_inst.ops) { |
| 1177 | else => unreachable, | 1157 | else => unreachable, |
| 1178 | .pseudo_dbg_prologue_end_none, | 1158 | .pseudo_dbg_prologue_end_none, |
| ... | @@ -1184,20 +1164,20 @@ fn formatWipMir( | ... | @@ -1184,20 +1164,20 @@ fn formatWipMir( |
| 1184 | .pseudo_dbg_var_none, | 1164 | .pseudo_dbg_var_none, |
| 1185 | .pseudo_dead_none, | 1165 | .pseudo_dead_none, |
| 1186 | => {}, | 1166 | => {}, |
| 1187 | .pseudo_dbg_line_stmt_line_column, .pseudo_dbg_line_line_column => try writer.print( | 1167 | .pseudo_dbg_line_stmt_line_column, .pseudo_dbg_line_line_column => try w.print( |
| 1188 | " {[line]d}, {[column]d}", | 1168 | " {[line]d}, {[column]d}", |
| 1189 | mir_inst.data.line_column, | 1169 | mir_inst.data.line_column, |
| 1190 | ), | 1170 | ), |
| 1191 | .pseudo_dbg_enter_inline_func, .pseudo_dbg_leave_inline_func => try writer.print(" {}", .{ | 1171 | .pseudo_dbg_enter_inline_func, .pseudo_dbg_leave_inline_func => try w.print(" {f}", .{ |
| 1192 | ip.getNav(ip.indexToKey(mir_inst.data.ip_index).func.owner_nav).name.fmt(ip), | 1172 | ip.getNav(ip.indexToKey(mir_inst.data.ip_index).func.owner_nav).name.fmt(ip), |
| 1193 | }), | 1173 | }), |
| 1194 | .pseudo_dbg_arg_i_s, .pseudo_dbg_var_i_s => try writer.print(" {d}", .{ | 1174 | .pseudo_dbg_arg_i_s, .pseudo_dbg_var_i_s => try w.print(" {d}", .{ |
| 1195 | @as(i32, @bitCast(mir_inst.data.i.i)), | 1175 | @as(i32, @bitCast(mir_inst.data.i.i)), |
| 1196 | }), | 1176 | }), |
| 1197 | .pseudo_dbg_arg_i_u, .pseudo_dbg_var_i_u => try writer.print(" {d}", .{ | 1177 | .pseudo_dbg_arg_i_u, .pseudo_dbg_var_i_u => try w.print(" {d}", .{ |
| 1198 | mir_inst.data.i.i, | 1178 | mir_inst.data.i.i, |
| 1199 | }), | 1179 | }), |
| 1200 | .pseudo_dbg_arg_i_64, .pseudo_dbg_var_i_64 => try writer.print(" {d}", .{ | 1180 | .pseudo_dbg_arg_i_64, .pseudo_dbg_var_i_64 => try w.print(" {d}", .{ |
| 1201 | mir_inst.data.i64, | 1181 | mir_inst.data.i64, |
| 1202 | }), | 1182 | }), |
| 1203 | .pseudo_dbg_arg_ro, .pseudo_dbg_var_ro => { | 1183 | .pseudo_dbg_arg_ro, .pseudo_dbg_var_ro => { |
| ... | @@ -1205,44 +1185,39 @@ fn formatWipMir( | ... | @@ -1205,44 +1185,39 @@ fn formatWipMir( |
| 1205 | .base = .{ .reg = mir_inst.data.ro.reg }, | 1185 | .base = .{ .reg = mir_inst.data.ro.reg }, |
| 1206 | .disp = mir_inst.data.ro.off, | 1186 | .disp = mir_inst.data.ro.off, |
| 1207 | }) }; | 1187 | }) }; |
| 1208 | try writer.print(" {}", .{mem_op.fmt(.m)}); | 1188 | try w.print(" {f}", .{mem_op.fmt(.m)}); |
| 1209 | }, | 1189 | }, |
| 1210 | .pseudo_dbg_arg_fa, .pseudo_dbg_var_fa => { | 1190 | .pseudo_dbg_arg_fa, .pseudo_dbg_var_fa => { |
| 1211 | const mem_op: encoder.Instruction.Operand = .{ .mem = .initSib(.qword, .{ | 1191 | const mem_op: encoder.Instruction.Operand = .{ .mem = .initSib(.qword, .{ |
| 1212 | .base = .{ .frame = mir_inst.data.fa.index }, | 1192 | .base = .{ .frame = mir_inst.data.fa.index }, |
| 1213 | .disp = mir_inst.data.fa.off, | 1193 | .disp = mir_inst.data.fa.off, |
| 1214 | }) }; | 1194 | }) }; |
| 1215 | try writer.print(" {}", .{mem_op.fmt(.m)}); | 1195 | try w.print(" {f}", .{mem_op.fmt(.m)}); |
| 1216 | }, | 1196 | }, |
| 1217 | .pseudo_dbg_arg_m, .pseudo_dbg_var_m => { | 1197 | .pseudo_dbg_arg_m, .pseudo_dbg_var_m => { |
| 1218 | const mem_op: encoder.Instruction.Operand = .{ | 1198 | const mem_op: encoder.Instruction.Operand = .{ |
| 1219 | .mem = lower.mir.extraData(Mir.Memory, mir_inst.data.x.payload).data.decode(), | 1199 | .mem = lower.mir.extraData(Mir.Memory, mir_inst.data.x.payload).data.decode(), |
| 1220 | }; | 1200 | }; |
| 1221 | try writer.print(" {}", .{mem_op.fmt(.m)}); | 1201 | try w.print(" {f}", .{mem_op.fmt(.m)}); |
| 1222 | }, | 1202 | }, |
| 1223 | .pseudo_dbg_arg_val, .pseudo_dbg_var_val => try writer.print(" {}", .{ | 1203 | .pseudo_dbg_arg_val, .pseudo_dbg_var_val => try w.print(" {}", .{ |
| 1224 | Value.fromInterned(mir_inst.data.ip_index).fmtValue(data.self.pt), | 1204 | Value.fromInterned(mir_inst.data.ip_index).fmtValue(data.self.pt), |
| 1225 | }), | 1205 | }), |
| 1226 | } | 1206 | } |
| 1227 | } | 1207 | } |
| 1228 | } | 1208 | } |
| 1229 | fn fmtWipMir(self: *CodeGen, inst: Mir.Inst.Index) std.fmt.Formatter(formatWipMir) { | 1209 | fn fmtWipMir(self: *CodeGen, inst: Mir.Inst.Index) std.fmt.Formatter(FormatWipMirData, formatWipMir) { |
| 1230 | return .{ .data = .{ .self = self, .inst = inst } }; | 1210 | return .{ .data = .{ .self = self, .inst = inst } }; |
| 1231 | } | 1211 | } |
| 1232 | | 1212 | |
| 1233 | const FormatTrackingData = struct { | 1213 | const FormatTrackingData = struct { |
| 1234 | self: *CodeGen, | 1214 | self: *CodeGen, |
| 1235 | }; | 1215 | }; |
| 1236 | fn formatTracking( | 1216 | fn formatTracking(data: FormatTrackingData, w: *Writer) Writer.Error!void { |
| 1237 | data: FormatTrackingData, | | |
| 1238 | comptime _: []const u8, | | |
| 1239 | _: std.fmt.FormatOptions, | | |
| 1240 | writer: anytype, | | |
| 1241 | ) @TypeOf(writer).Error!void { | | |
| 1242 | var it = data.self.inst_tracking.iterator(); | 1217 | var it = data.self.inst_tracking.iterator(); |
| 1243 | while (it.next()) |entry| try writer.print("\n{} = {}", .{ entry.key_ptr.*, entry.value_ptr.* }); | 1218 | while (it.next()) |entry| try w.print("\n{f} = {f}", .{ entry.key_ptr.*, entry.value_ptr.* }); |
| 1244 | } | 1219 | } |
| 1245 | fn fmtTracking(self: *CodeGen) std.fmt.Formatter(formatTracking) { | 1220 | fn fmtTracking(self: *CodeGen) std.fmt.Formatter(FormatTrackingData, formatTracking) { |
| 1246 | return .{ .data = .{ .self = self } }; | 1221 | return .{ .data = .{ .self = self } }; |
| 1247 | } | 1222 | } |
| 1248 | | 1223 | |
| ... | @@ -1251,7 +1226,7 @@ fn addInst(self: *CodeGen, inst: Mir.Inst) error{OutOfMemory}!Mir.Inst.Index { | ... | @@ -1251,7 +1226,7 @@ fn addInst(self: *CodeGen, inst: Mir.Inst) error{OutOfMemory}!Mir.Inst.Index { |
| 1251 | try self.mir_instructions.ensureUnusedCapacity(gpa, 1); | 1226 | try self.mir_instructions.ensureUnusedCapacity(gpa, 1); |
| 1252 | const result_index: Mir.Inst.Index = @intCast(self.mir_instructions.len); | 1227 | const result_index: Mir.Inst.Index = @intCast(self.mir_instructions.len); |
| 1253 | self.mir_instructions.appendAssumeCapacity(inst); | 1228 | self.mir_instructions.appendAssumeCapacity(inst); |
| 1254 | if (inst.ops != .pseudo_dead_none) wip_mir_log.debug("{}", .{self.fmtWipMir(result_index)}); | 1229 | if (inst.ops != .pseudo_dead_none) wip_mir_log.debug("{f}", .{self.fmtWipMir(result_index)}); |
| 1255 | return result_index; | 1230 | return result_index; |
| 1256 | } | 1231 | } |
| 1257 | | 1232 | |
| ... | @@ -2056,7 +2031,7 @@ fn gen( | ... | @@ -2056,7 +2031,7 @@ fn gen( |
| 2056 | .{}, | 2031 | .{}, |
| 2057 | ); | 2032 | ); |
| 2058 | self.ret_mcv.long = .{ .load_frame = .{ .index = frame_index } }; | 2033 | self.ret_mcv.long = .{ .load_frame = .{ .index = frame_index } }; |
| 2059 | tracking_log.debug("spill {} to {}", .{ self.ret_mcv.long, frame_index }); | 2034 | tracking_log.debug("spill {f} to {f}", .{ self.ret_mcv.long, frame_index }); |
| 2060 | }, | 2035 | }, |
| 2061 | else => unreachable, | 2036 | else => unreachable, |
| 2062 | } | 2037 | } |
| ... | @@ -2334,8 +2309,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -2334,8 +2309,8 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 2334 | | 2309 | |
| 2335 | for (body) |inst| { | 2310 | for (body) |inst| { |
| 2336 | if (cg.liveness.isUnused(inst) and !cg.air.mustLower(inst, ip)) continue; | 2311 | if (cg.liveness.isUnused(inst) and !cg.air.mustLower(inst, ip)) continue; |
| 2337 | wip_mir_log.debug("{}", .{cg.fmtAir(inst)}); | 2312 | wip_mir_log.debug("{f}", .{cg.fmtAir(inst)}); |
| 2338 | verbose_tracking_log.debug("{}", .{cg.fmtTracking()}); | 2313 | verbose_tracking_log.debug("{f}", .{cg.fmtTracking()}); |
| 2339 | | 2314 | |
| 2340 | cg.reused_operands = .initEmpty(); | 2315 | cg.reused_operands = .initEmpty(); |
| 2341 | try cg.inst_tracking.ensureUnusedCapacity(cg.gpa, 1); | 2316 | try cg.inst_tracking.ensureUnusedCapacity(cg.gpa, 1); |
| ... | @@ -4339,7 +4314,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -4339,7 +4314,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 4339 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 4314 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 4340 | } }, | 4315 | } }, |
| 4341 | } }) catch |err| switch (err) { | 4316 | } }) catch |err| switch (err) { |
| 4342 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 4317 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 4343 | @tagName(air_tag), | 4318 | @tagName(air_tag), |
| 4344 | cg.typeOf(bin_op.lhs).fmt(pt), | 4319 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 4345 | ops[0].tracking(cg), | 4320 | ops[0].tracking(cg), |
| ... | @@ -4351,7 +4326,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -4351,7 +4326,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 4351 | else => unreachable, | 4326 | else => unreachable, |
| 4352 | .add, .add_optimized => {}, | 4327 | .add, .add_optimized => {}, |
| 4353 | .add_wrap => res[0].wrapInt(cg) catch |err| switch (err) { | 4328 | .add_wrap => res[0].wrapInt(cg) catch |err| switch (err) { |
| 4354 | error.SelectFailed => return cg.fail("failed to select {s} wrap {} {}", .{ | 4329 | error.SelectFailed => return cg.fail("failed to select {s} wrap {f} {f}", .{ |
| 4355 | @tagName(air_tag), | 4330 | @tagName(air_tag), |
| 4356 | cg.typeOf(bin_op.lhs).fmt(pt), | 4331 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 4357 | res[0].tracking(cg), | 4332 | res[0].tracking(cg), |
| ... | @@ -14947,7 +14922,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -14947,7 +14922,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 14947 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 14922 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 14948 | } }, | 14923 | } }, |
| 14949 | } }) catch |err| switch (err) { | 14924 | } }) catch |err| switch (err) { |
| 14950 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 14925 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 14951 | @tagName(air_tag), | 14926 | @tagName(air_tag), |
| 14952 | cg.typeOf(bin_op.lhs).fmt(pt), | 14927 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 14953 | ops[0].tracking(cg), | 14928 | ops[0].tracking(cg), |
| ... | @@ -14959,7 +14934,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -14959,7 +14934,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 14959 | else => unreachable, | 14934 | else => unreachable, |
| 14960 | .sub, .sub_optimized => {}, | 14935 | .sub, .sub_optimized => {}, |
| 14961 | .sub_wrap => res[0].wrapInt(cg) catch |err| switch (err) { | 14936 | .sub_wrap => res[0].wrapInt(cg) catch |err| switch (err) { |
| 14962 | error.SelectFailed => return cg.fail("failed to select {s} wrap {} {}", .{ | 14937 | error.SelectFailed => return cg.fail("failed to select {s} wrap {f} {f}", .{ |
| 14963 | @tagName(air_tag), | 14938 | @tagName(air_tag), |
| 14964 | cg.typeOf(bin_op.lhs).fmt(pt), | 14939 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 14965 | res[0].tracking(cg), | 14940 | res[0].tracking(cg), |
| ... | @@ -24587,7 +24562,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -24587,7 +24562,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 24587 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 24562 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 24588 | } }, | 24563 | } }, |
| 24589 | } }) catch |err| switch (err) { | 24564 | } }) catch |err| switch (err) { |
| 24590 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 24565 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 24591 | @tagName(air_tag), | 24566 | @tagName(air_tag), |
| 24592 | ty.fmt(pt), | 24567 | ty.fmt(pt), |
| 24593 | ops[0].tracking(cg), | 24568 | ops[0].tracking(cg), |
| ... | @@ -27287,7 +27262,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -27287,7 +27262,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 27287 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 27262 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 27288 | } }, | 27263 | } }, |
| 27289 | } }) catch |err| switch (err) { | 27264 | } }) catch |err| switch (err) { |
| 27290 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 27265 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 27291 | @tagName(air_tag), | 27266 | @tagName(air_tag), |
| 27292 | ty.fmt(pt), | 27267 | ty.fmt(pt), |
| 27293 | ops[0].tracking(cg), | 27268 | ops[0].tracking(cg), |
| ... | @@ -27296,7 +27271,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -27296,7 +27271,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 27296 | else => |e| return e, | 27271 | else => |e| return e, |
| 27297 | }; | 27272 | }; |
| 27298 | res[0].wrapInt(cg) catch |err| switch (err) { | 27273 | res[0].wrapInt(cg) catch |err| switch (err) { |
| 27299 | error.SelectFailed => return cg.fail("failed to select {s} wrap {} {}", .{ | 27274 | error.SelectFailed => return cg.fail("failed to select {s} wrap {f} {f}", .{ |
| 27300 | @tagName(air_tag), | 27275 | @tagName(air_tag), |
| 27301 | cg.typeOf(bin_op.lhs).fmt(pt), | 27276 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 27302 | res[0].tracking(cg), | 27277 | res[0].tracking(cg), |
| ... | @@ -33606,7 +33581,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -33606,7 +33581,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 33606 | assert(air_tag == .div_exact); | 33581 | assert(air_tag == .div_exact); |
| 33607 | res[0] = ops[0].divTruncInts(&ops[1], cg) catch |err| break :err err; | 33582 | res[0] = ops[0].divTruncInts(&ops[1], cg) catch |err| break :err err; |
| 33608 | }) catch |err| switch (err) { | 33583 | }) catch |err| switch (err) { |
| 33609 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 33584 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 33610 | @tagName(air_tag), | 33585 | @tagName(air_tag), |
| 33611 | ty.fmt(pt), | 33586 | ty.fmt(pt), |
| 33612 | ops[0].tracking(cg), | 33587 | ops[0].tracking(cg), |
| ... | @@ -34837,7 +34812,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -34837,7 +34812,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 34837 | } }) else err: { | 34812 | } }) else err: { |
| 34838 | res[0] = ops[0].divTruncInts(&ops[1], cg) catch |err| break :err err; | 34813 | res[0] = ops[0].divTruncInts(&ops[1], cg) catch |err| break :err err; |
| 34839 | }) catch |err| switch (err) { | 34814 | }) catch |err| switch (err) { |
| 34840 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 34815 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 34841 | @tagName(air_tag), | 34816 | @tagName(air_tag), |
| 34842 | ty.fmt(pt), | 34817 | ty.fmt(pt), |
| 34843 | ops[0].tracking(cg), | 34818 | ops[0].tracking(cg), |
| ... | @@ -36148,7 +36123,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -36148,7 +36123,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 36148 | } }, | 36123 | } }, |
| 36149 | } }, | 36124 | } }, |
| 36150 | }) catch |err| switch (err) { | 36125 | }) catch |err| switch (err) { |
| 36151 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 36126 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 36152 | @tagName(air_tag), | 36127 | @tagName(air_tag), |
| 36153 | cg.typeOf(bin_op.lhs).fmt(pt), | 36128 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 36154 | ops[0].tracking(cg), | 36129 | ops[0].tracking(cg), |
| ... | @@ -37614,7 +37589,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -37614,7 +37589,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 37614 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 37589 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 37615 | } }, | 37590 | } }, |
| 37616 | } })) catch |err| switch (err) { | 37591 | } })) catch |err| switch (err) { |
| 37617 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 37592 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 37618 | @tagName(air_tag), | 37593 | @tagName(air_tag), |
| 37619 | ty.fmt(pt), | 37594 | ty.fmt(pt), |
| 37620 | ops[0].tracking(cg), | 37595 | ops[0].tracking(cg), |
| ... | @@ -39248,7 +39223,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -39248,7 +39223,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 39248 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 39223 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 39249 | } }, | 39224 | } }, |
| 39250 | } }) catch |err| switch (err) { | 39225 | } }) catch |err| switch (err) { |
| 39251 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 39226 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 39252 | @tagName(air_tag), | 39227 | @tagName(air_tag), |
| 39253 | cg.typeOf(bin_op.lhs).fmt(pt), | 39228 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 39254 | ops[0].tracking(cg), | 39229 | ops[0].tracking(cg), |
| ... | @@ -42077,7 +42052,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -42077,7 +42052,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 42077 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 42052 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 42078 | } }, | 42053 | } }, |
| 42079 | } }) catch |err| switch (err) { | 42054 | } }) catch |err| switch (err) { |
| 42080 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 42055 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 42081 | @tagName(air_tag), | 42056 | @tagName(air_tag), |
| 42082 | cg.typeOf(bin_op.lhs).fmt(pt), | 42057 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 42083 | ops[0].tracking(cg), | 42058 | ops[0].tracking(cg), |
| ... | @@ -42191,7 +42166,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -42191,7 +42166,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 42191 | .{ ._, ._, .lea, .dst0p, .leai(.src0, .dst0), ._, ._ }, | 42166 | .{ ._, ._, .lea, .dst0p, .leai(.src0, .dst0), ._, ._ }, |
| 42192 | } }, | 42167 | } }, |
| 42193 | } }) catch |err| switch (err) { | 42168 | } }) catch |err| switch (err) { |
| 42194 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 42169 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 42195 | @tagName(air_tag), | 42170 | @tagName(air_tag), |
| 42196 | cg.typeOf(bin_op.lhs).fmt(pt), | 42171 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 42197 | ops[0].tracking(cg), | 42172 | ops[0].tracking(cg), |
| ... | @@ -42320,7 +42295,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -42320,7 +42295,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 42320 | .{ ._, ._, .lea, .dst0p, .leai(.src0, .dst0), ._, ._ }, | 42295 | .{ ._, ._, .lea, .dst0p, .leai(.src0, .dst0), ._, ._ }, |
| 42321 | } }, | 42296 | } }, |
| 42322 | } }) catch |err| switch (err) { | 42297 | } }) catch |err| switch (err) { |
| 42323 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 42298 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 42324 | @tagName(air_tag), | 42299 | @tagName(air_tag), |
| 42325 | cg.typeOf(bin_op.lhs).fmt(pt), | 42300 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 42326 | ops[0].tracking(cg), | 42301 | ops[0].tracking(cg), |
| ... | @@ -46485,7 +46460,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -46485,7 +46460,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 46485 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 46460 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 46486 | } }, | 46461 | } }, |
| 46487 | } }) catch |err| switch (err) { | 46462 | } }) catch |err| switch (err) { |
| 46488 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 46463 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 46489 | @tagName(air_tag), | 46464 | @tagName(air_tag), |
| 46490 | cg.typeOf(bin_op.lhs).fmt(pt), | 46465 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 46491 | ops[0].tracking(cg), | 46466 | ops[0].tracking(cg), |
| ... | @@ -50644,7 +50619,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -50644,7 +50619,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 50644 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 50619 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 50645 | } }, | 50620 | } }, |
| 50646 | } }) catch |err| switch (err) { | 50621 | } }) catch |err| switch (err) { |
| 50647 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 50622 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 50648 | @tagName(air_tag), | 50623 | @tagName(air_tag), |
| 50649 | cg.typeOf(bin_op.lhs).fmt(pt), | 50624 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 50650 | ops[0].tracking(cg), | 50625 | ops[0].tracking(cg), |
| ... | @@ -51493,7 +51468,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -51493,7 +51468,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 51493 | .{ ._, ._, .mov, .memad(.dst0q, .add_src0_size, -8), .tmp0q, ._, ._ }, | 51468 | .{ ._, ._, .mov, .memad(.dst0q, .add_src0_size, -8), .tmp0q, ._, ._ }, |
| 51494 | } }, | 51469 | } }, |
| 51495 | } }) catch |err| switch (err) { | 51470 | } }) catch |err| switch (err) { |
| 51496 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 51471 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 51497 | @tagName(air_tag), | 51472 | @tagName(air_tag), |
| 51498 | ty_pl.ty.toType().fmt(pt), | 51473 | ty_pl.ty.toType().fmt(pt), |
| 51499 | ops[0].tracking(cg), | 51474 | ops[0].tracking(cg), |
| ... | @@ -52398,7 +52373,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -52398,7 +52373,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 52398 | .{ ._, ._, .mov, .memad(.dst0q, .add_src0_size, -8), .tmp0q, ._, ._ }, | 52373 | .{ ._, ._, .mov, .memad(.dst0q, .add_src0_size, -8), .tmp0q, ._, ._ }, |
| 52399 | } }, | 52374 | } }, |
| 52400 | } }) catch |err| switch (err) { | 52375 | } }) catch |err| switch (err) { |
| 52401 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 52376 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 52402 | @tagName(air_tag), | 52377 | @tagName(air_tag), |
| 52403 | ty_pl.ty.toType().fmt(pt), | 52378 | ty_pl.ty.toType().fmt(pt), |
| 52404 | ops[0].tracking(cg), | 52379 | ops[0].tracking(cg), |
| ... | @@ -55995,7 +55970,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -55995,7 +55970,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 55995 | .{ ._, ._, .@"or", .tmp2q, .tmp1q, ._, ._ }, | 55970 | .{ ._, ._, .@"or", .tmp2q, .tmp1q, ._, ._ }, |
| 55996 | } }, | 55971 | } }, |
| 55997 | } }) catch |err| switch (err) { | 55972 | } }) catch |err| switch (err) { |
| 55998 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 55973 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 55999 | @tagName(air_tag), | 55974 | @tagName(air_tag), |
| 56000 | ty_pl.ty.toType().fmt(pt), | 55975 | ty_pl.ty.toType().fmt(pt), |
| 56001 | ops[0].tracking(cg), | 55976 | ops[0].tracking(cg), |
| ... | @@ -59735,7 +59710,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -59735,7 +59710,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 59735 | } }, | 59710 | } }, |
| 59736 | } }, | 59711 | } }, |
| 59737 | }) catch |err| switch (err) { | 59712 | }) catch |err| switch (err) { |
| 59738 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 59713 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 59739 | @tagName(air_tag), | 59714 | @tagName(air_tag), |
| 59740 | cg.typeOf(bin_op.lhs).fmt(pt), | 59715 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 59741 | ops[0].tracking(cg), | 59716 | ops[0].tracking(cg), |
| ... | @@ -60298,7 +60273,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -60298,7 +60273,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 60298 | .{ ._, ._nz, .j, .@"0b", ._, ._, ._ }, | 60273 | .{ ._, ._nz, .j, .@"0b", ._, ._, ._ }, |
| 60299 | } }, | 60274 | } }, |
| 60300 | } }) catch |err| switch (err) { | 60275 | } }) catch |err| switch (err) { |
| 60301 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {} {}", .{ | 60276 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f} {f}", .{ |
| 60302 | @tagName(air_tag), | 60277 | @tagName(air_tag), |
| 60303 | cg.typeOf(bin_op.lhs).fmt(pt), | 60278 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 60304 | cg.typeOf(bin_op.rhs).fmt(pt), | 60279 | cg.typeOf(bin_op.rhs).fmt(pt), |
| ... | @@ -60660,7 +60635,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -60660,7 +60635,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 60660 | .{ ._, ._ns, .j, .@"0b", ._, ._, ._ }, | 60635 | .{ ._, ._ns, .j, .@"0b", ._, ._, ._ }, |
| 60661 | } }, | 60636 | } }, |
| 60662 | } }) catch |err| switch (err) { | 60637 | } }) catch |err| switch (err) { |
| 60663 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {} {}", .{ | 60638 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f} {f}", .{ |
| 60664 | @tagName(air_tag), | 60639 | @tagName(air_tag), |
| 60665 | cg.typeOf(bin_op.lhs).fmt(pt), | 60640 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 60666 | cg.typeOf(bin_op.rhs).fmt(pt), | 60641 | cg.typeOf(bin_op.rhs).fmt(pt), |
| ... | @@ -60672,7 +60647,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -60672,7 +60647,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 60672 | switch (air_tag) { | 60647 | switch (air_tag) { |
| 60673 | else => unreachable, | 60648 | else => unreachable, |
| 60674 | .shl => res[0].wrapInt(cg) catch |err| switch (err) { | 60649 | .shl => res[0].wrapInt(cg) catch |err| switch (err) { |
| 60675 | error.SelectFailed => return cg.fail("failed to select {s} wrap {} {}", .{ | 60650 | error.SelectFailed => return cg.fail("failed to select {s} wrap {f} {f}", .{ |
| 60676 | @tagName(air_tag), | 60651 | @tagName(air_tag), |
| 60677 | cg.typeOf(bin_op.lhs).fmt(pt), | 60652 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 60678 | res[0].tracking(cg), | 60653 | res[0].tracking(cg), |
| ... | @@ -65329,7 +65304,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -65329,7 +65304,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 65329 | .{ ._, ._b, .j, .@"0b", ._, ._, ._ }, | 65304 | .{ ._, ._b, .j, .@"0b", ._, ._, ._ }, |
| 65330 | } }, | 65305 | } }, |
| 65331 | } }) catch |err| switch (err) { | 65306 | } }) catch |err| switch (err) { |
| 65332 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 65307 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 65333 | @tagName(air_tag), | 65308 | @tagName(air_tag), |
| 65334 | ty_op.ty.toType().fmt(pt), | 65309 | ty_op.ty.toType().fmt(pt), |
| 65335 | ops[0].tracking(cg), | 65310 | ops[0].tracking(cg), |
| ... | @@ -68483,7 +68458,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -68483,7 +68458,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 68483 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 68458 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 68484 | } }, | 68459 | } }, |
| 68485 | } }) catch |err| switch (err) { | 68460 | } }) catch |err| switch (err) { |
| 68486 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 68461 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 68487 | @tagName(air_tag), | 68462 | @tagName(air_tag), |
| 68488 | cg.typeOf(ty_op.operand).fmt(pt), | 68463 | cg.typeOf(ty_op.operand).fmt(pt), |
| 68489 | ops[0].tracking(cg), | 68464 | ops[0].tracking(cg), |
| ... | @@ -68880,7 +68855,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -68880,7 +68855,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 68880 | .{ .@"0:", ._, .lea, .dst0d, .leasia(.dst0, .@"8", .tmp0, .add_8_src0_size), ._, ._ }, | 68855 | .{ .@"0:", ._, .lea, .dst0d, .leasia(.dst0, .@"8", .tmp0, .add_8_src0_size), ._, ._ }, |
| 68881 | } }, | 68856 | } }, |
| 68882 | } }) catch |err| switch (err) { | 68857 | } }) catch |err| switch (err) { |
| 68883 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 68858 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 68884 | @tagName(air_tag), | 68859 | @tagName(air_tag), |
| 68885 | cg.typeOf(ty_op.operand).fmt(pt), | 68860 | cg.typeOf(ty_op.operand).fmt(pt), |
| 68886 | ops[0].tracking(cg), | 68861 | ops[0].tracking(cg), |
| ... | @@ -69768,7 +69743,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -69768,7 +69743,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 69768 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 69743 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 69769 | } }, | 69744 | } }, |
| 69770 | } }) catch |err| switch (err) { | 69745 | } }) catch |err| switch (err) { |
| 69771 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 69746 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 69772 | @tagName(air_tag), | 69747 | @tagName(air_tag), |
| 69773 | cg.typeOf(ty_op.operand).fmt(pt), | 69748 | cg.typeOf(ty_op.operand).fmt(pt), |
| 69774 | ops[0].tracking(cg), | 69749 | ops[0].tracking(cg), |
| ... | @@ -70417,7 +70392,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -70417,7 +70392,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 70417 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 70392 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 70418 | } }, | 70393 | } }, |
| 70419 | } }) catch |err| switch (err) { | 70394 | } }) catch |err| switch (err) { |
| 70420 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 70395 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 70421 | @tagName(air_tag), | 70396 | @tagName(air_tag), |
| 70422 | ty_op.ty.toType().fmt(pt), | 70397 | ty_op.ty.toType().fmt(pt), |
| 70423 | ops[0].tracking(cg), | 70398 | ops[0].tracking(cg), |
| ... | @@ -73519,7 +73494,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -73519,7 +73494,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 73519 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 73494 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 73520 | } }, | 73495 | } }, |
| 73521 | } }) catch |err| switch (err) { | 73496 | } }) catch |err| switch (err) { |
| 73522 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 73497 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 73523 | @tagName(air_tag), | 73498 | @tagName(air_tag), |
| 73524 | ty_op.ty.toType().fmt(pt), | 73499 | ty_op.ty.toType().fmt(pt), |
| 73525 | ops[0].tracking(cg), | 73500 | ops[0].tracking(cg), |
| ... | @@ -74457,7 +74432,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -74457,7 +74432,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 74457 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 74432 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 74458 | } }, | 74433 | } }, |
| 74459 | } }) catch |err| switch (err) { | 74434 | } }) catch |err| switch (err) { |
| 74460 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 74435 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 74461 | @tagName(air_tag), | 74436 | @tagName(air_tag), |
| 74462 | cg.typeOf(un_op).fmt(pt), | 74437 | cg.typeOf(un_op).fmt(pt), |
| 74463 | ops[0].tracking(cg), | 74438 | ops[0].tracking(cg), |
| ... | @@ -75183,7 +75158,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -75183,7 +75158,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 75183 | } }, | 75158 | } }, |
| 75184 | } }, | 75159 | } }, |
| 75185 | }) catch |err| switch (err) { | 75160 | }) catch |err| switch (err) { |
| 75186 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 75161 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 75187 | @tagName(air_tag), | 75162 | @tagName(air_tag), |
| 75188 | cg.typeOf(un_op).fmt(pt), | 75163 | cg.typeOf(un_op).fmt(pt), |
| 75189 | ops[0].tracking(cg), | 75164 | ops[0].tracking(cg), |
| ... | @@ -76734,7 +76709,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -76734,7 +76709,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 76734 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 76709 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 76735 | } }, | 76710 | } }, |
| 76736 | } }) catch |err| switch (err) { | 76711 | } }) catch |err| switch (err) { |
| 76737 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 76712 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 76738 | @tagName(air_tag), | 76713 | @tagName(air_tag), |
| 76739 | cg.typeOf(ty_op.operand).fmt(pt), | 76714 | cg.typeOf(ty_op.operand).fmt(pt), |
| 76740 | ops[0].tracking(cg), | 76715 | ops[0].tracking(cg), |
| ... | @@ -77926,7 +77901,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -77926,7 +77901,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 77926 | } }, | 77901 | } }, |
| 77927 | } }, | 77902 | } }, |
| 77928 | }) catch |err| switch (err) { | 77903 | }) catch |err| switch (err) { |
| 77929 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 77904 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 77930 | @tagName(air_tag), | 77905 | @tagName(air_tag), |
| 77931 | cg.typeOf(un_op).fmt(pt), | 77906 | cg.typeOf(un_op).fmt(pt), |
| 77932 | ops[0].tracking(cg), | 77907 | ops[0].tracking(cg), |
| ... | @@ -78466,7 +78441,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -78466,7 +78441,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 78466 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, | 78441 | .{ ._, ._nc, .j, .@"0b", ._, ._, ._ }, |
| 78467 | } }, | 78442 | } }, |
| 78468 | } }) catch |err| switch (err) { | 78443 | } }) catch |err| switch (err) { |
| 78469 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 78444 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 78470 | @tagName(air_tag), | 78445 | @tagName(air_tag), |
| 78471 | cg.typeOf(un_op).fmt(pt), | 78446 | cg.typeOf(un_op).fmt(pt), |
| 78472 | ops[0].tracking(cg), | 78447 | ops[0].tracking(cg), |
| ... | @@ -78913,7 +78888,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -78913,7 +78888,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 78913 | } else err: { | 78888 | } else err: { |
| 78914 | res[0] = ops[0].cmpInts(cmp_op, &ops[1], cg) catch |err| break :err err; | 78889 | res[0] = ops[0].cmpInts(cmp_op, &ops[1], cg) catch |err| break :err err; |
| 78915 | }) catch |err| switch (err) { | 78890 | }) catch |err| switch (err) { |
| 78916 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 78891 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 78917 | @tagName(air_tag), | 78892 | @tagName(air_tag), |
| 78918 | cg.typeOf(bin_op.lhs).fmt(pt), | 78893 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 78919 | ops[0].tracking(cg), | 78894 | ops[0].tracking(cg), |
| ... | @@ -79470,7 +79445,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -79470,7 +79445,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 79470 | res[0] = ops[0].cmpInts(cmp_op, &ops[1], cg) catch |err| break :err err; | 79445 | res[0] = ops[0].cmpInts(cmp_op, &ops[1], cg) catch |err| break :err err; |
| 79471 | }, | 79446 | }, |
| 79472 | }) catch |err| switch (err) { | 79447 | }) catch |err| switch (err) { |
| 79473 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 79448 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 79474 | @tagName(air_tag), | 79449 | @tagName(air_tag), |
| 79475 | ty.fmt(pt), | 79450 | ty.fmt(pt), |
| 79476 | ops[0].tracking(cg), | 79451 | ops[0].tracking(cg), |
| ... | @@ -88546,7 +88521,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -88546,7 +88521,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 88546 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 88521 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 88547 | } }, | 88522 | } }, |
| 88548 | } }) catch |err| switch (err) { | 88523 | } }) catch |err| switch (err) { |
| 88549 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 88524 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 88550 | @tagName(air_tag), | 88525 | @tagName(air_tag), |
| 88551 | ty_op.ty.toType().fmt(pt), | 88526 | ty_op.ty.toType().fmt(pt), |
| 88552 | cg.typeOf(ty_op.operand).fmt(pt), | 88527 | cg.typeOf(ty_op.operand).fmt(pt), |
| ... | @@ -90221,7 +90196,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -90221,7 +90196,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 90221 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 90196 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 90222 | } }, | 90197 | } }, |
| 90223 | } }) catch |err| switch (err) { | 90198 | } }) catch |err| switch (err) { |
| 90224 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 90199 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 90225 | @tagName(air_tag), | 90200 | @tagName(air_tag), |
| 90226 | ty_op.ty.toType().fmt(pt), | 90201 | ty_op.ty.toType().fmt(pt), |
| 90227 | cg.typeOf(ty_op.operand).fmt(pt), | 90202 | cg.typeOf(ty_op.operand).fmt(pt), |
| ... | @@ -94899,7 +94874,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -94899,7 +94874,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 94899 | .{ ._, ._nz, .j, .@"0b", ._, ._, ._ }, | 94874 | .{ ._, ._nz, .j, .@"0b", ._, ._, ._ }, |
| 94900 | } }, | 94875 | } }, |
| 94901 | } }) catch |err| switch (err) { | 94876 | } }) catch |err| switch (err) { |
| 94902 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 94877 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 94903 | @tagName(air_tag), | 94878 | @tagName(air_tag), |
| 94904 | dst_ty.fmt(pt), | 94879 | dst_ty.fmt(pt), |
| 94905 | src_ty.fmt(pt), | 94880 | src_ty.fmt(pt), |
| ... | @@ -100565,7 +100540,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -100565,7 +100540,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 100565 | .{ ._, ._nz, .j, .@"0b", ._, ._, ._ }, | 100540 | .{ ._, ._nz, .j, .@"0b", ._, ._, ._ }, |
| 100566 | } }, | 100541 | } }, |
| 100567 | } }) catch |err| switch (err) { | 100542 | } }) catch |err| switch (err) { |
| 100568 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 100543 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 100569 | @tagName(air_tag), | 100544 | @tagName(air_tag), |
| 100570 | ty_op.ty.toType().fmt(pt), | 100545 | ty_op.ty.toType().fmt(pt), |
| 100571 | cg.typeOf(ty_op.operand).fmt(pt), | 100546 | cg.typeOf(ty_op.operand).fmt(pt), |
| ... | @@ -111427,7 +111402,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -111427,7 +111402,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 111427 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 111402 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 111428 | } }, | 111403 | } }, |
| 111429 | } }) catch |err| switch (err) { | 111404 | } }) catch |err| switch (err) { |
| 111430 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 111405 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 111431 | @tagName(air_tag), | 111406 | @tagName(air_tag), |
| 111432 | ty_op.ty.toType().fmt(pt), | 111407 | ty_op.ty.toType().fmt(pt), |
| 111433 | cg.typeOf(ty_op.operand).fmt(pt), | 111408 | cg.typeOf(ty_op.operand).fmt(pt), |
| ... | @@ -123446,7 +123421,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -123446,7 +123421,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 123446 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 123421 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 123447 | } }, | 123422 | } }, |
| 123448 | } }) catch |err| switch (err) { | 123423 | } }) catch |err| switch (err) { |
| 123449 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {}", .{ | 123424 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f}", .{ |
| 123450 | @tagName(air_tag), | 123425 | @tagName(air_tag), |
| 123451 | ty_op.ty.toType().fmt(pt), | 123426 | ty_op.ty.toType().fmt(pt), |
| 123452 | cg.typeOf(ty_op.operand).fmt(pt), | 123427 | cg.typeOf(ty_op.operand).fmt(pt), |
| ... | @@ -166464,7 +166439,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -166464,7 +166439,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 166464 | .{ ._, ._, .@"test", .src0p, .src0p, ._, ._ }, | 166439 | .{ ._, ._, .@"test", .src0p, .src0p, ._, ._ }, |
| 166465 | } }, | 166440 | } }, |
| 166466 | } }) catch |err| switch (err) { | 166441 | } }) catch |err| switch (err) { |
| 166467 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 166442 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 166468 | @tagName(air_tag), | 166443 | @tagName(air_tag), |
| 166469 | cg.typeOf(un_op).fmt(pt), | 166444 | cg.typeOf(un_op).fmt(pt), |
| 166470 | ops[0].tracking(cg), | 166445 | ops[0].tracking(cg), |
| ... | @@ -166552,7 +166527,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -166552,7 +166527,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 166552 | .{ ._, ._, .call, .tmp0d, ._, ._, ._ }, | 166527 | .{ ._, ._, .call, .tmp0d, ._, ._, ._ }, |
| 166553 | } }, | 166528 | } }, |
| 166554 | } }) catch |err| switch (err) { | 166529 | } }) catch |err| switch (err) { |
| 166555 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 166530 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 166556 | @tagName(air_tag), | 166531 | @tagName(air_tag), |
| 166557 | cg.typeOf(un_op).fmt(pt), | 166532 | cg.typeOf(un_op).fmt(pt), |
| 166558 | ops[0].tracking(cg), | 166533 | ops[0].tracking(cg), |
| ... | @@ -166654,7 +166629,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -166654,7 +166629,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 166654 | .{ ._, ._, .lea, .dst1d, .leai(.dst1, .tmp1), ._, ._ }, | 166629 | .{ ._, ._, .lea, .dst1d, .leai(.dst1, .tmp1), ._, ._ }, |
| 166655 | } }, | 166630 | } }, |
| 166656 | } }) catch |err| switch (err) { | 166631 | } }) catch |err| switch (err) { |
| 166657 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 166632 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 166658 | @tagName(air_tag), | 166633 | @tagName(air_tag), |
| 166659 | cg.typeOf(un_op).fmt(pt), | 166634 | cg.typeOf(un_op).fmt(pt), |
| 166660 | ops[0].tracking(cg), | 166635 | ops[0].tracking(cg), |
| ... | @@ -166752,7 +166727,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -166752,7 +166727,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 166752 | .{ ._, ._, .@"test", .src0d, .src0d, ._, ._ }, | 166727 | .{ ._, ._, .@"test", .src0d, .src0d, ._, ._ }, |
| 166753 | } }, | 166728 | } }, |
| 166754 | } }) catch |err| switch (err) { | 166729 | } }) catch |err| switch (err) { |
| 166755 | error.SelectFailed => return cg.fail("failed to select {s} {} {}", .{ | 166730 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f}", .{ |
| 166756 | @tagName(air_tag), | 166731 | @tagName(air_tag), |
| 166757 | ty_op.ty.toType().fmt(pt), | 166732 | ty_op.ty.toType().fmt(pt), |
| 166758 | ops[0].tracking(cg), | 166733 | ops[0].tracking(cg), |
| ... | @@ -166804,7 +166779,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -166804,7 +166779,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 166804 | } | 166779 | } |
| 166805 | } | 166780 | } |
| 166806 | }, | 166781 | }, |
| 166807 | .@"packed" => return cg.fail("failed to select {s} {}", .{ | 166782 | .@"packed" => return cg.fail("failed to select {s} {f}", .{ |
| 166808 | @tagName(air_tag), | 166783 | @tagName(air_tag), |
| 166809 | agg_ty.fmt(pt), | 166784 | agg_ty.fmt(pt), |
| 166810 | }), | 166785 | }), |
| ... | @@ -166825,7 +166800,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -166825,7 +166800,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 166825 | elem_disp += @intCast(field_type.abiSize(zcu)); | 166800 | elem_disp += @intCast(field_type.abiSize(zcu)); |
| 166826 | } | 166801 | } |
| 166827 | }, | 166802 | }, |
| 166828 | else => return cg.fail("failed to select {s} {}", .{ | 166803 | else => return cg.fail("failed to select {s} {f}", .{ |
| 166829 | @tagName(air_tag), | 166804 | @tagName(air_tag), |
| 166830 | agg_ty.fmt(pt), | 166805 | agg_ty.fmt(pt), |
| 166831 | }), | 166806 | }), |
| ... | @@ -168123,7 +168098,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -168123,7 +168098,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 168123 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, | 168098 | .{ ._, ._ae, .j, .@"0b", ._, ._, ._ }, |
| 168124 | } }, | 168099 | } }, |
| 168125 | } }) catch |err| switch (err) { | 168100 | } }) catch |err| switch (err) { |
| 168126 | error.SelectFailed => return cg.fail("failed to select {s} {} {} {} {}", .{ | 168101 | error.SelectFailed => return cg.fail("failed to select {s} {f} {f} {f} {f}", .{ |
| 168127 | @tagName(air_tag), | 168102 | @tagName(air_tag), |
| 168128 | cg.typeOf(bin_op.lhs).fmt(pt), | 168103 | cg.typeOf(bin_op.lhs).fmt(pt), |
| 168129 | ops[0].tracking(cg), | 168104 | ops[0].tracking(cg), |
| ... | @@ -168223,7 +168198,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -168223,7 +168198,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 168223 | .{ ._, ._, .cmp, .src0d, .lea(.tmp1d), ._, ._ }, | 168198 | .{ ._, ._, .cmp, .src0d, .lea(.tmp1d), ._, ._ }, |
| 168224 | } }, | 168199 | } }, |
| 168225 | } }) catch |err| switch (err) { | 168200 | } }) catch |err| switch (err) { |
| 168226 | error.SelectFailed => return cg.fail("failed to select {s} {}", .{ | 168201 | error.SelectFailed => return cg.fail("failed to select {s} {f}", .{ |
| 168227 | @tagName(air_tag), | 168202 | @tagName(air_tag), |
| 168228 | ops[0].tracking(cg), | 168203 | ops[0].tracking(cg), |
| 168229 | }), | 168204 | }), |
| ... | @@ -168242,12 +168217,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -168242,12 +168217,12 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 168242 | .ref => { | 168217 | .ref => { |
| 168243 | const result = try cg.allocRegOrMem(err_ret_trace_index, true); | 168218 | const result = try cg.allocRegOrMem(err_ret_trace_index, true); |
| 168244 | try cg.genCopy(.usize, result, ops[0].tracking(cg).short, .{}); | 168219 | try cg.genCopy(.usize, result, ops[0].tracking(cg).short, .{}); |
| 168245 | tracking_log.debug("{} => {} (birth)", .{ err_ret_trace_index, result }); | 168220 | tracking_log.debug("{f} => {f} (birth)", .{ err_ret_trace_index, result }); |
| 168246 | cg.inst_tracking.putAssumeCapacityNoClobber(err_ret_trace_index, .init(result)); | 168221 | cg.inst_tracking.putAssumeCapacityNoClobber(err_ret_trace_index, .init(result)); |
| 168247 | }, | 168222 | }, |
| 168248 | .temp => |temp_index| { | 168223 | .temp => |temp_index| { |
| 168249 | const temp_tracking = temp_index.tracking(cg); | 168224 | const temp_tracking = temp_index.tracking(cg); |
| 168250 | tracking_log.debug("{} => {} (birth)", .{ err_ret_trace_index, temp_tracking.short }); | 168225 | tracking_log.debug("{f} => {f} (birth)", .{ err_ret_trace_index, temp_tracking.short }); |
| 168251 | cg.inst_tracking.putAssumeCapacityNoClobber(err_ret_trace_index, temp_tracking.*); | 168226 | cg.inst_tracking.putAssumeCapacityNoClobber(err_ret_trace_index, temp_tracking.*); |
| 168252 | assert(cg.reuseTemp(err_ret_trace_index, temp_index.toIndex(), temp_tracking)); | 168227 | assert(cg.reuseTemp(err_ret_trace_index, temp_index.toIndex(), temp_tracking)); |
| 168253 | }, | 168228 | }, |
| ... | @@ -168917,7 +168892,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -168917,7 +168892,7 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void { |
| 168917 | try cg.resetTemps(@enumFromInt(0)); | 168892 | try cg.resetTemps(@enumFromInt(0)); |
| 168918 | cg.checkInvariantsAfterAirInst(); | 168893 | cg.checkInvariantsAfterAirInst(); |
| 168919 | } | 168894 | } |
| 168920 | verbose_tracking_log.debug("{}", .{cg.fmtTracking()}); | 168895 | verbose_tracking_log.debug("{f}", .{cg.fmtTracking()}); |
| 168921 | } | 168896 | } |
| 168922 | | 168897 | |
| 168923 | fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { | 168898 | fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { |
| ... | @@ -168927,7 +168902,7 @@ fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { | ... | @@ -168927,7 +168902,7 @@ fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { |
| 168927 | switch (ip.indexToKey(lazy_sym.ty)) { | 168902 | switch (ip.indexToKey(lazy_sym.ty)) { |
| 168928 | .enum_type => { | 168903 | .enum_type => { |
| 168929 | const enum_ty: Type = .fromInterned(lazy_sym.ty); | 168904 | const enum_ty: Type = .fromInterned(lazy_sym.ty); |
| 168930 | wip_mir_log.debug("{}.@tagName:", .{enum_ty.fmt(pt)}); | 168905 | wip_mir_log.debug("{f}.@tagName:", .{enum_ty.fmt(pt)}); |
| 168931 | | 168906 | |
| 168932 | const param_regs = abi.getCAbiIntParamRegs(.auto); | 168907 | const param_regs = abi.getCAbiIntParamRegs(.auto); |
| 168933 | const param_locks = cg.register_manager.lockRegsAssumeUnused(2, param_regs[0..2].*); | 168908 | const param_locks = cg.register_manager.lockRegsAssumeUnused(2, param_regs[0..2].*); |
| ... | @@ -168976,7 +168951,7 @@ fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { | ... | @@ -168976,7 +168951,7 @@ fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { |
| 168976 | }, | 168951 | }, |
| 168977 | .error_set_type => |error_set_type| { | 168952 | .error_set_type => |error_set_type| { |
| 168978 | const err_ty: Type = .fromInterned(lazy_sym.ty); | 168953 | const err_ty: Type = .fromInterned(lazy_sym.ty); |
| 168979 | wip_mir_log.debug("{}.@errorCast:", .{err_ty.fmt(pt)}); | 168954 | wip_mir_log.debug("{f}.@errorCast:", .{err_ty.fmt(pt)}); |
| 168980 | | 168955 | |
| 168981 | const param_regs = abi.getCAbiIntParamRegs(.auto); | 168956 | const param_regs = abi.getCAbiIntParamRegs(.auto); |
| 168982 | const param_locks = cg.register_manager.lockRegsAssumeUnused(2, param_regs[0..2].*); | 168957 | const param_locks = cg.register_manager.lockRegsAssumeUnused(2, param_regs[0..2].*); |
| ... | @@ -169016,7 +168991,7 @@ fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { | ... | @@ -169016,7 +168991,7 @@ fn genLazy(cg: *CodeGen, lazy_sym: link.File.LazySymbol) InnerError!void { |
| 169016 | try cg.asmOpOnly(.{ ._, .ret }); | 168991 | try cg.asmOpOnly(.{ ._, .ret }); |
| 169017 | }, | 168992 | }, |
| 169018 | else => return cg.fail( | 168993 | else => return cg.fail( |
| 169019 | "TODO implement {s} for {}", | 168994 | "TODO implement {s} for {f}", |
| 169020 | .{ @tagName(lazy_sym.kind), Type.fromInterned(lazy_sym.ty).fmt(pt) }, | 168995 | .{ @tagName(lazy_sym.kind), Type.fromInterned(lazy_sym.ty).fmt(pt) }, |
| 169021 | ), | 168996 | ), |
| 169022 | } | 168997 | } |
| ... | @@ -169076,7 +169051,7 @@ fn finishAirResult(self: *CodeGen, inst: Air.Inst.Index, result: MCValue) void { | ... | @@ -169076,7 +169051,7 @@ fn finishAirResult(self: *CodeGen, inst: Air.Inst.Index, result: MCValue) void { |
| 169076 | .none, .dead, .unreach => {}, | 169051 | .none, .dead, .unreach => {}, |
| 169077 | else => unreachable, // Why didn't the result die? | 169052 | else => unreachable, // Why didn't the result die? |
| 169078 | } else { | 169053 | } else { |
| 169079 | tracking_log.debug("{} => {} (birth)", .{ inst, result }); | 169054 | tracking_log.debug("{f} => {f} (birth)", .{ inst, result }); |
| 169080 | self.inst_tracking.putAssumeCapacityNoClobber(inst, .init(result)); | 169055 | self.inst_tracking.putAssumeCapacityNoClobber(inst, .init(result)); |
| 169081 | // In some cases, an operand may be reused as the result. | 169056 | // In some cases, an operand may be reused as the result. |
| 169082 | // If that operand died and was a register, it was freed by | 169057 | // If that operand died and was a register, it was freed by |
| ... | @@ -169226,7 +169201,7 @@ fn allocMemPtr(self: *CodeGen, inst: Air.Inst.Index) !FrameIndex { | ... | @@ -169226,7 +169201,7 @@ fn allocMemPtr(self: *CodeGen, inst: Air.Inst.Index) !FrameIndex { |
| 169226 | const val_ty = ptr_ty.childType(zcu); | 169201 | const val_ty = ptr_ty.childType(zcu); |
| 169227 | return self.allocFrameIndex(.init(.{ | 169202 | return self.allocFrameIndex(.init(.{ |
| 169228 | .size = std.math.cast(u32, val_ty.abiSize(zcu)) orelse { | 169203 | .size = std.math.cast(u32, val_ty.abiSize(zcu)) orelse { |
| 169229 | return self.fail("type '{}' too big to fit into stack frame", .{val_ty.fmt(pt)}); | 169204 | return self.fail("type '{f}' too big to fit into stack frame", .{val_ty.fmt(pt)}); |
| 169230 | }, | 169205 | }, |
| 169231 | .alignment = ptr_ty.ptrAlignment(zcu).max(.@"1"), | 169206 | .alignment = ptr_ty.ptrAlignment(zcu).max(.@"1"), |
| 169232 | })); | 169207 | })); |
| ... | @@ -169244,7 +169219,7 @@ fn allocRegOrMemAdvanced(self: *CodeGen, ty: Type, inst: ?Air.Inst.Index, reg_ok | ... | @@ -169244,7 +169219,7 @@ fn allocRegOrMemAdvanced(self: *CodeGen, ty: Type, inst: ?Air.Inst.Index, reg_ok |
| 169244 | const pt = self.pt; | 169219 | const pt = self.pt; |
| 169245 | const zcu = pt.zcu; | 169220 | const zcu = pt.zcu; |
| 169246 | const abi_size = std.math.cast(u32, ty.abiSize(zcu)) orelse { | 169221 | const abi_size = std.math.cast(u32, ty.abiSize(zcu)) orelse { |
| 169247 | return self.fail("type '{}' too big to fit into stack frame", .{ty.fmt(pt)}); | 169222 | return self.fail("type '{f}' too big to fit into stack frame", .{ty.fmt(pt)}); |
| 169248 | }; | 169223 | }; |
| 169249 | | 169224 | |
| 169250 | if (reg_ok) need_mem: { | 169225 | if (reg_ok) need_mem: { |
| ... | @@ -169749,7 +169724,7 @@ fn airFpext(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -169749,7 +169724,7 @@ fn airFpext(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 169749 | ); | 169724 | ); |
| 169750 | } | 169725 | } |
| 169751 | break :result dst_mcv; | 169726 | break :result dst_mcv; |
| 169752 | } orelse return self.fail("TODO implement airFpext from {} to {}", .{ | 169727 | } orelse return self.fail("TODO implement airFpext from {f} to {f}", .{ |
| 169753 | src_ty.fmt(pt), dst_ty.fmt(pt), | 169728 | src_ty.fmt(pt), dst_ty.fmt(pt), |
| 169754 | }); | 169729 | }); |
| 169755 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | 169730 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| ... | @@ -170004,7 +169979,7 @@ fn airIntCast(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -170004,7 +169979,7 @@ fn airIntCast(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 170004 | ); | 169979 | ); |
| 170005 | | 169980 | |
| 170006 | break :result dst_mcv; | 169981 | break :result dst_mcv; |
| 170007 | }) orelse return self.fail("TODO implement airIntCast from {} to {}", .{ | 169982 | }) orelse return self.fail("TODO implement airIntCast from {f} to {f}", .{ |
| 170008 | src_ty.fmt(pt), dst_ty.fmt(pt), | 169983 | src_ty.fmt(pt), dst_ty.fmt(pt), |
| 170009 | }); | 169984 | }); |
| 170010 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | 169985 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| ... | @@ -170076,7 +170051,7 @@ fn airTrunc(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -170076,7 +170051,7 @@ fn airTrunc(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 170076 | else => null, | 170051 | else => null, |
| 170077 | }, | 170052 | }, |
| 170078 | else => null, | 170053 | else => null, |
| 170079 | }) orelse return self.fail("TODO implement airTrunc for {}", .{dst_ty.fmt(pt)}); | 170054 | }) orelse return self.fail("TODO implement airTrunc for {f}", .{dst_ty.fmt(pt)}); |
| 170080 | | 170055 | |
| 170081 | const dst_info = dst_elem_ty.intInfo(zcu); | 170056 | const dst_info = dst_elem_ty.intInfo(zcu); |
| 170082 | const src_info = src_elem_ty.intInfo(zcu); | 170057 | const src_info = src_elem_ty.intInfo(zcu); |
| ... | @@ -170497,7 +170472,7 @@ fn airAddSat(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -170497,7 +170472,7 @@ fn airAddSat(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 170497 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; | 170472 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; |
| 170498 | const ty = self.typeOf(bin_op.lhs); | 170473 | const ty = self.typeOf(bin_op.lhs); |
| 170499 | if (ty.zigTypeTag(zcu) == .vector or ty.abiSize(zcu) > 8) return self.fail( | 170474 | if (ty.zigTypeTag(zcu) == .vector or ty.abiSize(zcu) > 8) return self.fail( |
| 170500 | "TODO implement airAddSat for {}", | 170475 | "TODO implement airAddSat for {f}", |
| 170501 | .{ty.fmt(pt)}, | 170476 | .{ty.fmt(pt)}, |
| 170502 | ); | 170477 | ); |
| 170503 | | 170478 | |
| ... | @@ -170575,7 +170550,7 @@ fn airSubSat(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -170575,7 +170550,7 @@ fn airSubSat(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 170575 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; | 170550 | const bin_op = self.air.instructions.items(.data)[@intFromEnum(inst)].bin_op; |
| 170576 | const ty = self.typeOf(bin_op.lhs); | 170551 | const ty = self.typeOf(bin_op.lhs); |
| 170577 | if (ty.zigTypeTag(zcu) == .vector or ty.abiSize(zcu) > 8) return self.fail( | 170552 | if (ty.zigTypeTag(zcu) == .vector or ty.abiSize(zcu) > 8) return self.fail( |
| 170578 | "TODO implement airSubSat for {}", | 170553 | "TODO implement airSubSat for {f}", |
| 170579 | .{ty.fmt(pt)}, | 170554 | .{ty.fmt(pt)}, |
| 170580 | ); | 170555 | ); |
| 170581 | | 170556 | |
| ... | @@ -170726,7 +170701,7 @@ fn airMulSat(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -170726,7 +170701,7 @@ fn airMulSat(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 170726 | } | 170701 | } |
| 170727 | | 170702 | |
| 170728 | if (ty.zigTypeTag(zcu) == .vector or ty.abiSize(zcu) > 8) return self.fail( | 170703 | if (ty.zigTypeTag(zcu) == .vector or ty.abiSize(zcu) > 8) return self.fail( |
| 170729 | "TODO implement airMulSat for {}", | 170704 | "TODO implement airMulSat for {f}", |
| 170730 | .{ty.fmt(pt)}, | 170705 | .{ty.fmt(pt)}, |
| 170731 | ); | 170706 | ); |
| 170732 | | 170707 | |
| ... | @@ -171020,7 +170995,7 @@ fn airMulWithOverflow(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -171020,7 +170995,7 @@ fn airMulWithOverflow(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 171020 | const tuple_ty = self.typeOfIndex(inst); | 170995 | const tuple_ty = self.typeOfIndex(inst); |
| 171021 | const dst_ty = self.typeOf(bin_op.lhs); | 170996 | const dst_ty = self.typeOf(bin_op.lhs); |
| 171022 | const result: MCValue = switch (dst_ty.zigTypeTag(zcu)) { | 170997 | const result: MCValue = switch (dst_ty.zigTypeTag(zcu)) { |
| 171023 | .vector => return self.fail("TODO implement airMulWithOverflow for {}", .{dst_ty.fmt(pt)}), | 170998 | .vector => return self.fail("TODO implement airMulWithOverflow for {f}", .{dst_ty.fmt(pt)}), |
| 171024 | .int => result: { | 170999 | .int => result: { |
| 171025 | const dst_info = dst_ty.intInfo(zcu); | 171000 | const dst_info = dst_ty.intInfo(zcu); |
| 171026 | if (dst_info.bits > 128 and dst_info.signedness == .unsigned) { | 171001 | if (dst_info.bits > 128 and dst_info.signedness == .unsigned) { |
| ... | @@ -171373,7 +171348,7 @@ fn airMulWithOverflow(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -171373,7 +171348,7 @@ fn airMulWithOverflow(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 171373 | else => { | 171348 | else => { |
| 171374 | // For now, this is the only supported multiply that doesn't fit in a register. | 171349 | // For now, this is the only supported multiply that doesn't fit in a register. |
| 171375 | if (dst_info.bits > 128 or src_bits != 64) | 171350 | if (dst_info.bits > 128 or src_bits != 64) |
| 171376 | return self.fail("TODO implement airWithOverflow from {} to {}", .{ | 171351 | return self.fail("TODO implement airWithOverflow from {f} to {f}", .{ |
| 171377 | src_ty.fmt(pt), dst_ty.fmt(pt), | 171352 | src_ty.fmt(pt), dst_ty.fmt(pt), |
| 171378 | }); | 171353 | }); |
| 171379 | | 171354 | |
| ... | @@ -171774,7 +171749,7 @@ fn airShlShrBinOp(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -171774,7 +171749,7 @@ fn airShlShrBinOp(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 171774 | }, | 171749 | }, |
| 171775 | else => {}, | 171750 | else => {}, |
| 171776 | } | 171751 | } |
| 171777 | return self.fail("TODO implement airShlShrBinOp for {}", .{lhs_ty.fmt(pt)}); | 171752 | return self.fail("TODO implement airShlShrBinOp for {f}", .{lhs_ty.fmt(pt)}); |
| 171778 | }; | 171753 | }; |
| 171779 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); | 171754 | return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 171780 | } | 171755 | } |
| ... | @@ -172034,7 +172009,7 @@ fn airUnwrapErrUnionErr(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172034,7 +172009,7 @@ fn airUnwrapErrUnionErr(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172034 | .index = frame_addr.index, | 172009 | .index = frame_addr.index, |
| 172035 | .off = frame_addr.off + @as(i32, @intCast(err_off)), | 172010 | .off = frame_addr.off + @as(i32, @intCast(err_off)), |
| 172036 | } }, | 172011 | } }, |
| 172037 | else => return self.fail("TODO implement unwrap_err_err for {}", .{operand}), | 172012 | else => return self.fail("TODO implement unwrap_err_err for {f}", .{operand}), |
| 172038 | } | 172013 | } |
| 172039 | }; | 172014 | }; |
| 172040 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | 172015 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| ... | @@ -172196,7 +172171,7 @@ fn genUnwrapErrUnionPayloadMir( | ... | @@ -172196,7 +172171,7 @@ fn genUnwrapErrUnionPayloadMir( |
| 172196 | else | 172171 | else |
| 172197 | .{ .register = try self.copyToTmpRegister(payload_ty, result_mcv) }; | 172172 | .{ .register = try self.copyToTmpRegister(payload_ty, result_mcv) }; |
| 172198 | }, | 172173 | }, |
| 172199 | else => return self.fail("TODO implement genUnwrapErrUnionPayloadMir for {}", .{err_union}), | 172174 | else => return self.fail("TODO implement genUnwrapErrUnionPayloadMir for {f}", .{err_union}), |
| 172200 | } | 172175 | } |
| 172201 | }; | 172176 | }; |
| 172202 | | 172177 | |
| ... | @@ -172362,7 +172337,7 @@ fn airSliceLen(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172362,7 +172337,7 @@ fn airSliceLen(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172362 | .index = frame_addr.index, | 172337 | .index = frame_addr.index, |
| 172363 | .off = frame_addr.off + 8, | 172338 | .off = frame_addr.off + 8, |
| 172364 | } }, | 172339 | } }, |
| 172365 | else => return self.fail("TODO implement slice_len for {}", .{src_mcv}), | 172340 | else => return self.fail("TODO implement slice_len for {f}", .{src_mcv}), |
| 172366 | }; | 172341 | }; |
| 172367 | if (self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) { | 172342 | if (self.reuseOperand(inst, ty_op.operand, 0, src_mcv)) { |
| 172368 | switch (src_mcv) { | 172343 | switch (src_mcv) { |
| ... | @@ -172645,7 +172620,7 @@ fn airArrayElemVal(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172645,7 +172620,7 @@ fn airArrayElemVal(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172645 | }.to64(), | 172620 | }.to64(), |
| 172646 | ), | 172621 | ), |
| 172647 | }, | 172622 | }, |
| 172648 | else => return self.fail("TODO airArrayElemVal for {s} of {}", .{ | 172623 | else => return self.fail("TODO airArrayElemVal for {s} of {f}", .{ |
| 172649 | @tagName(array_mat_mcv), array_ty.fmt(pt), | 172624 | @tagName(array_mat_mcv), array_ty.fmt(pt), |
| 172650 | }), | 172625 | }), |
| 172651 | } | 172626 | } |
| ... | @@ -172688,7 +172663,7 @@ fn airArrayElemVal(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172688,7 +172663,7 @@ fn airArrayElemVal(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172688 | .load_extern_func, | 172663 | .load_extern_func, |
| 172689 | .lea_extern_func, | 172664 | .lea_extern_func, |
| 172690 | => try self.genSetReg(addr_reg, .usize, array_mcv.address(), .{}), | 172665 | => try self.genSetReg(addr_reg, .usize, array_mcv.address(), .{}), |
| 172691 | else => return self.fail("TODO airArrayElemVal_val for {s} of {}", .{ | 172666 | else => return self.fail("TODO airArrayElemVal_val for {s} of {f}", .{ |
| 172692 | @tagName(array_mcv), array_ty.fmt(pt), | 172667 | @tagName(array_mcv), array_ty.fmt(pt), |
| 172693 | }), | 172668 | }), |
| 172694 | } | 172669 | } |
| ... | @@ -172881,7 +172856,7 @@ fn airGetUnionTag(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172881,7 +172856,7 @@ fn airGetUnionTag(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172881 | } | 172856 | } |
| 172882 | | 172857 | |
| 172883 | return self.fail( | 172858 | return self.fail( |
| 172884 | "TODO implement get_union_tag for ABI larger than 8 bytes and operand {}", | 172859 | "TODO implement get_union_tag for ABI larger than 8 bytes and operand {f}", |
| 172885 | .{operand}, | 172860 | .{operand}, |
| 172886 | ); | 172861 | ); |
| 172887 | }, | 172862 | }, |
| ... | @@ -172893,7 +172868,7 @@ fn airGetUnionTag(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172893,7 +172868,7 @@ fn airGetUnionTag(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172893 | .register = registerAlias(result.register, @intCast(layout.tag_size)), | 172868 | .register = registerAlias(result.register, @intCast(layout.tag_size)), |
| 172894 | }; | 172869 | }; |
| 172895 | }, | 172870 | }, |
| 172896 | else => return self.fail("TODO implement get_union_tag for {}", .{operand}), | 172871 | else => return self.fail("TODO implement get_union_tag for {f}", .{operand}), |
| 172897 | } | 172872 | } |
| 172898 | }; | 172873 | }; |
| 172899 | | 172874 | |
| ... | @@ -172909,7 +172884,7 @@ fn airClz(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -172909,7 +172884,7 @@ fn airClz(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 172909 | | 172884 | |
| 172910 | const dst_ty = self.typeOfIndex(inst); | 172885 | const dst_ty = self.typeOfIndex(inst); |
| 172911 | const src_ty = self.typeOf(ty_op.operand); | 172886 | const src_ty = self.typeOf(ty_op.operand); |
| 172912 | if (src_ty.zigTypeTag(zcu) == .vector) return self.fail("TODO implement airClz for {}", .{ | 172887 | if (src_ty.zigTypeTag(zcu) == .vector) return self.fail("TODO implement airClz for {f}", .{ |
| 172913 | src_ty.fmt(pt), | 172888 | src_ty.fmt(pt), |
| 172914 | }); | 172889 | }); |
| 172915 | | 172890 | |
| ... | @@ -173105,7 +173080,7 @@ fn airCtz(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -173105,7 +173080,7 @@ fn airCtz(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 173105 | | 173080 | |
| 173106 | const dst_ty = self.typeOfIndex(inst); | 173081 | const dst_ty = self.typeOfIndex(inst); |
| 173107 | const src_ty = self.typeOf(ty_op.operand); | 173082 | const src_ty = self.typeOf(ty_op.operand); |
| 173108 | if (src_ty.zigTypeTag(zcu) == .vector) return self.fail("TODO implement airCtz for {}", .{ | 173083 | if (src_ty.zigTypeTag(zcu) == .vector) return self.fail("TODO implement airCtz for {f}", .{ |
| 173109 | src_ty.fmt(pt), | 173084 | src_ty.fmt(pt), |
| 173110 | }); | 173085 | }); |
| 173111 | | 173086 | |
| ... | @@ -173277,7 +173252,7 @@ fn airPopCount(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -173277,7 +173252,7 @@ fn airPopCount(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 173277 | const src_ty = self.typeOf(ty_op.operand); | 173252 | const src_ty = self.typeOf(ty_op.operand); |
| 173278 | const src_abi_size: u32 = @intCast(src_ty.abiSize(zcu)); | 173253 | const src_abi_size: u32 = @intCast(src_ty.abiSize(zcu)); |
| 173279 | if (src_ty.zigTypeTag(zcu) == .vector or src_abi_size > 16) | 173254 | if (src_ty.zigTypeTag(zcu) == .vector or src_abi_size > 16) |
| 173280 | return self.fail("TODO implement airPopCount for {}", .{src_ty.fmt(pt)}); | 173255 | return self.fail("TODO implement airPopCount for {f}", .{src_ty.fmt(pt)}); |
| 173281 | const src_mcv = try self.resolveInst(ty_op.operand); | 173256 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 173282 | | 173257 | |
| 173283 | const mat_src_mcv = switch (src_mcv) { | 173258 | const mat_src_mcv = switch (src_mcv) { |
| ... | @@ -173430,7 +173405,7 @@ fn genByteSwap( | ... | @@ -173430,7 +173405,7 @@ fn genByteSwap( |
| 173430 | const has_movbe = self.hasFeature(.movbe); | 173405 | const has_movbe = self.hasFeature(.movbe); |
| 173431 | | 173406 | |
| 173432 | if (src_ty.zigTypeTag(zcu) == .vector) return self.fail( | 173407 | if (src_ty.zigTypeTag(zcu) == .vector) return self.fail( |
| 173433 | "TODO implement genByteSwap for {}", | 173408 | "TODO implement genByteSwap for {f}", |
| 173434 | .{src_ty.fmt(pt)}, | 173409 | .{src_ty.fmt(pt)}, |
| 173435 | ); | 173410 | ); |
| 173436 | | 173411 | |
| ... | @@ -173739,7 +173714,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A | ... | @@ -173739,7 +173714,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A |
| 173739 | const result = result: { | 173714 | const result = result: { |
| 173740 | const scalar_bits = ty.scalarType(zcu).floatBits(self.target); | 173715 | const scalar_bits = ty.scalarType(zcu).floatBits(self.target); |
| 173741 | if (scalar_bits == 80) { | 173716 | if (scalar_bits == 80) { |
| 173742 | if (ty.zigTypeTag(zcu) != .float) return self.fail("TODO implement floatSign for {}", .{ | 173717 | if (ty.zigTypeTag(zcu) != .float) return self.fail("TODO implement floatSign for {f}", .{ |
| 173743 | ty.fmt(pt), | 173718 | ty.fmt(pt), |
| 173744 | }); | 173719 | }); |
| 173745 | | 173720 | |
| ... | @@ -173763,7 +173738,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A | ... | @@ -173763,7 +173738,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A |
| 173763 | const abi_size: u32 = switch (ty.abiSize(zcu)) { | 173738 | const abi_size: u32 = switch (ty.abiSize(zcu)) { |
| 173764 | 1...16 => 16, | 173739 | 1...16 => 16, |
| 173765 | 17...32 => 32, | 173740 | 17...32 => 32, |
| 173766 | else => return self.fail("TODO implement floatSign for {}", .{ | 173741 | else => return self.fail("TODO implement floatSign for {f}", .{ |
| 173767 | ty.fmt(pt), | 173742 | ty.fmt(pt), |
| 173768 | }), | 173743 | }), |
| 173769 | }; | 173744 | }; |
| ... | @@ -173822,7 +173797,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A | ... | @@ -173822,7 +173797,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A |
| 173822 | .abs => .{ .v_pd, .@"and" }, | 173797 | .abs => .{ .v_pd, .@"and" }, |
| 173823 | else => unreachable, | 173798 | else => unreachable, |
| 173824 | }, | 173799 | }, |
| 173825 | 80 => return self.fail("TODO implement floatSign for {}", .{ty.fmt(pt)}), | 173800 | 80 => return self.fail("TODO implement floatSign for {f}", .{ty.fmt(pt)}), |
| 173826 | else => unreachable, | 173801 | else => unreachable, |
| 173827 | }, | 173802 | }, |
| 173828 | registerAlias(dst_reg, abi_size), | 173803 | registerAlias(dst_reg, abi_size), |
| ... | @@ -173848,7 +173823,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A | ... | @@ -173848,7 +173823,7 @@ fn floatSign(self: *CodeGen, inst: Air.Inst.Index, tag: Air.Inst.Tag, operand: A |
| 173848 | .abs => .{ ._pd, .@"and" }, | 173823 | .abs => .{ ._pd, .@"and" }, |
| 173849 | else => unreachable, | 173824 | else => unreachable, |
| 173850 | }, | 173825 | }, |
| 173851 | 80 => return self.fail("TODO implement floatSign for {}", .{ty.fmt(pt)}), | 173826 | 80 => return self.fail("TODO implement floatSign for {f}", .{ty.fmt(pt)}), |
| 173852 | else => unreachable, | 173827 | else => unreachable, |
| 173853 | }, | 173828 | }, |
| 173854 | registerAlias(dst_reg, abi_size), | 173829 | registerAlias(dst_reg, abi_size), |
| ... | @@ -173928,7 +173903,7 @@ fn genRoundLibcall(self: *CodeGen, ty: Type, src_mcv: MCValue, mode: bits.RoundM | ... | @@ -173928,7 +173903,7 @@ fn genRoundLibcall(self: *CodeGen, ty: Type, src_mcv: MCValue, mode: bits.RoundM |
| 173928 | if (self.getRoundTag(ty)) |_| return .none; | 173903 | if (self.getRoundTag(ty)) |_| return .none; |
| 173929 | | 173904 | |
| 173930 | if (ty.zigTypeTag(zcu) != .float) | 173905 | if (ty.zigTypeTag(zcu) != .float) |
| 173931 | return self.fail("TODO implement genRound for {}", .{ty.fmt(pt)}); | 173906 | return self.fail("TODO implement genRound for {f}", .{ty.fmt(pt)}); |
| 173932 | | 173907 | |
| 173933 | var sym_buf: ["__trunc?".len]u8 = undefined; | 173908 | var sym_buf: ["__trunc?".len]u8 = undefined; |
| 173934 | return try self.genCall(.{ .extern_func = .{ | 173909 | return try self.genCall(.{ .extern_func = .{ |
| ... | @@ -174164,7 +174139,7 @@ fn airAbs(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -174164,7 +174139,7 @@ fn airAbs(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 174164 | }, | 174139 | }, |
| 174165 | .float => return self.floatSign(inst, .abs, ty_op.operand, ty), | 174140 | .float => return self.floatSign(inst, .abs, ty_op.operand, ty), |
| 174166 | }, | 174141 | }, |
| 174167 | }) orelse return self.fail("TODO implement airAbs for {}", .{ty.fmt(pt)}); | 174142 | }) orelse return self.fail("TODO implement airAbs for {f}", .{ty.fmt(pt)}); |
| 174168 | | 174143 | |
| 174169 | const abi_size: u32 = @intCast(ty.abiSize(zcu)); | 174144 | const abi_size: u32 = @intCast(ty.abiSize(zcu)); |
| 174170 | const src_mcv = try self.resolveInst(ty_op.operand); | 174145 | const src_mcv = try self.resolveInst(ty_op.operand); |
| ... | @@ -174323,7 +174298,7 @@ fn airSqrt(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -174323,7 +174298,7 @@ fn airSqrt(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 174323 | else => unreachable, | 174298 | else => unreachable, |
| 174324 | }, | 174299 | }, |
| 174325 | else => unreachable, | 174300 | else => unreachable, |
| 174326 | }) orelse return self.fail("TODO implement airSqrt for {}", .{ty.fmt(pt)}); | 174301 | }) orelse return self.fail("TODO implement airSqrt for {f}", .{ty.fmt(pt)}); |
| 174327 | switch (mir_tag[0]) { | 174302 | switch (mir_tag[0]) { |
| 174328 | .v_ss, .v_sd => if (src_mcv.isBase()) try self.asmRegisterRegisterMemory( | 174303 | .v_ss, .v_sd => if (src_mcv.isBase()) try self.asmRegisterRegisterMemory( |
| 174329 | mir_tag, | 174304 | mir_tag, |
| ... | @@ -174481,7 +174456,7 @@ fn packedLoad(self: *CodeGen, dst_mcv: MCValue, ptr_ty: Type, ptr_mcv: MCValue) | ... | @@ -174481,7 +174456,7 @@ fn packedLoad(self: *CodeGen, dst_mcv: MCValue, ptr_ty: Type, ptr_mcv: MCValue) |
| 174481 | return; | 174456 | return; |
| 174482 | } | 174457 | } |
| 174483 | | 174458 | |
| 174484 | if (val_abi_size > 8) return self.fail("TODO implement packed load of {}", .{val_ty.fmt(pt)}); | 174459 | if (val_abi_size > 8) return self.fail("TODO implement packed load of {f}", .{val_ty.fmt(pt)}); |
| 174485 | | 174460 | |
| 174486 | const limb_abi_size: u31 = @min(val_abi_size, 8); | 174461 | const limb_abi_size: u31 = @min(val_abi_size, 8); |
| 174487 | const limb_abi_bits = limb_abi_size * 8; | 174462 | const limb_abi_bits = limb_abi_size * 8; |
| ... | @@ -174753,7 +174728,7 @@ fn packedStore(self: *CodeGen, ptr_ty: Type, ptr_mcv: MCValue, src_mcv: MCValue) | ... | @@ -174753,7 +174728,7 @@ fn packedStore(self: *CodeGen, ptr_ty: Type, ptr_mcv: MCValue, src_mcv: MCValue) |
| 174753 | limb_mem, | 174728 | limb_mem, |
| 174754 | registerAlias(tmp_reg, limb_abi_size), | 174729 | registerAlias(tmp_reg, limb_abi_size), |
| 174755 | ); | 174730 | ); |
| 174756 | } else return self.fail("TODO: implement packed store of {}", .{src_ty.fmt(pt)}); | 174731 | } else return self.fail("TODO: implement packed store of {f}", .{src_ty.fmt(pt)}); |
| 174757 | } | 174732 | } |
| 174758 | } | 174733 | } |
| 174759 | | 174734 | |
| ... | @@ -174856,7 +174831,7 @@ fn genUnOp(self: *CodeGen, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_a | ... | @@ -174856,7 +174831,7 @@ fn genUnOp(self: *CodeGen, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_a |
| 174856 | const zcu = pt.zcu; | 174831 | const zcu = pt.zcu; |
| 174857 | const src_ty = self.typeOf(src_air); | 174832 | const src_ty = self.typeOf(src_air); |
| 174858 | if (src_ty.zigTypeTag(zcu) == .vector) | 174833 | if (src_ty.zigTypeTag(zcu) == .vector) |
| 174859 | return self.fail("TODO implement genUnOp for {}", .{src_ty.fmt(pt)}); | 174834 | return self.fail("TODO implement genUnOp for {f}", .{src_ty.fmt(pt)}); |
| 174860 | | 174835 | |
| 174861 | var src_mcv = try self.resolveInst(src_air); | 174836 | var src_mcv = try self.resolveInst(src_air); |
| 174862 | switch (src_mcv) { | 174837 | switch (src_mcv) { |
| ... | @@ -174943,7 +174918,7 @@ fn genUnOp(self: *CodeGen, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_a | ... | @@ -174943,7 +174918,7 @@ fn genUnOp(self: *CodeGen, maybe_inst: ?Air.Inst.Index, tag: Air.Inst.Tag, src_a |
| 174943 | fn genUnOpMir(self: *CodeGen, mir_tag: Mir.Inst.FixedTag, dst_ty: Type, dst_mcv: MCValue) !void { | 174918 | fn genUnOpMir(self: *CodeGen, mir_tag: Mir.Inst.FixedTag, dst_ty: Type, dst_mcv: MCValue) !void { |
| 174944 | const pt = self.pt; | 174919 | const pt = self.pt; |
| 174945 | const abi_size: u32 = @intCast(dst_ty.abiSize(pt.zcu)); | 174920 | const abi_size: u32 = @intCast(dst_ty.abiSize(pt.zcu)); |
| 174946 | if (abi_size > 8) return self.fail("TODO implement {} for {}", .{ mir_tag, dst_ty.fmt(pt) }); | 174921 | if (abi_size > 8) return self.fail("TODO implement {} for {f}", .{ mir_tag, dst_ty.fmt(pt) }); |
| 174947 | switch (dst_mcv) { | 174922 | switch (dst_mcv) { |
| 174948 | .none, | 174923 | .none, |
| 174949 | .unreach, | 174924 | .unreach, |
| ... | @@ -175672,7 +175647,7 @@ fn genBinOp( | ... | @@ -175672,7 +175647,7 @@ fn genBinOp( |
| 175672 | }, | 175647 | }, |
| 175673 | floatLibcAbiSuffix(lhs_ty), | 175648 | floatLibcAbiSuffix(lhs_ty), |
| 175674 | }), | 175649 | }), |
| 175675 | else => return self.fail("TODO implement genBinOp for {s} {}", .{ | 175650 | else => return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 175676 | @tagName(air_tag), lhs_ty.fmt(pt), | 175651 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 175677 | }), | 175652 | }), |
| 175678 | } catch unreachable; | 175653 | } catch unreachable; |
| ... | @@ -175785,7 +175760,7 @@ fn genBinOp( | ... | @@ -175785,7 +175760,7 @@ fn genBinOp( |
| 175785 | ); | 175760 | ); |
| 175786 | break :adjusted .{ .register = dst_reg }; | 175761 | break :adjusted .{ .register = dst_reg }; |
| 175787 | }, | 175762 | }, |
| 175788 | 80, 128 => return self.fail("TODO implement genBinOp for {s} of {}", .{ | 175763 | 80, 128 => return self.fail("TODO implement genBinOp for {s} of {f}", .{ |
| 175789 | @tagName(air_tag), lhs_ty.fmt(pt), | 175764 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 175790 | }), | 175765 | }), |
| 175791 | else => unreachable, | 175766 | else => unreachable, |
| ... | @@ -175819,7 +175794,7 @@ fn genBinOp( | ... | @@ -175819,7 +175794,7 @@ fn genBinOp( |
| 175819 | if (sse_op and ((lhs_ty.scalarType(zcu).isRuntimeFloat() and | 175794 | if (sse_op and ((lhs_ty.scalarType(zcu).isRuntimeFloat() and |
| 175820 | lhs_ty.scalarType(zcu).floatBits(self.target) == 80) or | 175795 | lhs_ty.scalarType(zcu).floatBits(self.target) == 80) or |
| 175821 | lhs_ty.abiSize(zcu) > self.vectorSize(.float))) | 175796 | lhs_ty.abiSize(zcu) > self.vectorSize(.float))) |
| 175822 | return self.fail("TODO implement genBinOp for {s} {}", .{ @tagName(air_tag), lhs_ty.fmt(pt) }); | 175797 | return self.fail("TODO implement genBinOp for {s} {f}", .{ @tagName(air_tag), lhs_ty.fmt(pt) }); |
| 175823 | | 175798 | |
| 175824 | const maybe_mask_reg = switch (air_tag) { | 175799 | const maybe_mask_reg = switch (air_tag) { |
| 175825 | else => null, | 175800 | else => null, |
| ... | @@ -176199,7 +176174,7 @@ fn genBinOp( | ... | @@ -176199,7 +176174,7 @@ fn genBinOp( |
| 176199 | } | 176174 | } |
| 176200 | }, | 176175 | }, |
| 176201 | | 176176 | |
| 176202 | else => return self.fail("TODO implement genBinOp for {s} {}", .{ | 176177 | else => return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 176203 | @tagName(air_tag), lhs_ty.fmt(pt), | 176178 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 176204 | }), | 176179 | }), |
| 176205 | } | 176180 | } |
| ... | @@ -176953,7 +176928,7 @@ fn genBinOp( | ... | @@ -176953,7 +176928,7 @@ fn genBinOp( |
| 176953 | else => unreachable, | 176928 | else => unreachable, |
| 176954 | }, | 176929 | }, |
| 176955 | }, | 176930 | }, |
| 176956 | }) orelse return self.fail("TODO implement genBinOp for {s} {}", .{ | 176931 | }) orelse return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 176957 | @tagName(air_tag), lhs_ty.fmt(pt), | 176932 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 176958 | }); | 176933 | }); |
| 176959 | | 176934 | |
| ... | @@ -177086,7 +177061,7 @@ fn genBinOp( | ... | @@ -177086,7 +177061,7 @@ fn genBinOp( |
| 177086 | else => unreachable, | 177061 | else => unreachable, |
| 177087 | }, | 177062 | }, |
| 177088 | else => unreachable, | 177063 | else => unreachable, |
| 177089 | }) orelse return self.fail("TODO implement genBinOp for {s} {}", .{ | 177064 | }) orelse return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 177090 | @tagName(air_tag), lhs_ty.fmt(pt), | 177065 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 177091 | }), | 177066 | }), |
| 177092 | mask_reg, | 177067 | mask_reg, |
| ... | @@ -177118,7 +177093,7 @@ fn genBinOp( | ... | @@ -177118,7 +177093,7 @@ fn genBinOp( |
| 177118 | else => unreachable, | 177093 | else => unreachable, |
| 177119 | }, | 177094 | }, |
| 177120 | else => unreachable, | 177095 | else => unreachable, |
| 177121 | }) orelse return self.fail("TODO implement genBinOp for {s} {}", .{ | 177096 | }) orelse return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 177122 | @tagName(air_tag), lhs_ty.fmt(pt), | 177097 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 177123 | }), | 177098 | }), |
| 177124 | dst_reg, | 177099 | dst_reg, |
| ... | @@ -177154,7 +177129,7 @@ fn genBinOp( | ... | @@ -177154,7 +177129,7 @@ fn genBinOp( |
| 177154 | else => unreachable, | 177129 | else => unreachable, |
| 177155 | }, | 177130 | }, |
| 177156 | else => unreachable, | 177131 | else => unreachable, |
| 177157 | }) orelse return self.fail("TODO implement genBinOp for {s} {}", .{ | 177132 | }) orelse return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 177158 | @tagName(air_tag), lhs_ty.fmt(pt), | 177133 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 177159 | }), | 177134 | }), |
| 177160 | mask_reg, | 177135 | mask_reg, |
| ... | @@ -177185,7 +177160,7 @@ fn genBinOp( | ... | @@ -177185,7 +177160,7 @@ fn genBinOp( |
| 177185 | else => unreachable, | 177160 | else => unreachable, |
| 177186 | }, | 177161 | }, |
| 177187 | else => unreachable, | 177162 | else => unreachable, |
| 177188 | }) orelse return self.fail("TODO implement genBinOp for {s} {}", .{ | 177163 | }) orelse return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 177189 | @tagName(air_tag), lhs_ty.fmt(pt), | 177164 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 177190 | }), | 177165 | }), |
| 177191 | dst_reg, | 177166 | dst_reg, |
| ... | @@ -177215,7 +177190,7 @@ fn genBinOp( | ... | @@ -177215,7 +177190,7 @@ fn genBinOp( |
| 177215 | else => unreachable, | 177190 | else => unreachable, |
| 177216 | }, | 177191 | }, |
| 177217 | else => unreachable, | 177192 | else => unreachable, |
| 177218 | }) orelse return self.fail("TODO implement genBinOp for {s} {}", .{ | 177193 | }) orelse return self.fail("TODO implement genBinOp for {s} {f}", .{ |
| 177219 | @tagName(air_tag), lhs_ty.fmt(pt), | 177194 | @tagName(air_tag), lhs_ty.fmt(pt), |
| 177220 | }); | 177195 | }); |
| 177221 | try self.asmRegisterRegister(.{ mir_fixes, .@"and" }, dst_reg, mask_reg); | 177196 | try self.asmRegisterRegister(.{ mir_fixes, .@"and" }, dst_reg, mask_reg); |
| ... | @@ -178022,7 +177997,7 @@ fn airArg(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -178022,7 +177997,7 @@ fn airArg(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 178022 | | 177997 | |
| 178023 | break :result dst_mcv; | 177998 | break :result dst_mcv; |
| 178024 | }, | 177999 | }, |
| 178025 | else => return self.fail("TODO implement arg for {}", .{src_mcv}), | 178000 | else => return self.fail("TODO implement arg for {f}", .{src_mcv}), |
| 178026 | } | 178001 | } |
| 178027 | }; | 178002 | }; |
| 178028 | return self.finishAir(inst, result, .{ .none, .none, .none }); | 178003 | return self.finishAir(inst, result, .{ .none, .none, .none }); |
| ... | @@ -179079,7 +179054,7 @@ fn genCondBrMir(self: *CodeGen, ty: Type, mcv: MCValue) !Mir.Inst.Index { | ... | @@ -179079,7 +179054,7 @@ fn genCondBrMir(self: *CodeGen, ty: Type, mcv: MCValue) !Mir.Inst.Index { |
| 179079 | const reg = try self.copyToTmpRegister(ty, mcv); | 179054 | const reg = try self.copyToTmpRegister(ty, mcv); |
| 179080 | return self.genCondBrMir(ty, .{ .register = reg }); | 179055 | return self.genCondBrMir(ty, .{ .register = reg }); |
| 179081 | } | 179056 | } |
| 179082 | return self.fail("TODO implement condbr when condition is {} with abi larger than 8 bytes", .{mcv}); | 179057 | return self.fail("TODO implement condbr when condition is {f} with abi larger than 8 bytes", .{mcv}); |
| 179083 | }, | 179058 | }, |
| 179084 | else => return self.fail("TODO implement condbr when condition is {s}", .{@tagName(mcv)}), | 179059 | else => return self.fail("TODO implement condbr when condition is {s}", .{@tagName(mcv)}), |
| 179085 | } | 179060 | } |
| ... | @@ -179166,7 +179141,7 @@ fn isErr(self: *CodeGen, maybe_inst: ?Air.Inst.Index, eu_ty: Type, eu_mcv: MCVal | ... | @@ -179166,7 +179141,7 @@ fn isErr(self: *CodeGen, maybe_inst: ?Air.Inst.Index, eu_ty: Type, eu_mcv: MCVal |
| 179166 | } }, | 179141 | } }, |
| 179167 | .{ .immediate = 0 }, | 179142 | .{ .immediate = 0 }, |
| 179168 | ), | 179143 | ), |
| 179169 | else => return self.fail("TODO implement isErr for {}", .{eu_mcv}), | 179144 | else => return self.fail("TODO implement isErr for {f}", .{eu_mcv}), |
| 179170 | } | 179145 | } |
| 179171 | | 179146 | |
| 179172 | if (maybe_inst) |inst| self.eflags_inst = inst; | 179147 | if (maybe_inst) |inst| self.eflags_inst = inst; |
| ... | @@ -180916,7 +180891,7 @@ fn moveStrategy(cg: *CodeGen, ty: Type, class: Register.Class, aligned: bool) !M | ... | @@ -180916,7 +180891,7 @@ fn moveStrategy(cg: *CodeGen, ty: Type, class: Register.Class, aligned: bool) !M |
| 180916 | }, | 180891 | }, |
| 180917 | .ip, .cr, .dr => {}, | 180892 | .ip, .cr, .dr => {}, |
| 180918 | } | 180893 | } |
| 180919 | return cg.fail("TODO moveStrategy for {}", .{ty.fmt(pt)}); | 180894 | return cg.fail("TODO moveStrategy for {f}", .{ty.fmt(pt)}); |
| 180920 | } | 180895 | } |
| 180921 | | 180896 | |
| 180922 | const CopyOptions = struct { | 180897 | const CopyOptions = struct { |
| ... | @@ -181048,7 +181023,7 @@ fn genCopy(self: *CodeGen, ty: Type, dst_mcv: MCValue, src_mcv: MCValue, opts: C | ... | @@ -181048,7 +181023,7 @@ fn genCopy(self: *CodeGen, ty: Type, dst_mcv: MCValue, src_mcv: MCValue, opts: C |
| 181048 | break :src_info .{ .addr_reg = src_addr_reg, .addr_lock = src_addr_lock }; | 181023 | break :src_info .{ .addr_reg = src_addr_reg, .addr_lock = src_addr_lock }; |
| 181049 | }, | 181024 | }, |
| 181050 | .air_ref => |src_ref| return self.genCopy(ty, dst_mcv, try self.resolveInst(src_ref), opts), | 181025 | .air_ref => |src_ref| return self.genCopy(ty, dst_mcv, try self.resolveInst(src_ref), opts), |
| 181051 | else => return self.fail("TODO implement genCopy for {s} of {}", .{ | 181026 | else => return self.fail("TODO implement genCopy for {s} of {f}", .{ |
| 181052 | @tagName(src_mcv), ty.fmt(pt), | 181027 | @tagName(src_mcv), ty.fmt(pt), |
| 181053 | }), | 181028 | }), |
| 181054 | }; | 181029 | }; |
| ... | @@ -181424,7 +181399,7 @@ fn genSetReg( | ... | @@ -181424,7 +181399,7 @@ fn genSetReg( |
| 181424 | 80 => null, | 181399 | 80 => null, |
| 181425 | else => unreachable, | 181400 | else => unreachable, |
| 181426 | }, | 181401 | }, |
| 181427 | }) orelse return self.fail("TODO implement genSetReg for {}", .{ty.fmt(pt)}), | 181402 | }) orelse return self.fail("TODO implement genSetReg for {f}", .{ty.fmt(pt)}), |
| 181428 | dst_alias, | 181403 | dst_alias, |
| 181429 | registerAlias(src_reg, abi_size), | 181404 | registerAlias(src_reg, abi_size), |
| 181430 | ), | 181405 | ), |
| ... | @@ -181854,7 +181829,7 @@ fn genSetMem( | ... | @@ -181854,7 +181829,7 @@ fn genSetMem( |
| 181854 | opts, | 181829 | opts, |
| 181855 | ); | 181830 | ); |
| 181856 | }, | 181831 | }, |
| 181857 | else => return self.fail("TODO implement genSetMem for {s} of {}", .{ | 181832 | else => return self.fail("TODO implement genSetMem for {s} of {f}", .{ |
| 181858 | @tagName(src_mcv), ty.fmt(pt), | 181833 | @tagName(src_mcv), ty.fmt(pt), |
| 181859 | }), | 181834 | }), |
| 181860 | }, | 181835 | }, |
| ... | @@ -182167,7 +182142,7 @@ fn airFloatFromInt(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -182167,7 +182142,7 @@ fn airFloatFromInt(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 182167 | 32, 64 => src_size > 8, | 182142 | 32, 64 => src_size > 8, |
| 182168 | else => unreachable, | 182143 | else => unreachable, |
| 182169 | }) { | 182144 | }) { |
| 182170 | if (src_bits > 128) return self.fail("TODO implement airFloatFromInt from {} to {}", .{ | 182145 | if (src_bits > 128) return self.fail("TODO implement airFloatFromInt from {f} to {f}", .{ |
| 182171 | src_ty.fmt(pt), dst_ty.fmt(pt), | 182146 | src_ty.fmt(pt), dst_ty.fmt(pt), |
| 182172 | }); | 182147 | }); |
| 182173 | | 182148 | |
| ... | @@ -182209,7 +182184,7 @@ fn airFloatFromInt(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -182209,7 +182184,7 @@ fn airFloatFromInt(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 182209 | else => unreachable, | 182184 | else => unreachable, |
| 182210 | }, | 182185 | }, |
| 182211 | else => null, | 182186 | else => null, |
| 182212 | }) orelse return self.fail("TODO implement airFloatFromInt from {} to {}", .{ | 182187 | }) orelse return self.fail("TODO implement airFloatFromInt from {f} to {f}", .{ |
| 182213 | src_ty.fmt(pt), dst_ty.fmt(pt), | 182188 | src_ty.fmt(pt), dst_ty.fmt(pt), |
| 182214 | }); | 182189 | }); |
| 182215 | const dst_alias = dst_reg.to128(); | 182190 | const dst_alias = dst_reg.to128(); |
| ... | @@ -182247,7 +182222,7 @@ fn airIntFromFloat(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -182247,7 +182222,7 @@ fn airIntFromFloat(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 182247 | 32, 64 => dst_size > 8, | 182222 | 32, 64 => dst_size > 8, |
| 182248 | else => unreachable, | 182223 | else => unreachable, |
| 182249 | }) { | 182224 | }) { |
| 182250 | if (dst_bits > 128) return self.fail("TODO implement airIntFromFloat from {} to {}", .{ | 182225 | if (dst_bits > 128) return self.fail("TODO implement airIntFromFloat from {f} to {f}", .{ |
| 182251 | src_ty.fmt(pt), dst_ty.fmt(pt), | 182226 | src_ty.fmt(pt), dst_ty.fmt(pt), |
| 182252 | }); | 182227 | }); |
| 182253 | | 182228 | |
| ... | @@ -182531,7 +182506,7 @@ fn atomicOp( | ... | @@ -182531,7 +182506,7 @@ fn atomicOp( |
| 182531 | else => null, | 182506 | else => null, |
| 182532 | }, | 182507 | }, |
| 182533 | else => unreachable, | 182508 | else => unreachable, |
| 182534 | }) orelse return self.fail("TODO implement atomicOp of {s} for {}", .{ | 182509 | }) orelse return self.fail("TODO implement atomicOp of {s} for {f}", .{ |
| 182535 | @tagName(op), val_ty.fmt(pt), | 182510 | @tagName(op), val_ty.fmt(pt), |
| 182536 | }); | 182511 | }); |
| 182537 | try self.genSetReg(sse_reg, val_ty, .{ .register = .rax }, .{}); | 182512 | try self.genSetReg(sse_reg, val_ty, .{ .register = .rax }, .{}); |
| ... | @@ -183286,7 +183261,7 @@ fn airSplat(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183286,7 +183261,7 @@ fn airSplat(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183286 | else => unreachable, | 183261 | else => unreachable, |
| 183287 | }, | 183262 | }, |
| 183288 | } | 183263 | } |
| 183289 | return self.fail("TODO implement airSplat for {}", .{vector_ty.fmt(pt)}); | 183264 | return self.fail("TODO implement airSplat for {f}", .{vector_ty.fmt(pt)}); |
| 183290 | }; | 183265 | }; |
| 183291 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); | 183266 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| 183292 | } | 183267 | } |
| ... | @@ -183322,12 +183297,12 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183322,12 +183297,12 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183322 | else | 183297 | else |
| 183323 | try self.copyToTmpRegister(pred_ty, pred_mcv) | 183298 | try self.copyToTmpRegister(pred_ty, pred_mcv) |
| 183324 | else | 183299 | else |
| 183325 | return self.fail("TODO implement airSelect for {}", .{ty.fmt(pt)}), | 183300 | return self.fail("TODO implement airSelect for {f}", .{ty.fmt(pt)}), |
| 183326 | else => unreachable, | 183301 | else => unreachable, |
| 183327 | }, | 183302 | }, |
| 183328 | .register_mask => |pred_reg_mask| { | 183303 | .register_mask => |pred_reg_mask| { |
| 183329 | if (pred_reg_mask.info.scalar.bitSize(self.target) != 8 * elem_abi_size) | 183304 | if (pred_reg_mask.info.scalar.bitSize(self.target) != 8 * elem_abi_size) |
| 183330 | return self.fail("TODO implement airSelect for {}", .{ty.fmt(pt)}); | 183305 | return self.fail("TODO implement airSelect for {f}", .{ty.fmt(pt)}); |
| 183331 | | 183306 | |
| 183332 | const mask_reg: Register = if (need_xmm0 and pred_reg_mask.reg.id() != comptime Register.xmm0.id()) mask_reg: { | 183307 | const mask_reg: Register = if (need_xmm0 and pred_reg_mask.reg.id() != comptime Register.xmm0.id()) mask_reg: { |
| 183333 | try self.register_manager.getKnownReg(.xmm0, null); | 183308 | try self.register_manager.getKnownReg(.xmm0, null); |
| ... | @@ -183401,7 +183376,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183401,7 +183376,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183401 | else | 183376 | else |
| 183402 | null | 183377 | null |
| 183403 | else | 183378 | else |
| 183404 | null) orelse return self.fail("TODO implement airSelect for {}", .{ty.fmt(pt)}); | 183379 | null) orelse return self.fail("TODO implement airSelect for {f}", .{ty.fmt(pt)}); |
| 183405 | if (has_avx) { | 183380 | if (has_avx) { |
| 183406 | const rhs_alias = if (reuse_mcv.isRegister()) | 183381 | const rhs_alias = if (reuse_mcv.isRegister()) |
| 183407 | registerAlias(reuse_mcv.getReg().?, abi_size) | 183382 | registerAlias(reuse_mcv.getReg().?, abi_size) |
| ... | @@ -183554,7 +183529,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183554,7 +183529,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183554 | else => unreachable, | 183529 | else => unreachable, |
| 183555 | }), | 183530 | }), |
| 183556 | ); | 183531 | ); |
| 183557 | } else return self.fail("TODO implement airSelect for {}", .{ty.fmt(pt)}); | 183532 | } else return self.fail("TODO implement airSelect for {f}", .{ty.fmt(pt)}); |
| 183558 | const elem_bits: u16 = @intCast(elem_abi_size * 8); | 183533 | const elem_bits: u16 = @intCast(elem_abi_size * 8); |
| 183559 | if (!pred_fits_in_elem) if (self.hasFeature(.ssse3)) { | 183534 | if (!pred_fits_in_elem) if (self.hasFeature(.ssse3)) { |
| 183560 | const mask_len = elem_abi_size * vec_len; | 183535 | const mask_len = elem_abi_size * vec_len; |
| ... | @@ -183583,7 +183558,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183583,7 +183558,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183583 | mask_alias, | 183558 | mask_alias, |
| 183584 | mask_mem, | 183559 | mask_mem, |
| 183585 | ); | 183560 | ); |
| 183586 | } else return self.fail("TODO implement airSelect for {}", .{ty.fmt(pt)}); | 183561 | } else return self.fail("TODO implement airSelect for {f}", .{ty.fmt(pt)}); |
| 183587 | { | 183562 | { |
| 183588 | const mask_elem_ty = try pt.intType(.unsigned, elem_bits); | 183563 | const mask_elem_ty = try pt.intType(.unsigned, elem_bits); |
| 183589 | const mask_ty = try pt.vectorType(.{ .len = vec_len, .child = mask_elem_ty.toIntern() }); | 183564 | const mask_ty = try pt.vectorType(.{ .len = vec_len, .child = mask_elem_ty.toIntern() }); |
| ... | @@ -183706,7 +183681,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -183706,7 +183681,7 @@ fn airSelect(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 183706 | else => null, | 183681 | else => null, |
| 183707 | }, | 183682 | }, |
| 183708 | }, | 183683 | }, |
| 183709 | }) orelse return self.fail("TODO implement airSelect for {}", .{ty.fmt(pt)}); | 183684 | }) orelse return self.fail("TODO implement airSelect for {f}", .{ty.fmt(pt)}); |
| 183710 | if (has_avx) { | 183685 | if (has_avx) { |
| 183711 | const rhs_alias = if (rhs_mcv.isRegister()) | 183686 | const rhs_alias = if (rhs_mcv.isRegister()) |
| 183712 | registerAlias(rhs_mcv.getReg().?, abi_size) | 183687 | registerAlias(rhs_mcv.getReg().?, abi_size) |
| ... | @@ -184551,7 +184526,7 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -184551,7 +184526,7 @@ fn airShuffle(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 184551 | } | 184526 | } |
| 184552 | | 184527 | |
| 184553 | break :result null; | 184528 | break :result null; |
| 184554 | }) orelse return self.fail("TODO implement airShuffle from {} and {} to {} with {}", .{ | 184529 | }) orelse return self.fail("TODO implement airShuffle from {f} and {f} to {f} with {f}", .{ |
| 184555 | lhs_ty.fmt(pt), | 184530 | lhs_ty.fmt(pt), |
| 184556 | rhs_ty.fmt(pt), | 184531 | rhs_ty.fmt(pt), |
| 184557 | dst_ty.fmt(pt), | 184532 | dst_ty.fmt(pt), |
| ... | @@ -184800,7 +184775,7 @@ fn airMulAdd(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -184800,7 +184775,7 @@ fn airMulAdd(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 184800 | 32, 64 => !self.hasFeature(.fma), | 184775 | 32, 64 => !self.hasFeature(.fma), |
| 184801 | else => unreachable, | 184776 | else => unreachable, |
| 184802 | }) { | 184777 | }) { |
| 184803 | if (ty.zigTypeTag(zcu) != .float) return self.fail("TODO implement airMulAdd for {}", .{ | 184778 | if (ty.zigTypeTag(zcu) != .float) return self.fail("TODO implement airMulAdd for {f}", .{ |
| 184804 | ty.fmt(pt), | 184779 | ty.fmt(pt), |
| 184805 | }); | 184780 | }); |
| 184806 | | 184781 | |
| ... | @@ -184930,7 +184905,7 @@ fn airMulAdd(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -184930,7 +184905,7 @@ fn airMulAdd(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 184930 | else => unreachable, | 184905 | else => unreachable, |
| 184931 | } | 184906 | } |
| 184932 | else | 184907 | else |
| 184933 | unreachable) orelse return self.fail("TODO implement airMulAdd for {}", .{ty.fmt(pt)}); | 184908 | unreachable) orelse return self.fail("TODO implement airMulAdd for {f}", .{ty.fmt(pt)}); |
| 184934 | | 184909 | |
| 184935 | var mops: [3]MCValue = undefined; | 184910 | var mops: [3]MCValue = undefined; |
| 184936 | for (order, mcvs) |mop_index, mcv| mops[mop_index - 1] = mcv; | 184911 | for (order, mcvs) |mop_index, mcv| mops[mop_index - 1] = mcv; |
| ... | @@ -185130,7 +185105,7 @@ fn airVaArg(self: *CodeGen, inst: Air.Inst.Index) !void { | ... | @@ -185130,7 +185105,7 @@ fn airVaArg(self: *CodeGen, inst: Air.Inst.Index) !void { |
| 185130 | assert(classes.len == 1); | 185105 | assert(classes.len == 1); |
| 185131 | unreachable; | 185106 | unreachable; |
| 185132 | }, | 185107 | }, |
| 185133 | else => return self.fail("TODO implement c_va_arg for {} on SysV", .{promote_ty.fmt(pt)}), | 185108 | else => return self.fail("TODO implement c_va_arg for {f} on SysV", .{promote_ty.fmt(pt)}), |
| 185134 | } | 185109 | } |
| 185135 | | 185110 | |
| 185136 | if (unused) break :result .unreach; | 185111 | if (unused) break :result .unreach; |
| ... | @@ -185779,7 +185754,7 @@ fn splitType(self: *CodeGen, comptime parts_len: usize, ty: Type) ![parts_len]Ty | ... | @@ -185779,7 +185754,7 @@ fn splitType(self: *CodeGen, comptime parts_len: usize, ty: Type) ![parts_len]Ty |
| 185779 | for (parts) |part| part_sizes += part.abiSize(zcu); | 185754 | for (parts) |part| part_sizes += part.abiSize(zcu); |
| 185780 | if (part_sizes == ty.abiSize(zcu)) return parts; | 185755 | if (part_sizes == ty.abiSize(zcu)) return parts; |
| 185781 | }; | 185756 | }; |
| 185782 | return self.fail("TODO implement splitType({d}, {})", .{ parts_len, ty.fmt(pt) }); | 185757 | return self.fail("TODO implement splitType({d}, {f})", .{ parts_len, ty.fmt(pt) }); |
| 185783 | } | 185758 | } |
| 185784 | | 185759 | |
| 185785 | /// Truncates the value in the register in place. | 185760 | /// Truncates the value in the register in place. |
| ... | @@ -186153,7 +186128,7 @@ const Temp = struct { | ... | @@ -186153,7 +186128,7 @@ const Temp = struct { |
| 186153 | cg.next_temp_index = @enumFromInt(@intFromEnum(new_temp_index) + 1); | 186128 | cg.next_temp_index = @enumFromInt(@intFromEnum(new_temp_index) + 1); |
| 186154 | const mcv = temp.tracking(cg).short; | 186129 | const mcv = temp.tracking(cg).short; |
| 186155 | switch (mcv) { | 186130 | switch (mcv) { |
| 186156 | else => std.debug.panic("{s}: {}\n", .{ @src().fn_name, mcv }), | 186131 | else => std.debug.panic("{s}: {f}\n", .{ @src().fn_name, mcv }), |
| 186157 | .register => |reg| { | 186132 | .register => |reg| { |
| 186158 | const new_reg = try cg.register_manager.allocReg(new_temp_index.toIndex(), abi.RegisterClass.gp); | 186133 | const new_reg = try cg.register_manager.allocReg(new_temp_index.toIndex(), abi.RegisterClass.gp); |
| 186159 | new_temp_index.tracking(cg).* = .init(.{ .register = new_reg }); | 186134 | new_temp_index.tracking(cg).* = .init(.{ .register = new_reg }); |
| ... | @@ -186227,7 +186202,7 @@ const Temp = struct { | ... | @@ -186227,7 +186202,7 @@ const Temp = struct { |
| 186227 | const new_temp_index = cg.next_temp_index; | 186202 | const new_temp_index = cg.next_temp_index; |
| 186228 | cg.temp_type[@intFromEnum(new_temp_index)] = limb_ty; | 186203 | cg.temp_type[@intFromEnum(new_temp_index)] = limb_ty; |
| 186229 | switch (temp.tracking(cg).short) { | 186204 | switch (temp.tracking(cg).short) { |
| 186230 | else => |mcv| std.debug.panic("{s}: {}\n", .{ @src().fn_name, mcv }), | 186205 | else => |mcv| std.debug.panic("{s}: {f}\n", .{ @src().fn_name, mcv }), |
| 186231 | .immediate => |imm| { | 186206 | .immediate => |imm| { |
| 186232 | assert(limb_index == 0); | 186207 | assert(limb_index == 0); |
| 186233 | new_temp_index.tracking(cg).* = .init(.{ .immediate = imm }); | 186208 | new_temp_index.tracking(cg).* = .init(.{ .immediate = imm }); |
| ... | @@ -186568,7 +186543,7 @@ const Temp = struct { | ... | @@ -186568,7 +186543,7 @@ const Temp = struct { |
| 186568 | }, | 186543 | }, |
| 186569 | else => {}, | 186544 | else => {}, |
| 186570 | } | 186545 | } |
| 186571 | std.debug.panic("{s}: {} {}\n", .{ @src().fn_name, temp_tracking, overflow_temp_tracking }); | 186546 | std.debug.panic("{s}: {f} {f}\n", .{ @src().fn_name, temp_tracking, overflow_temp_tracking }); |
| 186572 | } | 186547 | } |
| 186573 | | 186548 | |
| 186574 | fn asMask(temp: Temp, info: MaskInfo, cg: *CodeGen) void { | 186549 | fn asMask(temp: Temp, info: MaskInfo, cg: *CodeGen) void { |
| ... | @@ -186658,7 +186633,7 @@ const Temp = struct { | ... | @@ -186658,7 +186633,7 @@ const Temp = struct { |
| 186658 | while (try ptr.toLea(cg)) {} | 186633 | while (try ptr.toLea(cg)) {} |
| 186659 | const val_mcv = val.tracking(cg).short; | 186634 | const val_mcv = val.tracking(cg).short; |
| 186660 | switch (val_mcv) { | 186635 | switch (val_mcv) { |
| 186661 | else => |mcv| std.debug.panic("{s}: {}\n", .{ @src().fn_name, mcv }), | 186636 | else => |mcv| std.debug.panic("{s}: {f}\n", .{ @src().fn_name, mcv }), |
| 186662 | .register => |val_reg| try ptr.loadReg(val_ty, registerAlias( | 186637 | .register => |val_reg| try ptr.loadReg(val_ty, registerAlias( |
| 186663 | val_reg, | 186638 | val_reg, |
| 186664 | @intCast(val_ty.abiSize(cg.pt.zcu)), | 186639 | @intCast(val_ty.abiSize(cg.pt.zcu)), |
| ... | @@ -186698,7 +186673,7 @@ const Temp = struct { | ... | @@ -186698,7 +186673,7 @@ const Temp = struct { |
| 186698 | {}) { | 186673 | {}) { |
| 186699 | const val_mcv = val.tracking(cg).short; | 186674 | const val_mcv = val.tracking(cg).short; |
| 186700 | switch (val_mcv) { | 186675 | switch (val_mcv) { |
| 186701 | else => |mcv| std.debug.panic("{s}: {}\n", .{ @src().fn_name, mcv }), | 186676 | else => |mcv| std.debug.panic("{s}: {f}\n", .{ @src().fn_name, mcv }), |
| 186702 | .undef => if (opts.safe) { | 186677 | .undef => if (opts.safe) { |
| 186703 | var pat = try cg.tempInit(.u8, .{ .immediate = 0xaa }); | 186678 | var pat = try cg.tempInit(.u8, .{ .immediate = 0xaa }); |
| 186704 | var len = try cg.tempInit(.usize, .{ .immediate = val_ty.abiSize(cg.pt.zcu) }); | 186679 | var len = try cg.tempInit(.usize, .{ .immediate = val_ty.abiSize(cg.pt.zcu) }); |
| ... | @@ -186772,7 +186747,7 @@ const Temp = struct { | ... | @@ -186772,7 +186747,7 @@ const Temp = struct { |
| 186772 | assert(!val_ty.optionalReprIsPayload(cg.pt.zcu)); | 186747 | assert(!val_ty.optionalReprIsPayload(cg.pt.zcu)); |
| 186773 | break :first_ty opt_child; | 186748 | break :first_ty opt_child; |
| 186774 | }, | 186749 | }, |
| 186775 | else => std.debug.panic("{s}: {}\n", .{ @src().fn_name, val_ty.fmt(cg.pt) }), | 186750 | else => std.debug.panic("{s}: {f}\n", .{ @src().fn_name, val_ty.fmt(cg.pt) }), |
| 186776 | }); | 186751 | }); |
| 186777 | const first_size: u31 = @intCast(first_ty.abiSize(cg.pt.zcu)); | 186752 | const first_size: u31 = @intCast(first_ty.abiSize(cg.pt.zcu)); |
| 186778 | try ptr.storeRegs(first_ty, &.{registerAlias(val_reg_ov.reg, first_size)}, cg); | 186753 | try ptr.storeRegs(first_ty, &.{registerAlias(val_reg_ov.reg, first_size)}, cg); |
| ... | @@ -186804,7 +186779,7 @@ const Temp = struct { | ... | @@ -186804,7 +186779,7 @@ const Temp = struct { |
| 186804 | | 186779 | |
| 186805 | fn readTo(src: *Temp, val_ty: Type, val_mcv: MCValue, opts: AccessOptions, cg: *CodeGen) InnerError!void { | 186780 | fn readTo(src: *Temp, val_ty: Type, val_mcv: MCValue, opts: AccessOptions, cg: *CodeGen) InnerError!void { |
| 186806 | switch (val_mcv) { | 186781 | switch (val_mcv) { |
| 186807 | else => |mcv| std.debug.panic("{s}: {}\n", .{ @src().fn_name, mcv }), | 186782 | else => |mcv| std.debug.panic("{s}: {f}\n", .{ @src().fn_name, mcv }), |
| 186808 | .register => |val_reg| try src.readReg(opts.disp, val_ty, registerAlias( | 186783 | .register => |val_reg| try src.readReg(opts.disp, val_ty, registerAlias( |
| 186809 | val_reg, | 186784 | val_reg, |
| 186810 | @intCast(cg.unalignedSize(val_ty)), | 186785 | @intCast(cg.unalignedSize(val_ty)), |
| ... | @@ -186844,7 +186819,7 @@ const Temp = struct { | ... | @@ -186844,7 +186819,7 @@ const Temp = struct { |
| 186844 | {}) { | 186819 | {}) { |
| 186845 | const val_mcv = val.tracking(cg).short; | 186820 | const val_mcv = val.tracking(cg).short; |
| 186846 | switch (val_mcv) { | 186821 | switch (val_mcv) { |
| 186847 | else => |mcv| std.debug.panic("{s}: {}\n", .{ @src().fn_name, mcv }), | 186822 | else => |mcv| std.debug.panic("{s}: {f}\n", .{ @src().fn_name, mcv }), |
| 186848 | .none => {}, | 186823 | .none => {}, |
| 186849 | .undef => if (opts.safe) { | 186824 | .undef => if (opts.safe) { |
| 186850 | var dst_ptr = try cg.tempInit(.usize, dst.tracking(cg).short.address().offset(opts.disp)); | 186825 | var dst_ptr = try cg.tempInit(.usize, dst.tracking(cg).short.address().offset(opts.disp)); |
| ... | @@ -186905,7 +186880,7 @@ const Temp = struct { | ... | @@ -186905,7 +186880,7 @@ const Temp = struct { |
| 186905 | assert(!val_ty.optionalReprIsPayload(cg.pt.zcu)); | 186880 | assert(!val_ty.optionalReprIsPayload(cg.pt.zcu)); |
| 186906 | break :first_ty opt_child; | 186881 | break :first_ty opt_child; |
| 186907 | }, | 186882 | }, |
| 186908 | else => std.debug.panic("{s}: {}\n", .{ @src().fn_name, val_ty.fmt(cg.pt) }), | 186883 | else => std.debug.panic("{s}: {f}\n", .{ @src().fn_name, val_ty.fmt(cg.pt) }), |
| 186909 | }); | 186884 | }); |
| 186910 | const first_size: u31 = @intCast(first_ty.abiSize(cg.pt.zcu)); | 186885 | const first_size: u31 = @intCast(first_ty.abiSize(cg.pt.zcu)); |
| 186911 | try dst.writeReg(opts.disp, first_ty, registerAlias(val_reg_ov.reg, first_size), cg); | 186886 | try dst.writeReg(opts.disp, first_ty, registerAlias(val_reg_ov.reg, first_size), cg); |
| ... | @@ -191677,12 +191652,12 @@ const Temp = struct { | ... | @@ -191677,12 +191652,12 @@ const Temp = struct { |
| 191677 | break :result result; | 191652 | break :result result; |
| 191678 | }, | 191653 | }, |
| 191679 | }; | 191654 | }; |
| 191680 | tracking_log.debug("{} => {} (birth)", .{ inst, result }); | 191655 | tracking_log.debug("{f} => {f} (birth)", .{ inst, result }); |
| 191681 | cg.inst_tracking.putAssumeCapacityNoClobber(inst, .init(result)); | 191656 | cg.inst_tracking.putAssumeCapacityNoClobber(inst, .init(result)); |
| 191682 | }, | 191657 | }, |
| 191683 | .temp => |temp_index| { | 191658 | .temp => |temp_index| { |
| 191684 | const temp_tracking = temp_index.tracking(cg); | 191659 | const temp_tracking = temp_index.tracking(cg); |
| 191685 | tracking_log.debug("{} => {} (birth)", .{ inst, temp_tracking.short }); | 191660 | tracking_log.debug("{f} => {f} (birth)", .{ inst, temp_tracking.short }); |
| 191686 | cg.inst_tracking.putAssumeCapacityNoClobber(inst, .init(temp_tracking.short)); | 191661 | cg.inst_tracking.putAssumeCapacityNoClobber(inst, .init(temp_tracking.short)); |
| 191687 | assert(cg.reuseTemp(inst, temp_index.toIndex(), temp_tracking)); | 191662 | assert(cg.reuseTemp(inst, temp_index.toIndex(), temp_tracking)); |
| 191688 | }, | 191663 | }, |
| ... | @@ -191757,7 +191732,7 @@ fn resetTemps(cg: *CodeGen, from_index: Temp.Index) InnerError!void { | ... | @@ -191757,7 +191732,7 @@ fn resetTemps(cg: *CodeGen, from_index: Temp.Index) InnerError!void { |
| 191757 | const temp: Temp.Index = @enumFromInt(temp_index); | 191732 | const temp: Temp.Index = @enumFromInt(temp_index); |
| 191758 | if (temp.isValid(cg)) { | 191733 | if (temp.isValid(cg)) { |
| 191759 | any_valid = true; | 191734 | any_valid = true; |
| 191760 | tracking_log.err("failed to kill {}: {}", .{ | 191735 | tracking_log.err("failed to kill {f}: {f}", .{ |
| 191761 | temp.toIndex(), | 191736 | temp.toIndex(), |
| 191762 | cg.temp_type[temp_index].fmt(cg.pt), | 191737 | cg.temp_type[temp_index].fmt(cg.pt), |
| 191763 | }); | 191738 | }); |