View previous topic :: View next topic |
Author |
Message |
Kruse
Joined: 18 Jul 2007 Posts: 3
|
PCH optimizations ? |
Posted: Wed Jul 18, 2007 6:27 pm |
|
|
Anyone know if the PCH does any optimizations that resembles 'procedural abstraction' ?
Does it use the extended mode opportunity in the most 18F controllers ? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 18, 2007 8:23 pm |
|
|
Are you asking about the extended instruction set ? It's not supported.
You must use the NOXINST fuse setting. If you use XINST, your
program will be behave in an unstable manner. It won't run correctly. |
|
|
RickinPa Guest
|
abstractions |
Posted: Wed Jul 18, 2007 11:09 pm |
|
|
I have the CCS compiler set to 9 on optimizations and a bunch of nested if's with the same last line of code - something like - flag = 1; - they do not get optimized. There are a bunch of individual bsf commands in the listing. So I would say, if its doing procedural abstraction, its not too optimized. |
|
|
Kruse
Joined: 18 Jul 2007 Posts: 3
|
|
Posted: Thu Jul 19, 2007 6:31 pm |
|
|
Thank you.
So it seems C18 is the only one that incorporate this very efficient optimization. |
|
|
Ttelmah Guest
|
|
Posted: Fri Jul 20, 2007 1:59 am |
|
|
Remember that the high optimisation for PCH, is opt 11, not 9. With this set, on some parts of the code, there does appear to be an attempt to perform bypassing of this sort. However it also appears to be very easy to 'defeat', not being very smart about working out what is common code...
Best Wishes |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Jul 20, 2007 2:50 am |
|
|
Kruse wrote: | So it seems C18 is the only one that incorporate this very efficient optimization. | Optimization is always a difficult issue in compilers and this is where you will see the difference between the cheap and expensive compilers. I expect the HiTech compiler to have more advanced optimization algorithms as well.
The CCS compiler's ROM optimization doesn't perform all the known tricks but the RAM allocation and re-use is extremely efficient and better than in most other PIC compilers.
Ask yourself if you are willing to pay several hundreds to thousands of dollars extra for saving a few ROM bytes. Sometimes it is cheaper to buy the processor type with more memory. |
|
|
Kruse
Joined: 18 Jul 2007 Posts: 3
|
|
Posted: Fri Jul 20, 2007 3:45 pm |
|
|
I allready have both C18 (Microchip) and PICC18-PRO (Hi-tech).
C18 does procedural optimiztions but PICC don't, additionally PICC is very erratic, quite picky and generates the most cryptic error messages I've seen.
.. and ofcourse the most expensive ($1300). |
|
|
|