Gas64 (no more use of gcc, only gas) WDS / LNX

User projects written in or related to FreeBASIC.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Aug 17, 2020 22:06

Xusinboy Bekchanov wrote:Very good work.
D.J.Peters wrote:@SARG well done I like it :-)
Thank you. Use it at least for bug chasing.

Xusinboy Bekchanov wrote:Now need to merge into the official assembly.
When It will be ready (polishing, optimization) so still a bit of work. I have updated a github repository. Codejeff was able to access to the code for a future integration.
Xusinboy Bekchanov wrote:Will you continue towards Android, MacOS?
What have you in mind ? As gas64 is 'just' an emitter it depends greatly of the runtime lib. More details ?

D.J.Peters wrote:After all your experiments with 64 bit assembler at all can you help "mister fxm" to write the missing
X86_64 inline assembler stuff for the FreeBASIC wiki [please] ?

(Most important in this topic are how to accessing the parameters and local vars and return a function value
from 64bit inline assembler and the differences between Windows 64bit and Linux 64bit.)
That's possible : I have to regroup all elements scattered in code, in files and on paper then format them. :-)
Not exhaustive list, other points welcome :
    byval/byref
    hidden parameter (this)
    simple datatype/structure
    Linux (big piece) / Windows
    Integer/float
    returned value
    shared/local/parameter
Xusinboy Bekchanov
Posts: 254
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Xusinboy Bekchanov » Aug 18, 2020 5:32

SARG wrote:
Xusinboy Bekchanov wrote:Will you continue towards Android, MacOS?
What have you in mind ? As gas64 is 'just' an emitter it depends greatly of the runtime lib. More details ?

Yes I know, but there are some successful attempts to compile for Android and MacOS.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Oct 06, 2020 22:20

Hi all,

After fixing stupid bugs and misunderstandings I ended up to get rid of all the issues of compatibilty between gas64 and gcc.
Unless I have missed something the unit-tests under WDS and LNX don't failed.

Source code compatible with the lastest master (1.08) from Github : https://users.freebasic-portal.de/sarg/ ... ter108.zip
Later I'll provide code/executables for fbc 1.07.

IMPORTANT NOTE : option '-gen gas64' is again mandatory otherwise the compiler uses gcc.

Jeff and I are working to add gas64 into at least fbc 1.08 and maybe also in 1.07.2.
speedfixer
Posts: 420
Joined: Nov 28, 2012 1:27
Location: California

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby speedfixer » Oct 06, 2020 22:35

Amazing work. Thank you both.

david
srvaldez
Posts: 2538
Joined: Sep 25, 2005 21:54

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby srvaldez » Oct 06, 2020 22:48

thank you SARG and Jeff :-)
Xusinboy Bekchanov
Posts: 254
Joined: Jul 26, 2018 18:28

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Xusinboy Bekchanov » Oct 07, 2020 1:41

Thanks to both of you.
dodicat
Posts: 6723
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby dodicat » Oct 07, 2020 10:29

Thanks SARG, gas64 should be part of the distribution.
I have altered my Quick run tool to easily flip between compilers and build options, -gen gas64 e.t.c. mainly for fbide users who cannot get the optimisations from gcc.
I use it often these days including freepascal compilers added to the list.
https://www.freebasic.net/forum/viewtopic.php?f=7&t=27888&p=264633#p264633
I run all my code through -gas64 now, Windows only, I don't have 64 bit Linux.
Provoni
Posts: 391
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Provoni » Oct 07, 2020 14:08

Thanks a bunch SARG. Would love to test it out when it gets included with fbc.

Haven't followed the thread much and I wonder what the pro/con's are versus GCC.
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Oct 07, 2020 19:16

Thank you all for your kind support.

@provoni
pros
- easy use, same than gas32 no gcc necessary : only assembler and linker.
- compilation speed
- speed of exes at least same/better than default gcc
- debugging data following really the basic code (lines, arrays,..) not the case with gcc

- More for FBC's devs, there are a lot of informations for helping the understanding of the emitted asm code.

cons
- can't win against gcc with its optimization options even if there is still some tricks/ideas in my head :-)
- limited to WDS/LNX

- for FBC's devs, a harder maintenance

What OS do you usually use ?
You can grab the zip file (first post) and test gas64 as if it's the regular fbc. With this version no need to add -gen gas it's really like gas32.
If you want to see the asm code add -R and find a file with a64 as extension.

