It is currently Sat Sep 22, 2018 11:25 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Apr 17, 2018 7:08 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3127
Location: Tampere, Finland
koitsu wrote:
You can use gcc -S -masm=intel to review the generated assembly (.s files) in Intel format. Rest of my advice about optimisation flags etc. from and earlier post still applies. Don't be surprised if what you find scares you.

Compiler Explorer is very handy for this kind of work.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
PostPosted: Wed Apr 18, 2018 2:43 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3154
Location: Brazil
thefox wrote:
koitsu wrote:
You can use gcc -S -masm=intel to review the generated assembly (.s files) in Intel format. Rest of my advice about optimisation flags etc. from and earlier post still applies. Don't be surprised if what you find scares you.

Compiler Explorer is very handy for this kind of work.

One word - awesome.
I'm playing with it and... my CHR decoding function was 85 ASM lines. Now it's 67.


Top
 Profile  
 
PostPosted: Fri Apr 20, 2018 11:08 pm 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 359
godbolt is such a great tool.

Quote:
However, if the performance of an initializer is critical for your application there is no general advice anyone can give for how to write it the "best" way.

I dunno. Initializer lists seem like a clear winner to me. They require no analysis to optimize; they produce better code than memset on -O0. And their syntax is... well... intended for initialization!

Quote:
Anyway, does anyone know of any good recourses for learning C from Java?

If you understand 'if' 'for' 'while' and functions then start writing code. That's all you need to get started.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group