Is it possible to improve the speed of gas64? Currently gas64 is twice as slow as gas.SARG wrote: ↑Mar 04, 2024 10:02Thank you for the report and the help you gave me via discordXusinboy Bekchanov wrote: ↑Mar 04, 2024 8:00 After the latest changes in the compiler, the program no longer crashes in gas64, thank you very much.![]()
Gas64 (no more use of gcc, only gas) WDS / LNX
-
- Posts: 879
- Joined: Jul 26, 2018 18:28
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
Compil time or running time ?
If compil time that's possible as there are optimizations done for speed when executing.
I can provide you a version without these optimizations.
In fact I'm pretty sure that processors are so 'clever' that optimizations done are useless.
If compil time that's possible as there are optimizations done for speed when executing.
I can provide you a version without these optimizations.
In fact I'm pretty sure that processors are so 'clever' that optimizations done are useless.
-
- Posts: 879
- Joined: Jul 26, 2018 18:28
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
Compilation time. If I compile with 32-bit gas, the compilation of IDE source files into an asm file takes 14.34 seconds. And assembly takes 3 seconds. If I compile with 64-bit gas64, the compilation of IDE source files into an asm file takes 30.02 seconds. And assembly takes 3 seconds as well.
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
I sent you a test version on Discord. No warranty it works (no compilation fail and better time.....)
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
I managed to get a much shorter compilation time when gas64 is used (for 1.20 version).
For those interested : https://users.freebasic-portal.de/sarg/fbc64_gas64.zip
Please report time savings and any possible bug.

For those interested : https://users.freebasic-portal.de/sarg/fbc64_gas64.zip
Please report time savings and any possible bug.
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
Hi VANYA,
Yes all changes planned for 1.2 are included.
I changed all longs by integers (faster operations on 64bit) and mainly in only one procedure (the check for freeing registers) removed many operations (move, test, instr) on strings replaced by tests on longs via pointers. Plus others improvements elsewhere.
Tested on xusinboy's editor source the compilation without assembling/linking is reduced by 2.5/3 time. I'm expecting a report from his side.
Nota : I find a bug with for-next loops using single variable due to some wrong optimization (not related to the last changes I guess) I have to investigate.
-
- Posts: 879
- Joined: Jul 26, 2018 18:28
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
Hello, very good result, better than gas32.SARG wrote: ↑Jun 02, 2025 10:10 I managed to get a much shorter compilation time when gas64 is used (for 1.20 version).![]()
For those interested : https://users.freebasic-portal.de/sarg/fbc64_gas64.zip
Please report time savings and any possible bug.
gas32 compiles in 14.31 seconds, and gas64 in 10.98 seconds.
I am very happy, thank you very much. I should check Stack Overflow while running the IDE.
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
I ran a test on my project.:
gas32:
fbc -pp fbnp.bas
3 seconds
fbc fbnp.bas -o fbnp.asm
2 seconds
gas64:
fbc -pp fbnp.bas
3 seconds
fbc fbnp.bas -o fbnp.asm
25 seconds
And although for some reason they both could not compile the project into an ASM file, they returned the same errors, but at different times. The GAS64 compiler still has room to improve in terms of code optimization. The usual compilation runs without problems. I'm still investigating the issue with the output to the ASM file.
------------
upd:
I understood why it is not possible to compile to an ASM file. There is a macro in the source file that prevents this from happening:
gas32:
fbc -pp fbnp.bas
3 seconds
fbc fbnp.bas -o fbnp.asm
2 seconds
gas64:
fbc -pp fbnp.bas
3 seconds
fbc fbnp.bas -o fbnp.asm
25 seconds
And although for some reason they both could not compile the project into an ASM file, they returned the same errors, but at different times. The GAS64 compiler still has room to improve in terms of code optimization. The usual compilation runs without problems. I'm still investigating the issue with the output to the ASM file.
------------
upd:
I understood why it is not possible to compile to an ASM file. There is a macro in the source file that prevents this from happening:
Code: Select all
#if __fb_out_exe__
here variables
#endif
use variables ' error for output ASM
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
@xusinboy Thanks. And that's you fault, you push me to do that 
All final code generators (even C) receives small elements of information one by one, very close of asm instruction so no global vision.
2 ways of improvement :
1/Currently all the optimizations made in gas64 are by analysing the currentl line of code with the previous one so there is no great possibility.
It could be possible to do better if working on much more lines (3 or 4). The problem will be a compilation time increased.
2/working at a higher level in the compiler but it's a huge job.
Any idea welcome so maybe we can exchange on the subject (by message).
BTW I didn't know this define : #if __fb_out_exe__ (and its brothers)

I already explained how backend generation works.
All final code generators (even C) receives small elements of information one by one, very close of asm instruction so no global vision.
2 ways of improvement :
1/Currently all the optimizations made in gas64 are by analysing the currentl line of code with the previous one so there is no great possibility.
It could be possible to do better if working on much more lines (3 or 4). The problem will be a compilation time increased.
2/working at a higher level in the compiler but it's a huge job.
Any idea welcome so maybe we can exchange on the subject (by message).
BTW I didn't know this define : #if __fb_out_exe__ (and its brothers)

Re: Gas64 (no more use of gcc, only gas) WDS / LNX
Bug found and easy to fix. Next version tomorrow.
Btw I still have some improvements but I'll implement them later.
Btw I still have some improvements but I'll implement them later.
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
I wanted to see the difference in execution speed of gas32 and gas64 using profiling, but I couldn't do it. Still, the difference in time in seconds is colossal: gas32 2 sec vs gas64 25 sec
I tried to build a compiler with such options:
But he failed because of the problems with the link:
I tried to build a compiler with such options:
Code: Select all
make compiler ENABLE_STANDALONE=1 FBCFLAGS=-profile
The libgmon.a library exists, but for some reason the linker gives an error.undefined reference to `mcount'
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
What are you compiling ?
Have you tried to compile with the new option : -profgen < profiler > (either fb or cycles). It needs 1.20undefined reference to `mcount'
The old way is problematic.
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
IUP_FB_EDITOR
The code is the same. The number of lines after the preprocessor is about the same. So the bottleneck is: Gas64
Of course, this is relative to Gas32. Because GAS64 is the same speed as (GCC without optimization options).
Maybe somewhere we need to remove runtime functions and replace them with pure C functions for better optimization?
I don't understand why there is such a gap in compilation speed between gas32 and gas64
I have not put/setup a 1.20 version yet
Re: Gas64 (no more use of gcc, only gas) WDS / LNX
I compiled on my side iup_fb_editor in less than 3 secondes so I don't understand of what you are talking 25sec ???