Module Fang_x64
Compiler functionality specialized to the x86-64 architecture.
Registers
For simplicity, Fang uses a uniform representation of a machine word for all values. Thus, while x86-64 registers are "segmented" into registers of different sizes (for example, eax
is the 32 b segment of the ax
register) we only ever use the 64 b variants (e.g, rax
).
val ax : box
val bx : box
val cx : box
val dx : box
val si : box
val di : box
val sp : box
val bp : box
val r8 : box
val r9 : box
val r10 : box
val r11 : box
val r12 : box
val r13 : box
val r14 : box
val r15 : box
val pp_reg : box Fmt.t
Translation to IR
Emitting flow graphs
module Emit : sig ... end
Register allocation
module Alloc : ALLOC with type spilling_handler = Spilling.handler
Producing the final assembly
The assembly produced is compatible with the internal assemblers of both GCC and Clang.
val pp_asm_string : label -> string Fmt.t
Pretty-print assembly for a constant string with the given label.