CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Optimization - WOW!!!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

Optimization - WOW!!!
PostPosted: Wed Mar 09, 2005 4:10 pm     Reply with quote

I just paid for my year of maintenance and downloaded the latest version of the compiler (3.221). I got the upgrade because the project that I'm working on wouldn't fit into an 18F452, and my old version of the compiler didn't support the newer chips.

As a first test, I tried compiling the same project (with parts commented out because the whole thing didn't fit) and noticed that the ROM utilization was way, way lower than it was before. So I tried to compile the whole works. Now it fits - with lots of room to spare! Exclamation

When did CCS ratchet up the optimization? I'm really impressed. Very Happy
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Wed Mar 09, 2005 5:32 pm     Reply with quote

I'm not so certain of the optimization, but if you were using a version older than 3.202, it still had the FFFF NOP errata active. Because of a problem with older versions of the 18F452 (and others) it was required that the compiler add the FFFF NOP either before and/or after any call that might jump over 4000 (I don't recall all of the details). In 3.202 the added FFFF NOP defaulted off. I saw some huge improvements when this was turned off. Just for fun, you could look in the device editor and turn the errata fix back on and recompile. Then look at the change in ROM usage. Don't forget to turn it back off though.
Guest








Re: Optimization - WOW!!!
PostPosted: Wed Mar 09, 2005 8:16 pm     Reply with quote

newguy wrote:

When did CCS ratchet up the optimization? I'm really impressed. Very Happy


3.200 PIC18 optimization has been improved

actually 3.187 with #opt 10

the new optimization is to use short range jump instead of always using long range GOTO for function call and return, which save you 2 bytes for every short jump. typically a 10% ~ 15% code size reduction is achieved.

p.s. 3.200 ~ 3.211 have quite a few bugs thus not recommanded
Guest








PostPosted: Wed Mar 09, 2005 8:18 pm     Reply with quote

Charlie U wrote:
I'm not so certain of the optimization, but if you were using a version older than 3.202, it still had the FFFF NOP errata active. Because of a problem with older versions of the 18F452 (and others) it was required that the compiler add the FFFF NOP either before and/or after any call that might jump over 4000 (I don't recall all of the details). In 3.202 the added FFFF NOP defaulted off. I saw some huge improvements when this was turned off. Just for fun, you could look in the device editor and turn the errata fix back on and recompile. Then look at the change in ROM usage. Don't forget to turn it back off though.


3.202 The extra NOP FFFF inserted for some chips is now removed by default

http://www.ccsinfo.com/versions.shtml
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Wed Mar 09, 2005 10:28 pm     Reply with quote

Isn't that what I said?!?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Mar 10, 2005 6:52 am     Reply with quote

Yep, it sure is Exclamation
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group