A.D.A. Amiga Demoscene Archive

  Welcome guest! Please register a new account or log in

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Demos / GCC 10

 

Author Message
Jamie2021
Member
#1 - Posted: 12 Jul 2021 18:12
Reply Quote
Our previous demos were compiled with an old gcc, I always wanted to test the new version of Bartman but I never managed to run it. I finally decided to spend a little more time there and here are the results for Chapter7

All version use 77K of assembler
GCC 3.2 453ko (~77k ASM, ~376k CPP)
GCC 6.5 233ko (~77k ASM, ~156k CPP)
GCC 10.1 137ko (~77k ASM, ~60k CPP)
todi
Member
#2 - Posted: 13 Jul 2021 20:28
Reply Quote
Nice, but how is the speed, same?
Jamie2021
Member
#3 - Posted: 13 Jul 2021 21:45
Reply Quote
The executable is compiled, linked but does not work yet. Since I am converting the code to assembler which is used during realtime frames, the speed is probably going to be the same
todi
Member
#4 - Posted: 13 Jul 2021 22:55 - Edited
Reply Quote
Ok, was thinking GCC 3.2/6.5 was doing some unrolling that 10.1 didn't do, thats why I was asking about the speed. This looks pretty promising then! Is this for 68060 FPU or 68020?
Jamie2021
Member
#5 - Posted: 13 Jul 2021 23:55
Reply Quote
The code produced by gcc 10 is much higher in quality than the older versions, big thanks to Bartman/Abyss for the work. I use it for the 68060 + fpu but it can do the whole 68k family.
hellfire
Member
#6 - Posted: 22 Jul 2021 17:11 - Edited
Reply Quote
Hi Jamie, nice to see you're doing things again! :)

Can you maybe show some examples, where GCC10 produced better code and what compiler-flags you use?
For what I have tried so far, it unfortunately doesn't know much about 060-specific optimization (just like VBCC, too).
You can easily experiment with it in compiler explorer btw.

Last time I checked, the standard c libs were still missing for GCC10/68k. Did you build your own?
Jamie2021
Member
#7 - Posted: 22 Jul 2021 20:01
Reply Quote
Hello HellFire,

I never stopped, I'm just really slow :) Making an Unreal/DemoMaker for amiga in DX12 from scratch was not one of my best ideas.

I had used this compiler explorer to see the differences and we didn't see much on little bits of code. What I saw and remembered is that gcc3 was adding a lot of unnecessary instruction and I never managed to strip the code, I had to do it manually. GCC 6.5 had removed all unnecessary instructions but the code size was still big in my case (I had converted Chapter7 from GCC 3.2 to 6.5). The big strength of gcc 10 is the optimization of a complex/full program with a lot of function calls as well as the reduction of code duplication (especially with templates)

Some information on recent optimizations:
https://gcc.gnu.org/wiki/LinkTimeOptimization
https://www.phoronix.com/scan.php?page=news_item&px=GCC-11-m68k-Is-Safe

I use almost the same flags as Bartman, I had to add a few but not really much. It was a little sportier to put all this in visual studio, I wanted to keep vscode only for debugging.

ASM Command:
m68k-amiga-elf-as --register-prefix-optional -m68060 -c -o OBJECTFILE ASMFILE

CPP Command:
m68k-amiga-elf-gcc -g -MP -MMD -m68060 -fast -nostdlib -Wno-unused-function -Wno-volatile-register-var -fomit-frame-pointer -fno-tree-loop-distribution -flto -fwhole-program -fno-exceptions -ffast-math -c -o OBJECTFILE CPPFILE

I used very little the functions of the standard library and it was in my plans to remove it completely. The only functions I have to rewrite are fopen, fseek, ftell, fread, fclose, printf and fabs.

 

  Please register a new account or log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0