Not sure how many of the forum lurkers know, but Matt Godbolt has given us the SH GCC toolchains in Compiler Explorer, which we can now use (with the proper flags) to analyze Dreamcast code generation from C and C++ within the web browser.
The latest SH toolchain version in Compiler Explorer exactly matches the GCC12.2.0 found within our "testing" KOS toolchain configuration, so the code generated should be an exact match once the flags match.
I've written about it on the wiki and have also included the list of flags as well as a link to two "Hello World" templates you can use to quickly slap code into a Dreamcast build environment. The first is C17, the second is C++20:
https://dreamcast.wiki/SH4_in_Compiler_Explorer
Compiler Explorer Dreamcast Templates
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 80 times
- Been thanked: 62 times
- Contact:
Compiler Explorer Dreamcast Templates
- These users thanked the author GyroVorbis for the post:
- Ian Robinson
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 80 times
- Been thanked: 62 times
- Contact:
Re: Compiler Explorer Dreamcast Templates
I've updated the templates to include the new GCC13 toolchain plus GCC versions 4.x.x and 9.x.x to approximate the legacy and stable toolchain configurations for KOS.
I've added details on a few more recommended flags, plus I've added the main results of darc's pvrmark GCC benchmarks.
Hopefully this will be a useful place for people to quickly get a one-click DC-esque compiler environment in the browser with useful optimization tips.
I've added details on a few more recommended flags, plus I've added the main results of darc's pvrmark GCC benchmarks.
Hopefully this will be a useful place for people to quickly get a one-click DC-esque compiler environment in the browser with useful optimization tips.
-
- DCEmu Webmaster
- Posts: 16375
- Joined: Wed Mar 14, 2001 6:00 pm
- Location: New Orleans, LA
- Has thanked: 105 times
- Been thanked: 91 times
- Contact:
Re: Compiler Explorer Dreamcast Templates
Just keep in mind 4.7.4 (our "legacy" configuration) doesn't have the -mfsrra and -mfsca flags, whereas 4.9.4 does, so this might not be the best comparison.GyroVorbis wrote: ↑Wed May 17, 2023 7:10 am I've updated the templates to include the new GCC13 toolchain plus GCC versions 4.x.x and 9.x.x to approximate the legacy and stable toolchain configurations for KOS.
I have a working patch for building GCC 4.9.4 available in the gccdev branch of KOS, if anyone wants to play with it, but keep in mind it hasn't been tested, and requires your host GCC be version 10 or earlier to build it.
- These users thanked the author |darc| for the post:
- Ian Robinson
It's thinking...
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1874
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has thanked: 80 times
- Been thanked: 62 times
- Contact:
Re: Compiler Explorer Dreamcast Templates
Crap, good point... and I should probably mention those flags aren't supported when I describe them too...|darc| wrote:Just keep in mind 4.7.4 (our "legacy" configuration) doesn't have the -mfsrra and -mfsca flags, whereas 4.9.4 does, so this might not be the best comparison.
Maybe Ian Michael can be the one to test the crap out of it?|darc| wrote:I have a working patch for building GCC 4.9.4 available in the gccdev branch of KOS, if anyone wants to play with it, but keep in mind it hasn't been tested, and requires your host GCC be version 10 or earlier to build it.
- These users thanked the author GyroVorbis for the post:
- Ian Robinson