[Icc-430] Comment on ICC Code

Wolfgang Schulze Wolfgang.Schulze at myrealbox.com
Sun Mar 18 10:46:00 PST 2007


This is my first Email to the forum. I hope it is the right place to put
comments.

We are very pleased that since version 6.04 which we have used up to now
(since the calling architecture changed) up to the present version 7.05A
the compiler saves 2kB of code (in approx 60kB) for a specific project.
We noticed that some unnecessary register shifts (e. g. for byte
operations) were removed. Here is just another comment on the present
code generation.

Storing into a pointer is done by using more registers than necessary.

For the following construction
*s++='-'
the incrementing of the pointer is done before the moving of the
variable. This forces the use of  another register. It would be better
to move first and then to increment.

Example of some code in a list file:

          ;     if (Num<0) {Num=-Num;*s++='-';}
0136 81930000          cmp #0,0(R1)
013A 0A34              jge L19
013C                   .dbline 113
013C                   .dbline 113
013C B1E0FFFF0000      xor #65535,0(R1)
0142 91530000          add #1,0(R1)
0146                   .dbline 113
0146 0B44              mov R4,r11
0148 1453              add #1,R4
014A FB402D000000      mov.b #45,0(r11)


It would be shorter for last part to use

mov, b #45,0(r4)
add #1,R4

Since this is a very commmon construction, some more code could be saved.
I checked as a comparison on the code generated by an old IAR compiler.
IAR does it the short way.

Wolfgang




More information about the Icc-430 mailing list