View previous topic :: View next topic |
Author |
Message |
newguy
Joined: 24 Jun 2004 Posts: 1907
|
Optimization - WOW!!! |
Posted: Wed Mar 09, 2005 4:10 pm |
|
|
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!
When did CCS ratchet up the optimization? I'm really impressed. |
|
|
Charlie U
Joined: 09 Sep 2003 Posts: 183 Location: Somewhere under water in the Great Lakes
|
|
Posted: Wed Mar 09, 2005 5:32 pm |
|
|
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!!! |
Posted: Wed Mar 09, 2005 8:16 pm |
|
|
newguy wrote: |
When did CCS ratchet up the optimization? I'm really impressed. |
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
|
|
Posted: Wed Mar 09, 2005 8:18 pm |
|
|
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
|
|
Posted: Wed Mar 09, 2005 10:28 pm |
|
|
Isn't that what I said?!? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Thu Mar 10, 2005 6:52 am |
|
|
Yep, it sure is |
|
|
|