Scene.org Demoscene News Service

New 680x0 targetting C compiler from Reservoir Gods

[ Atariscne.org - News ] New 680x0 targetting C compiler from Reservoir Gods

Introducing rg-cc: A 680x0-First C99 Compiler from Reservoir Gods   Back in the day, we used to write everything in 68000 assembly. Whilst fun, it could be painfully slow, so we moved to C for high-level game logic and assembly for the performance critical code.   When we started getting some of our abandoned old projects back up and running, we hit bugs and performance issues with VBCC. We considered either going back to Pure C, or working with one of the less 68k friendly modern compilers.   But then we had a thought. What if we could build a new C compiler, with all the modern features and optimisations of the latest compilers, but design it around the 68k architecture so it could produce the most optimal code for that CPU?   This idea became the design ethos behind a new C compiler. Instead of only caring about 68k instructions in the final backend pass, rg-cc infuses every layer of the compiler with deep knowledge of this CPU architecture.The intermediate representation that rg-cc uses during compilation isn't based around some generic RISC-like instruction set; instead, we use an IR modelled around the 680x0 feature set, registers, branching instructions and addressing modes. This means we can do high-level optimisations in "68k space" before we even get to assembly layout.   Our benchmarks were promising. Across the majority of our 1,000+ compiler tests, rg-cc outperforms GCC, Clang, Pure C, VBCC, and AHCC on both cycle count and binary size when making 680x0 executables.