sd:llvm_backend_for_sd-8516
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sd:llvm_backend_for_sd-8516 [2026/06/10 15:47] – created appledog | sd:llvm_backend_for_sd-8516 [2026/06/18 05:31] (current) – appledog | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| This period is binary. It compiles or it does not. There is no incremental improvement here. I learned a lot and actually changed my ISA a bit because of what I learned doing this. But, I do not remember anything I did here. It is a black hole. I've probably blocked it out of my memory. It was that horrifying. | This period is binary. It compiles or it does not. There is no incremental improvement here. I learned a lot and actually changed my ISA a bit because of what I learned doing this. But, I do not remember anything I did here. It is a black hole. I've probably blocked it out of my memory. It was that horrifying. | ||
| - | == June 2026 | + | === Notes from April/May |
| - | A sudden thrust of energy, cola and Doritos and the back-end was in sight. A lot of this was fueled by excitement over many small wins. Such as getting something to work. Once I saw it start to emit SDA assembly I was hooked. Many small changes to the assembler were made too, to support LLVM stuff that I didn't want to try and lower out. | + | |
| - | + | ||
| - | === Notes from June | + | |
| * That stupid string that looks like e-p: | * That stupid string that looks like e-p: | ||
| ** '' | ** '' | ||
| + | |||
| + | //Total cost of this note alone: Probably 6 hours.// | ||
| * COMMON files I need to find: | * COMMON files I need to find: | ||
| Line 26: | Line 25: | ||
| * Look very carefully at the error message. 90% of the time you're missing a header, a function declaration, | * Look very carefully at the error message. 90% of the time you're missing a header, a function declaration, | ||
| * Use git or you will mess stuff up and be unable to go back. | * Use git or you will mess stuff up and be unable to go back. | ||
| + | |||
| + | == June 2026 | ||
| + | A sudden thrust of energy, cola and Doritos and the back-end was in sight. A lot of this was fueled by excitement over many small wins. Such as getting something to work. Once I saw it start to emit SDA assembly I was hooked. Many small changes to the assembler were made too, to support LLVM stuff that I didn't want to try and lower out. One example of an extreme change I made was to remove MOV touching the zero flag because I couldn' | ||
| + | |||
| + | Suddenly I was out of the tunnel and I didn't even realize it. I decided to skip some stuff that would have made the generated code " | ||
| + | |||
| + | * Remember: jumptables for large switches | ||
| + | * Remember: mul and div calling functions versus inlining | ||
| + | |||
| + | * [[Notes to Self from June]] | ||
| + | |||
| + | * [[Runtime Library Notes]] | ||
| + | |||
| + | === Truncating i8 stores | ||
| + | Truncating stores for i8-- STAL for char. | ||
| + | |||
| + | "If it's legal, keep it legal" says reflect what the hardware actually does and skip the legalizer' | ||
| + | |||
| + | In the end it emits STAL [ptr] either way. | ||
| + | |||
| + | === Marking things SR | ||
| + | Marking things SR does not protect against all stages of LLVM lowering. Sometimes disparate parts try to insert things between CMP and Bcc/Jcc. The solution is to fuse them in the backend. Ask yourself, does a branch instruction that relies on a CMP EVER //need// anything between the CMP and the branch? If so, since the branch is guaranteed, why not move the code into the branch? | ||
| + | |||
| + | == Meeting LLVM halfway | ||
| + | There are a lot of 'easy fixes' such as adding a LEA style instruction, | ||
| + | |||
| + | This is a hidden issue regarding C, compilers, and CPUs. The CPU has, for a long time, adapted to C. As C has adapted to the CPU. It's a symbiosis. But C won't last forever and maybe there are better ways to do things. If VAX can ship an __insque() maybe insque should be standard? | ||
| + | |||
| + | Not everything is a lowest common denominator. That's bland. C, or some language else, should be able to reflect upon what makes a CPU special and unique. That's part of the joy of assembly; exploring truly new mindscapes of architecture. Realizing why certain ideas work better than others considering the hardware. | ||
sd/llvm_backend_for_sd-8516.1781106453.txt.gz · Last modified: by appledog
