Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The backend is only ~1300 lines. QBE is a super simple project which is why adding a backend to it worked so well. I just pointed Claude at the existing RISC-V backend for reference and it whipped up the MIPS one. It really does work, though there might be bugs I didn't run into. I compiled an Amiga MOD player, written in my language, to the N64 and it worked fine, if that gives you an idea of how stress tested it was. IIRC it runs about 5x slower than GCC-generated code.

https://gist.github.com/SuperDisk/1aa50263a773143c82a39d4771...



Interesting, thanks for posting. I had a first look and think that the AI has messed up with the floating-point and casting instructions (i.e. just copied over the RV instructions). I also spotted other places (e.g. TLS) which look like RV. It's also surprising that the code - as you say - is so much slower than (optimized?) GCC, since QBE is assumed to be at 70-80%.


The page says "aims to provide 70%" though, funny how words spread.


There are reports by independend testers (e.g. https://briancallahan.net/blog/20211010.html or https://news.ycombinator.com/item?id=40350384) suggesting that range.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: