Skip to content

Commit

Permalink
x86_64: use .rax for local exec as prescribed by the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon authored and jacobly0 committed Nov 12, 2023
1 parent c6833e6 commit 3d3153c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arch/x86_64/Lower.zig
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,14 @@ fn emit(lower: *Lower, prefix: Prefix, mnemonic: Mnemonic, ops: []const Operand)
// Since we are linking statically, we emit LE model directly.
lower.result_insts[lower.result_insts_len] =
try Instruction.new(.none, .mov, &[_]Operand{
.{ .reg = ops[0].reg.to64() },
.{ .reg = .rax },
.{ .mem = Memory.sib(.qword, .{ .base = .{ .reg = .fs } }) },
});
lower.result_insts_len += 1;
_ = lower.reloc(.{ .linker_reloc = sym });
emit_mnemonic = .lea;
break :op .{ .mem = Memory.sib(mem_op.sib.ptr_size, .{
.base = .{ .reg = ops[0].reg.to64() },
.base = .{ .reg = .rax },
.disp = std.math.minInt(i32),
}) };
}
Expand Down

0 comments on commit 3d3153c

Please # to comment.