Skip to content

Commit

Permalink
bootstrap/x86_64: Implement movabs codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
48cf committed Oct 28, 2023
1 parent a0bbe7a commit 98ea747
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bootstrap/backends/x86_64.zig
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ fn movImmToReg(writer: *backends.Writer, op_t: ir.InstrType, dest_reg: u8, value
const value_bytes = std.mem.asBytes(&i32_value);
try writeDirect(writer, op_t, &.{0xC6 | boolToU8(op_t != .u8)}, dest_reg, 0, if(op_t == .u8) value_bytes[0..1] else value_bytes, false);
} else {
@panic("TODO");
std.debug.assert(dest_reg <= 0x7);
try rexPrefix(writer, true, false, false, false, false);
try writer.writeInt(u8, 0xB8 | (dest_reg & 0x7));
try writer.write(std.mem.asBytes(&value));
}
}

Expand Down

0 comments on commit 98ea747

Please sign in to comment.