After, we define the getSubtargetImpl() method. The sub-target instance to use depends on the target-cpu and target-features function attributes. For…

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 target description captures most information about registers and instructions. To access that information, we must implement the M88kRegisterInfo and…

The return values are handled similarly. However, we must extend the target description for them. First, we need to define…

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…