@Others you may also write what you think.
@dodicat really ? So you can answer with good reasons.
coderJeff
Site Admin
Posts: 3342
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby coderJeff » Oct 08, 2020 0:29

SARG wrote:Jeff and I are working to add gas64 into at least fbc 1.08 and maybe also in 1.07.2.

SARG, you are too generous. You know you did like 99.9% of the work on this. :)

dodicat wrote:Thanks SARG, gas64 should be part of the distribution.

For sure SARG's work will be in 1.08.0. All tests pass for me on windows 7 & linux, and passes Travis-CI tests (Ubuntu 16.04 64-bit). It's really close to getting merged in to the main line now. Yes, also testing 1.07.2, though, personally, I feel 1.07.2 was only meant for bug fixes, no new features. Full disclosure: after 1.08.0 is released, I will lose interest in 1.07.2.
Provoni
Posts: 391
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Provoni » Oct 08, 2020 14:16

Hey SARG,

I've tested it with 1.07 on Win10 64-bit and my program works without any issues and compilation speed is very fast. My program has over 40,000 lines and usually takes minutes to compile, now it was done in about 20 seconds. Great work! Though my program runs 1.6x faster with GCC (as you've mentioned). viewtopic.php?f=8&t=23188
jj2007
Posts: 1724
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby jj2007 » Oct 08, 2020 14:36

Provoni wrote:now it was done in about 20 seconds. Great work! Though my program runs 1.6x faster with GCC
Develop it with SARG's compiler, release it compiled with GCC. My 20,000 line programs "compile" in less than 2 seconds, but that is Assembler ;-)
fxm
Posts: 9987
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby fxm » Oct 08, 2020 14:47

coderJeff wrote:For sure SARG's work will be in 1.08.0.

How will bug reports be notified, listed and handled?
SARG
Posts: 1157
Joined: May 27, 2005 7:15
Location: FRANCE

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby SARG » Oct 08, 2020 17:20

coderJeff wrote:
SARG wrote:Jeff and I are working to add gas64 into at least fbc 1.08 and maybe also in 1.07.2.

SARG, you are too generous. You know you did like 99.9% of the work on this. :)
I just wanted to say that it's well planned to integrate gas64 in FBC. And as this integration is mostly your job it's the truth. :-)

Yes, also testing 1.07.2, though, personally, I feel 1.07.2 was only meant for bug fixes, no new features. Full disclosure: after 1.08.0 is released, I will lose interest in 1.07.2.
No problem, as long as 1.08 is not released I continue to provide gas64 for 1.07. So users can test and report bugs.


Provoni wrote:I've tested it with 1.07 on Win10 64-bit and my program works without any issues and compilation speed is very fast. My program has over 40,000 lines and usually takes minutes to compile, now it was done in about 20 seconds. Great work!
Good to read this. Thanks.
Though my program runs 1.6x faster with GCC (as you've mentioned).
Were you using optimization options with gcc ?
Currently the optimizations are done analyzing one line and the previous one. I imagine to extend the analyze to 3, 5 or more lines.
It would also be possible to improve the speed by doing things more upstream but with much change in the compiler and surely without always beating gcc.
I have downloaded your project and maybe I could find in the asm code how to speed up it with new optimizations.

jj2007 wrote:Develop it with SARG's compiler, release it compiled with GCC
Why not ? :-)

fxm wrote:
coderJeff wrote:For sure SARG's work will be in 1.08.0.

How will bug reports be notified, listed and handled?
I suppose the same way as now. What do you have in mind ?
Provoni
Posts: 391
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: Gas64 (no more use of gcc, only gas) WDS / LNX

Postby Provoni » Oct 09, 2020 14:17

SARG wrote:Were you using optimization options with gcc ?
Currently the optimizations are done analyzing one line and the previous one. I imagine to extend the analyze to 3, 5 or more lines.
It would also be possible to improve the speed by doing things more upstream but with much change in the compiler and surely without always beating gcc.
I have downloaded your project and maybe I could find in the asm code how to speed up it with new optimizations.

Yes, GCC with optimizations.

Have you downloaded 1.18? In the program, under Options there is a Benchmark button which will use 3/4 CPU threads, when finished it will display a MIPS number (short for million iterations per second).

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 14 guests