Searching \ for 'HiTech' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=hitech
Search entire site for: 'HiTech'.

Truncated match.
PICList Thread
'HiTech'
1997\06\30@035341 by David BALDWIN

flavicon
face
Hi all,


       Did someone got an answer about docs for HiTech beta 3 C compiler for
Pics? Thanks a lot.

David

1997\06\30@141939 by david

flavicon
face
In <spam_OUT33B7655B.41C67EA6TakeThisOuTspametca.alcatel.be>, on 06/30/97 at 09:50 AM,
  David BALDWIN <.....baldwinKILLspamspam@spam@ETCA.ALCATEL.BE> said:

->Hi all,


->        Did someone got an answer about docs for HiTech beta 3 C
->compiler for Pics? Thanks a lot.

->David

The Hi-Tech C compiler has now been released, as of 26 Jun 1997.  The
compiler is available with printed documentation ($45 extra I think),
otherwise, the CD comes with full docs in HTML and ACROBAT I think.  I'm
ordering one this week, so  I'll confirm this when I receive it.

My understanding, is that Beta 3 came as well equipped as Beta 1 and Beta
2 in  the documentation department, which were largely devoid of any
robust information. The programming examples were lifesavers, but the
documentation was poor and  incomplete at best.

Documentation notwithstanding, my experiences with the compiler are good
overall-
an excellent sign considering the state of the compiler when I first
signed on to  use it.  I think the kudos go to Clyde Smith-Stubbs, whose
coding skills are  nothing short of spectacular.




                          \|||/
                          o o                           David Darknell
-------+--+--oOO-(_)-OOo--+--+-----------------------------------------
             |--|__|--|___|--|__|--|   davidspamKILLspamxia.com .....davidKILLspamspam.....papdev.com
                                              EraseMEdavidspam_OUTspamTakeThisOuTphysics.ucsc.edu
---gnothi seauton
_______________________________________________________________________


'HiTech'
1999\10\07@132508 by Peter Schultz
flavicon
face
Hi Guys,
HiTech compiler, what is the different between optimization level 1 to 9 ?
Thanks,
Peter Schultz
MiniMed Inc.
PeterSspamspam_OUTminimed.com

1999\10\07@141716 by Andrew Kalman

picon face
>Hi Guys,
>HiTech compiler, what is the different between optimization level 1 to 9 ?
>Thanks,

I run with all the optimizations, and level 5.  The difference between that
and no optimizations whatsoever is about a 15-20% reduction in codesize.



___________________________________________
| Andrew E. Kalman, Ph.D.   @spam@aekKILLspamspamnetcom.com  |
|        standard disclaimers apply         |
|___________________________________________|

1999\10\07@144551 by Andy Kunz

flavicon
face
At 11:16 AM 10/7/1999 -0800, you wrote:
>>Hi Guys,
>>HiTech compiler, what is the different between optimization level 1 to 9 ?
>>Thanks,
>
>I run with all the optimizations, and level 5.  The difference between that
>and no optimizations whatsoever is about a 15-20% reduction in codesize.

I just compiled my application with both Zg1 and Zg9 settings.  Exact same
results.

Andy

==================================================================
Eternity is only a heartbeat away - are you ready?  Ask me how!
------------------------------------------------------------------
KILLspamandyKILLspamspamrc-hydros.com      http://www.rc-hydros.com     - Race Boats
RemoveMEandyTakeThisOuTspammontanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\10\07@182228 by Dennis Plunkett

flavicon
face
At 14:44 7/10/99 -0400, you wrote:
>At 11:16 AM 10/7/1999 -0800, you wrote:
>>>Hi Guys,
>>>HiTech compiler, what is the different between optimization level 1 to 9 ?
>>>Thanks,
>>
>>I run with all the optimizations, and level 5.  The difference between that
>>and no optimizations whatsoever is about a 15-20% reduction in codesize.
>

Andy Kunz wrote
>I just compiled my application with both Zg1 and Zg9 settings.  Exact same
>results.


Andrew Kalman wrote

>I run with all the optimizations, and level 5.  The difference between that
>and no optimizations whatsoever is about a 15-20% reduction in codesize.


So what does this all mean?
Ok it is quite simple (simple explaination will be given) As you can see
Andy like myself does not get any code size change, or often very little,
where Andrew gets a large change. For most of the time Andrew is quite
correct, a large change can be found with just the first 3 levels of
optimisation, after this point very little. In his case the code will have
large numbers of routines and many variables being past between functions.
This makes the code flowery as the complier will do the compilation in a
*Safe mode* where it will not look for dead code and will use fixed
variables etc.
Where in Andys and my case we both have proberably taken the time to see
how the compiler works and to see what code produces the best result eg.

unsigned *ptr;

       *ptr = a;
       if (*ptr++ == 3)
               do some stuff;


OK simple C
But not very good code in a machine that is only 8 bits and is not the best
at 16 bit type functions, ok how to make it better:-

unsigned i
unsigned* ptr;

       i = a;
       *ptr = a;
       ptr++;
       if (i == 3)
               do some stuff;

OK this can be even better!, but becomes non portable and you have to start
watching what you do:-

unsigned i
near unsigned *ptr;

       i = a;
       *ptr = i; (Not A)
       ptr++;
       if (i == 3)
               do some stuff;




Take a look at loops, which is best?

       while (1)

       for (;;)


Take a look at these and see which is best

       do
       while (i--)


       do
               i--
       while (i)


       while (i--)


       while (i)
               i--

       for (i=0; i<5l; i++)



