Module arch

Source
Expand description

arch contains the default architectures supported by codegem. An architecture does not need to be in this module to be supported, as the traits that must be implemented are public and can be implemented by other crates wishing to extend codegem’s functionality.

Modules§

rv64
rv64 provides a backend for the RISC V 64GC architecture.
urcl
urcl provides a backend for the URCL intermediate language, which can be then used to compile to a variety of targets.
x64
x64 provides a backend for the x86_64 architecture.

Structs§

Function
LabelledInstructions
VCode
VCodeGenerator
VCodeGenerator is an internal structure used to generate VCode for a given backend.

Enums§

Location
Location is a representation of a location in VCode.
VReg
VReg is a representation of a register in VCode.

Traits§

Instr
Instr is one of the two traits necessary to implement to define your own backend (the other trait being InstructionSelector). This trait represents an instruction in the target architecture that can be generated by codegem. It also contains various functions related to the generated VCode such as Instr::mandatory_transforms and Instr::emit_assembly.
InstructionSelector
InstructionSelector is the other trait that has to be implemented for a backend. This trait selects instructions to use based on the Operations and Terminators in the provided IR.