mirror of
https://github.com/ziglang/zig.git
synced 2025-12-31 02:23:22 +00:00
stage2: x64: fix printing of callee preserved regs instructions
This commit is contained in:
parent
7665401500
commit
2e9ce6facd
@ -186,8 +186,11 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag,
|
||||
const regs = data.regs;
|
||||
var disp: u32 = data.disp + 8;
|
||||
if (regs == 0) return w.writeAll("no regs from callee_preserved_regs\n");
|
||||
var printed_first_reg = false;
|
||||
for (bits.callee_preserved_regs) |reg, i| {
|
||||
if ((regs >> @intCast(u5, i)) & 1 == 0) continue;
|
||||
if (printed_first_reg) try w.writeAll(" ");
|
||||
printed_first_reg = true;
|
||||
if (tag == .push) {
|
||||
try w.print("mov qword ptr [{s} + {d}], {s}", .{
|
||||
@tagName(ops.reg1),
|
||||
@ -202,8 +205,8 @@ fn mirPushPopRegsFromCalleePreservedRegs(print: *const Print, tag: Mir.Inst.Tag,
|
||||
});
|
||||
}
|
||||
disp += 8;
|
||||
try w.writeByte('\n');
|
||||
}
|
||||
try w.writeByte('\n');
|
||||
}
|
||||
|
||||
fn mirJmpCall(print: *const Print, tag: Mir.Inst.Tag, inst: Mir.Inst.Index, w: anytype) !void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user