Show HN: LLVM-Z80 - I wrote a complete LLVM backend with AI
1 points
by zlfn
1 hour ago
| 0 comments
| github.com
| HN
Two years ago, I started a project called Rust-GB to compile Rust for the Game Boy.

At the time, no stable LLVM backend supported the Game Boy’s CPU.

I had to use a complex workaround: transpiling Rust to C via LLVM-CBE and then compiling that C code using SDCC.

Back then, building a native LLVM backend was a dream, but I lacked the time to do it alone.

Fast forward two years, and things have changed.

With the help of LLMs, I have successfully implemented a complete LLVM-Z80 backend, including subtarget support for the Game Boy's SM83.

In terms of performance, it generally outperforms SDCC, though it currently produces larger binary sizes.

While there are still some latent bugs and upstream LLVM core issues to address, I’ve successfully compiled most C programs and the entire Rust core library.

I’d love to hear your feedback or any questions regarding the backend!

- LLVM-Z80: https://github.com/llvm-z80/llvm-z80 / Rust-Z80: https://github.com/llvm-z80/rust-z80

No one has commented on this post.