From richard at imagecraft.com Fri Mar 2 21:18:45 2007 From: richard at imagecraft.com (Richard) Date: Fri Mar 2 21:26:38 2007 Subject: [Icc-430] (no subject) Message-ID: <6.1.0.6.2.20070302183943.076c7438@192.168.100.42> 2007 is setting out to be an interesting year at ImageCraft. We will continue to enhance our existing products of course: - new 8 bit optimizations for AVR and M8C (PRO version) - support for new devices in the AVR, MSP430, ARM, and S12X families. Including extended addressing for 430X. In addition, we have decided on the following new projects: - Microchip PIC24 port. The PIC24 is a new 16 bit family from Microchip. It has many advantages that comes with being a Microchip device without some of the earlier architectural limitations. As PIC16 users upgrading to larger parts, the PIC24 is a natural step up. - Propeller C. Propeller is a unique device from http://www.parallax.com. 8 32-bit CPUs on one chip. Think "no interrupt." Propeller C gives us an opportunity to - ARM7 Educational Kits. We are producing a complete education kit bundle with board, compiler, debugger, and course materials for some large universities. I expect variants of this kit will be made to address different unverisities' needs. - More flexible dongle scheme. We sold over 500 dongles last year. I have ideas on making them more flexible. Anyway, my brain is still somewhere out in the Pacific Ocean. That's for now. Thank you for your support. // richard From Wolfgang.Schulze at myrealbox.com Sun Mar 18 10:13:55 2007 From: Wolfgang.Schulze at myrealbox.com (Wolfgang Schulze) Date: Sun Mar 18 10:23:03 2007 Subject: [Icc-430] Comment on ICC Code Message-ID: <45FD8163.6020309@myrealbox.com> Storing into a pointer is done by using more registers than necessary. For the follwing 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 Wolfgang From Wolfgang.Schulze at myrealbox.com Sun Mar 18 10:46:00 2007 From: Wolfgang.Schulze at myrealbox.com (Wolfgang Schulze) Date: Sun Mar 18 10:54:17 2007 Subject: [Icc-430] Comment on ICC Code Message-ID: <45FD88E8.30400@myrealbox.com> 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 From Wolfgang.Schulze at myrealbox.com Tue Mar 20 00:50:17 2007 From: Wolfgang.Schulze at myrealbox.com (Wolfgang Schulze) Date: Tue Mar 20 00:58:35 2007 Subject: [Icc-430] Suggestions on ICC Code improvement Message-ID: <1174380617.c7c9b25cWolfgang.Schulze@myrealbox.com> Sorry that I sent the same contents of the previous discussion twice, but I thought I had the address wrong. I did some more comparisons of the ICC code generated relative to the IAR code. In some instances IAR is still better. Here are some more results. Hope they can be used by the programmer: Comparison to a constant is done using a register, although it could be done directly: 0490 ; if (Uph_fi[0]>260) strcpy((char *)AnzStr,"L1 >260V "); 0490 3B400401 mov #260,R11 0494 1B900200 cmp _Uph_fi,R11 0498 0734 jge L42 It would be better to use cmp _Uph_fi,#260 jge L42 Code of IAR \ 000000 B2900501.... CMP.W #0x105, &Uph_fi \ 000006 0638 JL ??Verarb221_0 ____________________________________________________________ When a function ends on a call and there is no pop , then it could branch to the function. This saves code and time Example 09AC ; Copy(ZweiteZeile,AnzStr); 09AC 3F400400 mov #_AnzStr,R15 09B0 3E400000 mov #_ZweiteZeile,R14 09B4 B0120000 call #_Copy 09B8 .dbline -2 09B8 L175: 09B8 .dbline 0 ; func end 09B8 3041 ret Call #_Copy ret can be replaced by BR #_Copy IAR Code 764 Copy(ZweiteZeile,AnzStr); \ ??Verarb71_1: \ 000026 3E40.... MOV.W #AnzStr, R14 \ 00002A 3C40.... MOV.W #ZweiteZeile, R12 \ 00002E 3040.... BR #Copy ____________________________________________________________ Registers are used when it would be possible to store directly: 0AF2 ; AnzStr[n]=' '; 0AF2 3B400400 mov #_AnzStr,R11 0AF6 0A4E mov R14,R10 0AF8 0A5B add R11,R10 0AFA FA4020000000 mov.b #32,0(R10) It would be better : mov.b #32,#_AnzStr(R10) IAR code 828 AnzStr[n]=' '; \ 00004E FA402000.... MOV.B #0x20, AnzStr(R10) _____________________________________________________________ We are always pushed for code space and would appreciate getting more compact code (can't wait for the compatible 120k versions to be available). We purchased the professional version but I have not understood the method of global optimization yet. Is it done automatically during compile and link time or must it be invoked manually. Some hints on where to read about it would be appreciated. Wolfgang From richard-lists at imagecraft.com Tue Mar 20 18:23:14 2007 From: richard-lists at imagecraft.com (Richard) Date: Tue Mar 20 17:31:37 2007 Subject: [Icc-430] Suggestions on ICC Code improvement In-Reply-To: <1174380617.c7c9b25cWolfgang.Schulze@myrealbox.com> References: <1174380617.c7c9b25cWolfgang.Schulze@myrealbox.com> Message-ID: <6.1.0.6.2.20070320182240.0af7f9d0@192.168.100.42> Wolfgang, thanks for your suggestions. I will utilize them in the upcoming releases... At 12:50 AM 3/20/2007, Wolfgang Schulze wrote: >Sorry that I sent the same contents of the previous discussion >twice, but I thought I had the address wrong. > >I did some more comparisons of the ICC code generated relative to the >IAR code. In some instances IAR is still better. Here are some more >results. Hope they can be used by the programmer: >... // richard (This email is for mailing lists. To reach me directly, please use richard at imagecraft.com)