English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 16 May 2017, 13:03   #281
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by bebbo View Post
-Os uses a different optimizer pass named "hoist" instead of "pre".

Maybe you can reach almost the code size of -Os by using -O1 plus disabling some of the size expensive optimizations.
register parameters are now recognized correctly. -Os is working as intended.
bebbo is offline  
Old 16 May 2017, 15:55   #282
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
When trying to cross compile LibOgg on a 64-bit Linux box, I ran into this in the configure script:
Quote:
checking for inttypes.h... (cached) no
checking for stdint.h... (cached) no
checking for sys/types.h... (cached) no
checking for an ANSI C-conforming const... yes
checking size of int16_t... 0
checking size of uint16_t... 0
checking size of u_int16_t... 0
checking size of int32_t... 0
checking size of uint32_t... 0
checking size of u_int32_t... 0
checking size of int64_t... 0
checking size of short... 0
checking size of int... 0
checking size of long... 0
checking size of long long... 0
configure: error: No 16 bit type found on this platform!
My configure line was as follows:
Quote:
../submodules/libogg-1.3.2/configure --host=x86_64-unknown-linux --build=m68k-amigaos --target=m68k-amigaos --prefix=/home/samuraicrow/amigaos-cross-toolchain/m68k-amigaos CC=/home/samuraicrow/amigaos-cross-toolchain/m68k-amigaos/bin/m68k-amigaos-gcc CFLAGS="-noixemul -m68020 -mtune=68020-40 -msoft-float -mpcrel" CPP=/home/samuraicrow/amigaos-cross-toolchain/m68k-amigaos/bin/m68k-amigaos-cpp LDFLAGS="-L/home/samuraicrow/amigaos-cross-toolchain/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b"
It looks like a stdint.h is missing. Where do I get it from?
Samurai_Crow is offline  
Old 16 May 2017, 16:40   #283
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by Samurai_Crow View Post
When trying to cross compile LibOgg on a 64-bit Linux box, I ran into this in the configure script:

My configure line was as follows:


It looks like a stdint.h is missing. Where do I get it from?
Try -mcrt=clib2 instead of -noixemul.

Once ixemul.library is built working again, stdint.h will be included and no option is required. Maybe I'll add it to noixemul too...

Many TODO's ...
bebbo is offline  
Old 16 May 2017, 23:06   #284
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by Toni Wilen View Post
I forgot that -Os is AROS m68k default. -O1 just fits (only 13k free, vs -Os which leaves ~70k free), -O2 does not fit (26k too big). I haven't done any performance tests. (Note that debugging was disabled but serial logging is enabled)
So 68k AROS defaults to the slowest ISA choice and slowest optimization choice possible. It's not like anybody complains about the performance of 68k AROS .

Quote:
Originally Posted by bebbo View Post
Maybe you can reach almost the code size of -Os by using -O1 plus disabling some of the size expensive optimizations.
With old versions of GCC, -O1 generated code on the 68k was not very optimized and looked like it was generated for a debugger (unnecessary writes to variables in memory). Moving to -O2 fixed this and was greatly improved but with much more function inlining and loop unrolling that reduces code density (enlarges code). Function inlining is especially good for performance on the 68k with its stack arg AT&T ABI (one study showed 7% average integer performance gain). Your performance optimizations could allow for higher optimization levels if they also improve code density (not unusual on the 68k). I would be interested to know the stripped executable sizes of compiled benchmarks compared to the original GCC. The information could improve AROS by allowing for more performance optimizations if there is any significant amount of improvement in code density. Of course, in Toni's case, compiling for the 68020 would recover some space while improving performance as well. I wonder what percentage of AROS 68k users are using a 68000?
matthey is offline  
Old 16 May 2017, 23:33   #285
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Originally Posted by matthey View Post
So 68k AROS defaults to the slowest ISA choice and slowest optimization choice possible. It's not like anybody complains about the performance of 68k AROS .
of course. we are still testing and debugging. toni is against optimisation at this point. you can likely take it for granted that it will be faster when compiled for 020 when its ready for the consumers. im currently running it on a4000/040/16mb/aga and the apps are reasonably responsive. just watching fireworks demo on aga, as i write

