3 ms·
> my compiler generates faster code than GCC, LLVM, and every other compiler I compared it to GCC and LLVM can target the 6502?!?
by commandlinefan 4y ago
> my compiler generates faster code than GCC, LLVM, and every other compiler I compared it to
GCC and LLVM can target the 6502?!?
- binarycrusader 4y agoFor LLVM, I don’t think it’s in the official repo, but yes: https://github.com/llvm-mos/llvm-mos https://github.com/llvm-mos/llvm-mos
- pubby 4y agoI think it's possible LLVM-MOS gets into mainline LLVM eventually. The devs have done a good job getting all the kinks ironed out. BTW, mysterymath, one of the most prominent LLVM-MOS contributors, left this comment on their current code gen. (I'm posting it here for visibility): "In LLVM-MOS, we mainly struggle with its register allocator; the rest of the backend is really quite reasonable. The "Greedy register allocator" in LLVM is a just finely tuned priority allocator with nice live-range splitting. It works great for zero page cache locations, but it's just not tuned very well for tight register classes like those involving the processor's three architectural registers. I've half a mind to implement Hack's SSA-based register allocator in LLVM to use on A, X, and Y; this would clean up the oodles of spurious copies LLVM-MOS spits out in the worst cases."
- acuozzo 4y agoGCC: Via an old, unofficial port: https://github.com/itszor/gcc-6502 https://github.com/itszor/gcc-6502