Creating the target description
The target description is the heart of a backend implementation. In an ideal world, we could generate the whole backend from the target description. This goal has not yet been reached, and therefore, we need to extend the generated code later. Let's dissect the target description, beginning with the top-level file.
Implementing the top-level file of the target description
We put the files of our new backend into the llvm/lib/Target/M88k
directory. The target description is in the M88k.td
file:
- In this file, we first need to include basic target description classes predefined by LLVM and then the files we are going to create in the next sections:
include "llvm/Target/Target.td" include "M88kRegisterInfo.td" include "M88kCallingConv.td" include "M88kSchedule.td" include "M88kInstrFormats.td" include "M88kInstrInfo.td"
- Next, we also define the supported processor. Among other...