maybe later this week, we can look into compiling a more optimized version.
wawa is offline  
Old 17 May 2017, 02:40   #286
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by wawa View Post
of course. we are still testing and debugging. toni is against optimisation at this point. you can likely take it for granted that it will be faster when compiled for 020 when its ready for the consumers. im currently running it on a4000/040/16mb/aga and the apps are reasonably responsive. just watching fireworks demo on aga, as i write
Optimizing for size is optimizing too. Optimizing with -Os is probably less tested so there could be more bugs though.
matthey is offline  
Old 17 May 2017, 08:20   #287
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Originally Posted by matthey View Post
Optimizing for size is optimizing too. Optimizing with -Os is probably less tested so there could be more bugs though.
i think you realize that optimizing for size may be mandatory in case of kickstart modules in order to fit them within the available space at all.

if you look at the commit history just these days toni had to move ata device from the primary into the secondary kickstart image as we started to have issues with the primary kickstart growing to an inadequate size.

but i think he may explain it better if need be and we are moving offtopic here. if you have consideratiion about aros optimisations i have opened a thread ybout how to compile it here:

http://eab.abime.net/showthread.php?...s+instructions
wawa is offline  
Old 17 May 2017, 15:29   #288
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
Quote:
Originally Posted by bebbo View Post
Try -mcrt=clib2 instead of -noixemul.

Once ixemul.library is built working again, stdint.h will be included and no option is required. Maybe I'll add it to noixemul too...

Many TODO's ...
Commented and attached config.log on issue 17 for linkage problems: https://github.com/bebbo/amigaos-cro...hain/issues/17
Samurai_Crow is offline  
Old 17 May 2017, 20:27   #289
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,104
EDIT: Got it built using latest version.

Late to the party and trying to get it compiling on 32-bit cygwin on Windows 10 I'm getting an internal compiler error while compiling libstdc++. I can see a bit earlier in the thread that libstdc++ isn't supported yet, but that's only once everything's done right?

