From f3ba72cf5a7e2c40c6a10fd987e7f4486c2b9300 Mon Sep 17 00:00:00 2001 From: Jacob G-W Date: Wed, 10 Nov 2021 14:25:43 -0500 Subject: [PATCH] x86_64/Emit: don't misisel push/pop for extended regs --- src/arch/x86_64/Emit.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arch/x86_64/Emit.zig b/src/arch/x86_64/Emit.zig index 3c53e5f680..7430b8065b 100644 --- a/src/arch/x86_64/Emit.zig +++ b/src/arch/x86_64/Emit.zig @@ -197,7 +197,10 @@ fn mirPushPop(emit: *Emit, tag: Mir.Inst.Tag, inst: Mir.Inst.Index) InnerError!v .pop => 0x58, else => unreachable, }; - const encoder = try Encoder.init(emit.code, 1); + const encoder = try Encoder.init(emit.code, 2); + encoder.rex(.{ + .b = ops.reg1.isExtended(), + }); encoder.opcode_withReg(opc, ops.reg1.lowId()); }, 0b01 => {