authorgravatar for miguel.p.paradinha@gmail.commparadinha <miguel.p.paradinha@gmail.com> 2022-01-23 22:04:50+00:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-01-24 23:19:53+01:00
log2e9ce6facd47189c4bbcd90a2a6ba1a689bfbde3
tree259e9fc054687e0fddc8f491c0ad416c5ad63132
parent76654015009038a07f14b9eb8500bb84e9e28099

stage2: x64: fix printing of callee preserved regs instructions


1 files changed, 4 insertions(+), 1 deletions(-)

src/arch/x86_64/PrintMir.zig+4-1
......@@ -186,8 +186,11 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag,
186186 const regs = data.regs;
187187 var disp: u32 = data.disp + 8;
188188 if (regs == 0) return w.writeAll("no regs from callee_preserved_regs\n");
189 var printed_first_reg = false;
189190 for (bits.callee_preserved_regs) |reg, i| {
190191 if ((regs >> @intCast(u5, i)) & 1 == 0) continue;
192 if (printed_first_reg) try w.writeAll(" ");
193 printed_first_reg = true;
191194 if (tag == .push) {
192195 try w.print("mov qword ptr [{s} + {d}], {s}", .{
193196 @tagName(ops.reg1),
......@@ -202,8 +205,8 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag,
202205 });
203206 }
204207 disp += 8;
208 try w.writeByte('\n');
205209 }
206 try w.writeByte('\n');
207210}
208211
209212fn mirJmpCall(print: *const Print, tag: Mir.Inst.Tag, inst: Mir.Inst.Index, w: anytype) !void {