| ... | @@ -186,8 +186,11 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag, | ... | @@ -186,8 +186,11 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag, |
| 186 | const regs = data.regs; | 186 | const regs = data.regs; |
| 187 | var disp: u32 = data.disp + 8; | 187 | var disp: u32 = data.disp + 8; |
| 188 | if (regs == 0) return w.writeAll("no regs from callee_preserved_regs\n"); | 188 | if (regs == 0) return w.writeAll("no regs from callee_preserved_regs\n"); |
| | 189 | var printed_first_reg = false; |
| 189 | for (bits.callee_preserved_regs) |reg, i| { | 190 | for (bits.callee_preserved_regs) |reg, i| { |
| 190 | if ((regs >> @intCast(u5, i)) & 1 == 0) continue; | 191 | if ((regs >> @intCast(u5, i)) & 1 == 0) continue; |
| | 192 | if (printed_first_reg) try w.writeAll(" "); |
| | 193 | printed_first_reg = true; |
| 191 | if (tag == .push) { | 194 | if (tag == .push) { |
| 192 | try w.print("mov qword ptr [{s} + {d}], {s}", .{ | 195 | try w.print("mov qword ptr [{s} + {d}], {s}", .{ |
| 193 | @tagName(ops.reg1), | 196 | @tagName(ops.reg1), |
| ... | @@ -202,8 +205,8 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag, | ... | @@ -202,8 +205,8 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag, |
| 202 | }); | 205 | }); |
| 203 | } | 206 | } |
| 204 | disp += 8; | 207 | disp += 8; |
| | 208 | try w.writeByte('\n'); |
| 205 | } | 209 | } |
| 206 | try w.writeByte('\n'); | | |
| 207 | } | 210 | } |
| 208 | | 211 | |
| 209 | fn mirJmpCall(print: *const Print, tag: Mir.Inst.Tag, inst: Mir.Inst.Index, w: anytype) !void { | 212 | fn mirJmpCall(print: *const Print, tag: Mir.Inst.Tag, inst: Mir.Inst.Index, w: anytype) !void { |