diff --git a/TODO.md b/TODO.md index 3f23cf7bc..b48f0809b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,3 @@ - ## Instructions ``` @@ -36,11 +35,38 @@ twi ## Codegen +### Tracing + +Tracing modes: +- off (0) +- syscalls (1) +- fn calls (2) +- all instructions (3) + +Inject extern functions into module: +- XeTraceKernelCall(caller_ia, cia, name, state) +- XeTraceUserCall(caller_ia, cia, name, state) +- XeTraceInstruction(cia, name, state) + +### Calling convention + +Experiment with fastcc? May need typedef fn ptrs to call into the JITted code. + ### Indirect branches (ctr/lr) emit_control.cc XeEmitBranchTo Need to take the value in LR/CTR and do something with it. +Return path: +- In SDB see if the function follows the 'return' semantic: + - mfspr LR / mtspr LR/CTR / bcctr -- at end? +- In codegen add a BB that is just return. +- If a block 'returns', branch to the return BB. + +Tail calls: +- If in a call BB check next BB. +- If next is a return, optimize to a tail call. + Fast path: - Every time LR would be stashed, add the value of LR (some NIA) to a lookup table.