Core
From Libcpu
The libcpu core is responsible for
- the client interface
- code scanning and tagging
- code linking and dispatching logic
TODO
- big optimization feature: detect functions, convert them into LLVM functions; treat stack accesses as accesses to local array (SP-n) or argument array (SP+n)
- this "the arch has five 8 bit registers, twelve 16 bit registers, and a special program counter" is weird. There should be a formal description like:
"R" i32 * 32 "F" f64 * 32 "CTR" i32 "LR" i32
This description (it could be an array) will replace the struct in arch_types. The core will then generate the struct layout at runtime, which guarantees that the core and translated layout match. The nice thing: If the client needs to access the register file, he can ask for a pointer to a register by name, like:
void *cpu_get_reg_pointer(const char *name)
"name" could be "LR" or "R1"
