The target description captures most information about registers and instructions. To access that information, we must implement the M88kRegisterInfo and…
One crucial part is still missing: we need to define the pass that performs the DAG transformations defined in the…
The return values are handled similarly. However, we must extend the target description for them. First, we need to define…
Let’s turn to another important task performed by the M88kISelLowering class. We defined the rules for the calling convention in…
Let’s implement the M88kISelLowering class, which is stored in M88kISelLowering.cpp file, first. The constructor configures the legal types and operations:…
Creating machine instructions from the IR is a very important task in the backend. One common way to implement it…
For a calling convention, there are also more predefined conditions and actions to note. For example, CCIfInReg checks if the…
The heart of any backend is instruction selection. LLVM implements several approaches; in this chapter, we will implement instruction selection…
Implementing the disassembler is optional. However, the implementation does not require too much effort, and generating the disassembler table may…
The parseRegister() method tries to parse a register. First, it checks for a percent sign %. If this is followed…