These are all important!
Watch pointers they chew up code space like it is free

There are many other things to look for but take a look at your coding
style if you want the best from this compiler



Dennis

1999\10\07@192646 by Andrew Kalman

picon face
Dennis wrote:

>So what does this all mean?
>Ok it is quite simple (simple explaination will be given) As you can see
>Andy like myself does not get any code size change, or often very little,
>where Andrew gets a large change. For most of the time Andrew is quite
>correct, a large change can be found with just the first 3 levels of
>optimisation, after this point very little. In his case the code will have
>large numbers of routines and many variables being past between functions.

Wow ... Dennis knows my code without even seeing it!  ;-)

But he is entirely correct -- The example I mention above is for a
nearly-full 16C77 (i.e. just short of 8K of code). Lots and lots of
functions, many of which pass three, even four parameters. As this was my
first large PIC C project, I do not claim to have written all my loops,
etc. in the manner which is best for minimum-size code.  But I am learning.
Said project compiles and runs on the PC ( a sim ) and the PIC, so
portability was way up there on the list of priorities.

I do look at the assembly output quite often and try to recode in C to
minimize size.  I've found, for instance, a good way to "help"  the PIC-C
compiler is to use temp auto variables when doing relatively complex
statements involving pointers on  both sides of the "=" sign. Sometimes the
expression is too complex for the compiler, but even when it isn't, I can
get a lot of speedup by pre-evaluating a variable with, say, a single level
of indirection, and then using said handle to do all subsequent,
double-level-of-indirection references.  This would be the case where
there's a pointer to a pointer to a structure which contains multiple
fields which get operated on "simultaneously."

As I recall, the 1st-3rd (or was it 1st-5th?) levels of optimization made a
big difference, going higher made no difference at all.

PIC-C rocks!  (Thanks Clyde!)


___________________________________________
| Andrew E. Kalman, Ph.D.   spamBeGoneaekspamBeGonespamnetcom.com  |
|        standard disclaimers apply         |
|___________________________________________|

1999\10\07@224105 by Andy Kunz

flavicon
face
>Andy Kunz wrote
>>I just compiled my application with both Zg1 and Zg9 settings.  Exact same
>>results.

Dennis, I need to correct that a little.

Between Zg1 and Zg9 I saw no difference.  I try as little as possible to
help the compiler optimize.  Between Zg1 and no opt, it wouldn't fit in the
target without optimizing.  Sorry for misleading.

But yes, I do write code sometimes to get the assembly that I want out of it.

Andy
==================================================================
Eternity is only a heartbeat away - are you ready?  Ask me how!
------------------------------------------------------------------
TakeThisOuTandyEraseMEspamspam_OUTrc-hydros.com      http://www.rc-hydros.com     - Race Boats
RemoveMEandyspamTakeThisOuTmontanadesign.com  http://www.montanadesign.com - Electronics
==================================================================

1999\10\07@232650 by Dennis Plunkett

flavicon
face
At 22:37 7/10/99 -0400, you wrote:
>>Andy Kunz wrote
>>>I just compiled my application with both Zg1 and Zg9 settings.  Exact same
>>>results.
>
>Dennis, I need to correct that a little.
>
>Between Zg1 and Zg9 I saw no difference.  I try as little as possible to
>help the compiler optimize.  Between Zg1 and no opt, it wouldn't fit in the
>target without optimizing.  Sorry for misleading.
>
>But yes, I do write code sometimes to get the assembly that I want out of it.
>

No not missleading I knew exactly what you where on about. If the programme
is large, then 9 may give one or two bytes better in the golbal
optimisation, but this is often very little

Dennis



>Andy
>==================================================================
> Eternity is only a heartbeat away - are you ready?  Ask me how!
>------------------------------------------------------------------
>andyEraseMEspam.....rc-hydros.com      http://www.rc-hydros.com     - Race Boats
>EraseMEandyspammontanadesign.com  http://www.montanadesign.com - Electronics
>==================================================================
>
>

1999\10\08@063736 by Clyde Smith-Stubbs

flavicon
face
On Thu, Oct 07, 1999 at 10:14:05AM -0700, Peter Schultz wrote:
> Hi Guys,
> HiTech compiler, what is the different between optimization level 1 to 9 ?

On the PIC compiler, not much. The major difference is that at the higher
levels, after register allocation has been done, the code generation is
repeated to take advantage of things being in registers. Since the PIC has
only one real "register" (W) which is rarely available to store a variable,
it doesn't make much difference.

On e.g. a 68000, it can make a significant difference (it also takes longer
to compile).

Regards, Clyde

--
Clyde Smith-Stubbs               |            HI-TECH Software
Email: RemoveMEclydeEraseMEspamEraseMEhtsoft.com          |          Phone            Fax
WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
PGP:   finger RemoveMEclydespam_OUTspamKILLspamhtsoft.com   | AUS: +61 7 3355 8333 +61 7 3355 8334
---------------------------------------------------------------------------
HI-TECH C: compiling the real world.

1999\10\08@104637 by Pike, Lesley C.

flavicon
face
Although compiler optimizations help, there is only so much they can do, so
it really is best to try to write your C code as optimally as possible
without the aid of the compiler.  There was a pretty cool article called
"Using C on low-end microcontrollers" in Embedded Systems Programming a few
years back.  It gave some good pointers on how to write more efficient C
code, and of course, it does talk about macros.  I think it's a worthwhile
read if you can find a copy.  (August 1995 issue)

Lesley C. Pike
Sr. Software Project Engineer
Baker Oil Tools



{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...