Hacker News new | ask | show | jobs
by woodrowbarlow 2255 days ago
a 6502 backend for LLVM has been attempted a couple times[1][2], but the fact that the 6502 only has three registers imposes severe limitations w.r.t. LLVM's calling conventions.

[1] https://github.com/c64scene-ar/llvm-6502

[2] https://github.com/beholdnec/llvm-m6502

1 comments

Other way around - the idea is to create an LLVM frontend for 6502 machine code, and then transpile that code to run on a modern CPU architecture.
That sounds like an interesting project!

You would probably want to add some tricks directly there, maybe register renaming (I don't know if LLVM does "variable renaming", let's put it this way)