What would be the easiest way to create a C compiler for a custom CPU, assuming of course I already have an assembler for it?
Since a C compiler generates assembly, is t
Quick overview/tutorial on writing a LLVM backend.
This document describes techniques for writing backends for LLVM which convert the LLVM representation to machine assembly code or other languages.
[ . . . ]
To create a static compiler (one that emits text assembly), you need to implement the following:
- Describe the register set.
- Describe the instruction set.
- Describe the target machine.
- Implement the assembly printer for the architecture.
- Implement an instruction selector for the architecture.