zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 3d3153c58e9ab808c8b1899d3a9de9d1a1030a67 (tree)
parent c6833e6273f5a90059074e6ba5707a516efecb86
Author: Jakub Konka <kubkon@jakubkonka.com>
Date:   Sun, 12 Nov 2023 15:34:16 +0100

x86_64: use .rax for local exec as prescribed by the spec

Diffstat:
Msrc/arch/x86_64/Lower.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/arch/x86_64/Lower.zig b/src/arch/x86_64/Lower.zig @@ -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), }) }; }