The translation from LLVM IR to generic machine code is mostly fixed. As a result, instructions can be generated that…
The implementation of the class is stored in the M88kTargetMachine.cpp file. Please note that we created this file in Chapter…
Finally, we can implement the M88kTargetMachine class. This class holds all used sub-target instances. It also owns a subclass of…
Creating the target machine and the sub-targetSo far, we’ve implemented the instruction selection classes and a couple of other classes.…
The instruction selection creates machine instructions, represented by the MachineInstr class, from LLVM IR. But this is not the end.…
The M88kInstrInfo class has many hook methods we can override to accomplish special tasks, for example, for branch analysis and…
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…
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…