I'll gladly go through the motions of reporting it properly, but I just want to check whether it's supposed to work at all? Can I disable building libstdc++ for now? (--help didn't seem to indicate any way to do so)

Just in case I've attached a build log (contains multiple runs appended).

Last edited by paraj; 19 May 2017 at 22:01.
paraj is offline  
Old 17 May 2017, 22:05   #290
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
PUSH - a clean build went through and all my tests were ok. The current compiler (not linker) related issues are fixed (even -Os for poseidon.library)

If there are errors, check the existing issues or (re-)open one at github: https://github.com/bebbo/amigaos-cross-toolchain/issues

Thank you all for your interest and support - especially to the one who donated me a fair amount. That is helping me to put more effort into the good old Amiga world.

PS: Uh-Oh - found a bug^^

PPS: Ok - pushed also a fix for this. All good! Yes? No?

Last edited by bebbo; 17 May 2017 at 23:32.
bebbo is offline  
Old 17 May 2017, 22:58   #291
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
Quote:
Originally Posted by wawa View Post
still trying to source down the issue why stdio linked amiga-gcc6 binaries crash aros68k here. funny enough en course of testing have compiled mui test with the aros-gcc6 and it worked, not unexpectedly i suppose.
btw i wanted to report that the issue above i mentioned in post #153 has been fixed. it must have been the semaphore issue tracked down a while back.

all helloworld examples compiled with 6.2 work fine now under aros.
wawa is offline  
Old 17 May 2017, 23:25   #292
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by wawa View Post
btw i wanted to report that the issue above i mentioned in post #153 has been fixed. it must have been the semaphore issue tracked down a while back.

all helloworld examples compiled with 6.2 work fine now under aros.
it's 6.3.1 now (to be precise: 6.3.1b)
bebbo is offline  
Old 18 May 2017, 00:28   #293
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
errm, sorry, no offence meant.
have not even noticed, silly me.
wawa is offline  
Old 18 May 2017, 14:34   #294
Keir
Registered User
 
Join Date: May 2011
Location: Cambridge
Posts: 682
This is totally awesome work! I'm going to try moving from my unmodified upstream GNU toolchain to this, the code quality seems much much better even for cases I don't care about the AmigaOS 3 compatibility.

I can see this being the new standard C compiler for Amiga (for those who cross-compile!).

Oh, by the way I didn't see anyone mention yet that this now builds in 64-bit environments. No need for 32-bit compat libs or Docker container!
Keir is offline  
Old 21 May 2017, 12:48   #295
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Minor tip for path handling. (linux targeted)

If you have a prior gcc like I do you probably have this in your .bashrc

Code:
export PATH=$PATH:/usr/local/amiga/bin
now if you compile beebo's gcc, you might reference it with absolute path and the like, but here is a solution

prepend the above line in your .bashrc with one line

Code:
export ORIGPATH=$PATH
export PATH=$PATH:/usr/local/amiga/bin
and add two functions at the bottom on your .bashrc

Code:
amigaold () {
    export PATH=$ORIGPATH:/usr/local/amiga/bin
}

amiganew () {
    export PATH=$ORIGPATH:/home/alex/amiga/gcc6/bin
}
Now, type amiganew and you have the new gcc in path, type amigaold and you are back at the old one.
alkis is offline  
Old 05 June 2017, 12:09   #296
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
I just released a new version with a new optimizer pass to (e)liminate redundant loads.

Again only little gain here and there, but overall I am quite content now.

I'll add soon the last optimizer to use more auto increments. Then maybe improve some of my already built optimizers, then - I think - I'm done.

How is my gcc-6 version working for you?
bebbo is offline  
Old 05 June 2017, 23:40   #297
alpine9000
Registered User
 
Join Date: Mar 2016
Location: Australia
Posts: 881
Quote:
Originally Posted by bebbo View Post
I just released a new version with a new optimizer pass to (e)liminate redundant loads.

Again only little gain here and there, but overall I am quite content now.

I'll add soon the last optimizer to use more auto increments. Then maybe improve some of my already built optimizers, then - I think - I'm done.

How is my gcc-6 version working for you?
I wonder if we are ready to declare that bebbo's port produces the highest quality asm of any C compiler ever released for Amiga?

For people that didn't know I use bebbo's version for my game engine:

[ Show youtube player ]
alpine9000 is offline  
Old 06 June 2017, 09:24   #298
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,514
Quote:
Originally Posted by bebbo View Post
How is my gcc-6 version working for you?
I am still waiting for instructions how to use it to compile aros-m68k.

I'll even try to help if possible. I don't normally want to know nothing about compiling compilers or setting them up but in this case I think it will be worth the trouble

Quote:
Originally Posted by wawa View Post
i think you realize that optimizing for size may be mandatory in case of kickstart modules in order to fit them within the available space at all.
It may make sense to compile arosbootstrap image with higher optimization level and only compile rom images with -Os. (I don't know how to do that)
Toni Wilen is online now  
Old 06 June 2017, 10:37   #299
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by Toni Wilen View Post
I am still waiting for instructions how to use it to compile aros-m68k.
...
Hehe - the aros build system is not fool proof.

The first hurdle is that the standard approach
Code:
--target=m68k-amigaos
fails. Because of a jodeldiplom you have to use
Code:
--target=amiga-m68k
... I am still at the very beginning of building aros and again it's a pita.

/cheers

PS: next hurdle is: do not use configure with a relative path - since readlink -f is not used...

Last edited by bebbo; 06 June 2017 at 17:51.
bebbo is offline  
Old 06 June 2017, 12:26   #300
wawa
Registered User
 
Join Date: Aug 2007
Location: berlin/germany
Posts: 1,054
maybe we should open a separate thread to share experience about compiling aros with bebbos backend, in order not to derail this thread. i had my go at that but a bit hacky admittedly, trying to edit the target.cfg for the time being. i think we need coorinated common approach. perhaps kalamatee can advise us as he is responsible for the build system and has registered here already.

alternatively we can follow the subject on aros-dev ml. bebbo has already opened this topic there.
wawa is offline  
 


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
New GCC based dev toolchain for AmigaOS 3.x cla Coders. Releases 8 24 December 2017 10:18
Issue with photon/xxxx WinUAE Toolchain arpz Coders. Asm / Hardware 2 26 September 2015 22:33
New 68k gcc toolchain arti Coders. C/C++ 17 31 July 2015 03:59
Hannibal's WinUAE Demo Toolchain 5 Bobic Amiga scene 1 23 July 2015 21:04
From gcc to vbcc. Cowcat Coders. General 9 06 June 2014 14:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.17728 seconds with 14 queries