Philipp, I tested SDCC 2.8.3 sdcc-src-20080903-5228 snapshot on our Z80 project today. The result is really good. The original 2.8.0 compiler gives code size of 168411 bytes, and this new snapshot reduced the code size to 162208 bytes, a 3.7% improve! Thanks for the great work.
Woody AR1688 and PA1688 based IP phone mailing list -- http://groups.yahoo.com/group/pa1688/ VOIP and AR1688 BLOG -- http://aredfox.spaces.live.com/ MSN: [EMAIL PROTECTED] ----- Original Message ----- From: "Philipp Klaus Krause" <[EMAIL PROTECTED]> To: "Development chatter about sdcc" <[EMAIL PROTECTED]> Sent: Saturday, July 12, 2008 11:03 PM Subject: [sdcc-devel] We need more high-level optimizations > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, fellow sdcc developers, > I have now implemented most of the improvements in Z80 code generation > I've been working on earlier this year. You can see the results at > http://sdcc.wiki.sourceforge.net/Philipp%27s+TODO+list > At the bottom of the page is a code size comparison of different > compilers. As you can see there have been substancial improvements in > Z80code generation. However there are still cases where sdcc is much > worse than other compilers. > Ironically the worst case I found comes from sdcc's own library. It's > the code for multiplication of 32 bit values. > You can find the C source and compiler options used at the page > mentioned above. > > I have attached the asm output from sdcc #5198 (current svn), HITECH-C > 7.80PL2 and z88dk 1.8. > sdcc used 689 bytes (819 in 2.8.0-rc2), HITECH-CC 268 and z88dk 340. > Looking at the generated asm we see two problems in sdcc's code: > > The minor one is the calling convention: We push everything on the > stack, while the other compilers pass arguments in rgeisters. > > The major problem is stack use: sdcc used about 26 bytes of stack space > for local variables, while the other compilers use about 4 bytes. Most > of the code sdcc generated moves around data in these 26 bytes. Let's > take line 64 as an example (it's the first multiplication, the others > look the same): > > Line 64 in C is: > t.i.hi = ((union bil *)&(a))->b.b0 * ((union bil *)&(b))->b.b2; > Let's compare HITECH-C and sdcc. Both use ix to access the local > variables and arguments on the stack. > > Here's what HITECH-C generates: > ld e,(ix+10) > ld d,0 > ld l,(ix+4) > ld h,d > call lmul > ld (ix+-2),l > ld (ix+-1),h > Straightforward: Fetch operands (4 instructions), multiply (1), store > result (2). > > And now sdcc: > ld hl,#0x0016 > add hl,sp > ld -8 (ix),l > ld -7 (ix),h > ld a,-8 (ix) > add a,#0x02 > ld -6 (ix),a > ld a,-7 (ix) > adc a,#0x00 > ld -5 (ix),a > ld hl,#0x001E > add hl,sp > ex de,hl > ld a,(de) > ld -9 (ix),a > ld hl,#0x0022 > add hl,sp > ld -11 (ix),l > ld -10 (ix),h > ld a,-11 (ix) > add a,#0x02 > ld -13 (ix),a > ld a,-10 (ix) > adc a,#0x00 > ld -12 (ix),a > ld l,-13 (ix) > ld h,-12 (ix) > ld c,(hl) > push de > ld a,c > push af > inc sp > ld a,-9 (ix) > push af > inc sp > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ld l,-6 (ix) > ld h,-5 (ix) > ld (hl),c > inc hl > ld (hl),b > The basic structure is the same. But its 29 instructions for fetching > the operands, 12 for calling and 5 to store the result. Most of it is > address calculations. I think we need some high-level optimizations to > improve the situation. Currently sdcc just sucks whenever code uses > structures or unions. > > Philipp > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkh4x90ACgkQbtUV+xsoLprKiwCgmKHyUk6vFfNnmlQsJDzuq0Cu > dBYAoJ4a/zwfOPQv4gdmN26K8k99G6ys > =qqqz > -----END PGP SIGNATURE----- > -------------------------------------------------------------------------------- > > > HI-TECH SOFTWARE Z80 Macro Assembler V7.80PL2 Wed Mar 19 00:23:53 > 2008 > > Page > 1 > > > 1 global small_model > 2 global __mullong > 3 signat __mullong,8252 > 4 0000' psect text,class=CODE > 5 global lmul > 6 global lmul > 7 global lmul > 8 global lmul > 9 global lmul > 10 global lmul > 11 global lmul > 12 global lmul > 13 global lmul > 14 global lmul > 15 global push_long > 16 global aslladd > 17 0000' __mullong: > 18 0000' DD E5 push ix > 19 0002' DD 21 0000 ld ix,0 > 20 0006' DD 39 add ix,sp > 21 0008' C5 push bc > 22 0009' C5 push bc > 23 ;sdcc-mul.c: 62: union bil t; > 24 ;sdcc-mul.c: 64: t.i.hi = ((union bil > *)&(a))->b > .b0 * ((union bil *)&(b))->b.b2; > 25 000A' DD 5E 0A ld e,(ix+10) > 26 000D' 16 00 ld d,0 > 27 000F' DD 6E 04 ld l,(ix+4) > 28 0012' 62 ld h,d > 29 0013' CD 0000* call lmul > 30 0016' DD 75 FE ld (ix+-2),l > 31 0019' DD 74 FF ld (ix+-1),h > 32 ;sdcc-mul.c: 65: t.i.lo = ((union bil > *)&(a))->b > .b0 * ((union bil *)&(b))->b.b0; > 33 001C' DD 5E 08 ld e,(ix+8) > 34 001F' 16 00 ld d,0 > 35 0021' DD 6E 04 ld l,(ix+4) > 36 0024' 62 ld h,d > 37 0025' CD 0000* call lmul > 38 0028' DD 75 FC ld (ix+-4),l > 39 002B' DD 74 FD ld (ix+-3),h > 40 ;sdcc-mul.c: 66: t.b.b3 += ((union bil > *)&(a))-> > b.b3 * ((union bil *)&(b))->b.b0; > 41 002E' DD 5E 08 ld e,(ix+8) > 42 0031' 16 00 ld d,0 > 43 0033' DD 6E 07 ld l,(ix+7) > 44 0036' 62 ld h,d > 45 0037' CD 0000* call lmul > 46 003A' 4D ld c,l > 47 003B' DD 7E FF ld a,(ix+-1) > 48 003E' 81 add a,c > 49 003F' DD 77 FF ld (ix+-1),a > 50 ;sdcc-mul.c: 67: t.b.b3 += ((union bil > *)&(a))-> > b.b2 * ((union bil *)&(b))->b.b1; > 51 0042' DD 5E 09 ld e,(ix+9) > > > HI-TECH SOFTWARE Z80 Macro Assembler V7.80PL2 Wed Mar 19 00:23:53 > 2008 > > Page > 2 > > > 52 0045' 16 00 ld d,0 > 53 0047' DD 6E 06 ld l,(ix+6) > 54 004A' 62 ld h,d > 55 004B' CD 0000* call lmul > 56 004E' 4D ld c,l > 57 004F' DD 7E FF ld a,(ix+-1) > 58 0052' 81 add a,c > 59 0053' DD 77 FF ld (ix+-1),a > 60 ;sdcc-mul.c: 68: t.i.hi += ((union bil > *)&(a))-> > b.b2 * ((union bil *)&(b))->b.b0; > 61 0056' DD 5E 08 ld e,(ix+8) > 62 0059' 16 00 ld d,0 > 63 005B' DD 6E 06 ld l,(ix+6) > 64 005E' 62 ld h,d > 65 005F' CD 0000* call lmul > 66 0062' EB ex de,hl > 67 0063' DD 6E FE ld l,(ix+-2) > 68 0066' DD 66 FF ld h,(ix+-1) > 69 0069' 19 add hl,de > 70 006A' DD 75 FE ld (ix+-2),l > 71 006D' DD 74 FF ld (ix+-1),h > 72 ;sdcc-mul.c: 70: t.i.hi += ((union bil > *)&(a))-> > b.b1 * ((union bil *)&(b))->b.b1; > 73 0070' DD 5E 09 ld e,(ix+9) > 74 0073' 16 00 ld d,0 > 75 0075' DD 6E 05 ld l,(ix+5) > 76 0078' 62 ld h,d > 77 0079' CD 0000* call lmul > 78 007C' EB ex de,hl > 79 007D' DD 6E FE ld l,(ix+-2) > 80 0080' DD 66 FF ld h,(ix+-1) > 81 0083' 19 add hl,de > 82 0084' DD 75 FE ld (ix+-2),l > 83 0087' DD 74 FF ld (ix+-1),h > 84 ;sdcc-mul.c: 72: ((union bil *)&(a))->bi.b3 > = (( > union bil *)&(a))->b.b1 * ((union bil > *)&(b))->b > .b2; > 85 008A' DD 5E 0A ld e,(ix+10) > 86 008D' 16 00 ld d,0 > 87 008F' DD 6E 05 ld l,(ix+5) > 88 0092' 62 ld h,d > 89 0093' CD 0000* call lmul > 90 0096' DD 75 07 ld (ix+7),l > 91 ;sdcc-mul.c: 73: ((union bil > *)&(a))->bi.i12 = ( > (union bil *)&(a))->b.b1 * ((union bil > *)&(b))-> > b.b0; > 92 0099' DD 5E 08 ld e,(ix+8) > 93 009C' 16 00 ld d,0 > 94 009E' DD 6E 05 ld l,(ix+5) > 95 00A1' 62 ld h,d > 96 00A2' CD 0000* call lmul > 97 00A5' DD 75 05 ld (ix+5),l > 98 00A8' DD 74 06 ld (ix+6),h > 99 ;sdcc-mul.c: 75: ((union bil *)&(b))->bi.b3 > = (( > union bil *)&(a))->b.b0 * ((union bil > *)&(b))->b > > > HI-TECH SOFTWARE Z80 Macro Assembler V7.80PL2 Wed Mar 19 00:23:53 > 2008 > > Page > 3 > > > .b3; > 100 00AB' DD 5E 0B ld e,(ix+11) > 101 00AE' 16 00 ld d,0 > 102 00B0' DD 6E 04 ld l,(ix+4) > 103 00B3' 62 ld h,d > 104 00B4' CD 0000* call lmul > 105 00B7' DD 75 0B ld (ix+11),l > 106 ;sdcc-mul.c: 76: ((union bil > *)&(b))->bi.i12 = ( > (union bil *)&(a))->b.b0 * ((union bil > *)&(b))-> > b.b1; > 107 00BA' DD 5E 09 ld e,(ix+9) > 108 00BD' 16 00 ld d,0 > 109 00BF' DD 6E 04 ld l,(ix+4) > 110 00C2' 62 ld h,d > 111 00C3' CD 0000* call lmul > 112 00C6' DD 75 09 ld (ix+9),l > 113 00C9' DD 74 0A ld (ix+10),h > 114 ;sdcc-mul.c: 78: ((union bil *)&(b))->bi.b0 > = 0; > 115 00CC' DD 36 08 00 ld (ix+8),0 > 116 ;sdcc-mul.c: 79: ((union bil *)&(a))->bi.b0 > = 0; > 117 00D0' DD 36 04 00 ld (ix+4),0 > 118 ;sdcc-mul.c: 80: t.l += a; > 119 00D4' 21 0004 ld hl,04h > 120 00D7' CD 0000* call push_long > 121 00DA' DD E5 push ix > 122 00DC' D1 pop de > 123 00DD' 21 FFFC ld hl,-4 > 124 00E0' 19 add hl,de > 125 00E1' CD 0000* call aslladd > 126 ;sdcc-mul.c: 82: return t.l + b; > 127 00E4' DD 5E FC ld e,(ix+-4) > 128 00E7' DD 56 FD ld d,(ix+-3) > 129 00EA' DD 6E FE ld l,(ix+-2) > 130 00ED' DD 66 FF ld h,(ix+-1) > 131 00F0' EB ex de,hl > 132 00F1' DD 4E 08 ld c,(ix+8) > 133 00F4' DD 46 09 ld b,(ix+9) > 134 00F7' 09 add hl,bc > 135 00F8' EB ex de,hl > 136 00F9' DD 4E 0A ld c,(ix+10) > 137 00FC' DD 46 0B ld b,(ix+11) > 138 00FF' ED 4A adc hl,bc > 139 ;sdcc-mul.c: 83: } > 140 0101' DD F9 ld sp,ix > 141 0103' DD E1 pop ix > 142 0105' C1 pop bc > 143 0106' F1 pop af > 144 0107' F1 pop af > 145 0108' F1 pop af > 146 0109' F1 pop af > 147 010A' C5 push bc > 148 010B' C9 ret > > > HI-TECH SOFTWARE Z80 Macro Assembler V7.80PL2 Wed Mar 19 00:23:53 > 2008 > > Page > 4 > > > > ---------- Symbol Table ---------- > > (ABS) 0000# CODE 0000 CODE 0000 CODE 0000 > __mullong 0000' aslladd 0000* lmul 0000* push_long 0000* > small_model 0000* text 010C# > > 0 jump optimizations > -------------------------------------------------------------------------------- > ;* * * * * Small-C/Plus z88dk * * * * * > ; Version: 20070909.1 > ; > ; Reconstucted for asz80 > ; > ; Module compile time: Wed Mar 19 01:01:46 2008 > > > > .module sdcc-mullong.c > > .include "z80_crt0.hdx" > > .area _CODE > > .radix d > > > __mullong: > push bc > push bc > ld hl,#0+1+1 ;const > add hl,sp > push hl > ld hl,#12 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#10+1+1-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > call l_pint > ld hl,#0 ;const > add hl,sp > push hl > ld hl,#12 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#10-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > call l_pint > ld hl,#0+1+1+1 ;const > add hl,sp > push hl > ld l,(hl) > ld h,0 > push hl > ld hl,#14+1+1+1 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#12-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > add hl,de > pop de > ld a,l > ld (de),a > ld hl,#0+1+1+1 ;const > add hl,sp > push hl > ld l,(hl) > ld h,0 > push hl > ld hl,#14+1+1 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#12+1-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > add hl,de > pop de > ld a,l > ld (de),a > ld hl,#0+1+1 ;const > add hl,sp > push hl > ld e,(hl) > inc hl > ld d,(hl) > push de > ld hl,#14+1+1 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#12-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > add hl,de > pop de > call l_pint > ld hl,#0+1+1 ;const > add hl,sp > push hl > ld e,(hl) > inc hl > ld d,(hl) > push de > ld hl,#14+1 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#12+1-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > add hl,de > pop de > call l_pint > ld hl,#10+1+1+1 ;const > add hl,sp > push hl > ld hl,#12+1 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#10+1+1-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > ld a,l > ld (de),a > ld hl,#10+1 ;const > add hl,sp > push hl > ld hl,#12+1 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#10-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > call l_pint > ld hl,#6+1+1+1 ;const > add hl,sp > push hl > ld hl,#12 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#10+1+1+1-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > ld a,l > ld (de),a > ld hl,#6+1 ;const > add hl,sp > push hl > ld hl,#12 ;const > add hl,sp > ld e,(hl) > ld d,0 > ld hl,#10+1-2 ;const > add hl,sp > ld l,(hl) > ld h,0 > call l_mult > pop de > call l_pint > ld hl,#6 ;const > add hl,sp > ld (hl),#(#0 % 256 % 256) > ld hl,#10 ;const > add hl,sp > ld (hl),#(#0 % 256 % 256) > ld hl,#0 ;const > add hl,sp > push hl > call l_glong > push de > push hl > ld hl,#16 ;const > add hl,sp > call l_glong > call l_long_add > pop bc > call l_plong > ld hl,#0 ;const > add hl,sp > call l_glong > push de > push hl > ld hl,#10 ;const > add hl,sp > call l_glong > call l_long_add > pop bc > pop bc > ret > > > > smce__mullong: > > > ; --- Start of Static Variables --- > > .area _BSS > > > ; --- Start of Scope Defns --- > > .globl __mullong > > > ; --- End of Scope Defns --- > > > ; --- End of Compilation --- > -------------------------------------------------------------------------------- > ;-------------------------------------------------------- > ; File Created by SDCC : free open source ANSI-C Compiler > ; Version 2.8.1 #5198 (Jul 12 2008) (UNIX) > ; This file was generated Sat Jul 12 16:23:08 2008 > ;-------------------------------------------------------- > .module sdcc_mullong > .optsdcc -mz80 > > ;-------------------------------------------------------- > ; Public variables in this module > ;-------------------------------------------------------- > .globl __mullong > ;-------------------------------------------------------- > ; special function registers > ;-------------------------------------------------------- > ;-------------------------------------------------------- > ; ram data > ;-------------------------------------------------------- > .area _DATA > ;-------------------------------------------------------- > ; overlayable items in ram > ;-------------------------------------------------------- > .area _OVERLAY > ;-------------------------------------------------------- > ; external initialized ram data > ;-------------------------------------------------------- > ;-------------------------------------------------------- > ; global & static initialisations > ;-------------------------------------------------------- > .area _HOME > .area _GSINIT > .area _GSFINAL > .area _GSINIT > ;-------------------------------------------------------- > ; Home > ;-------------------------------------------------------- > .area _HOME > .area _HOME > ;-------------------------------------------------------- > ; code > ;-------------------------------------------------------- > .area _CODE > ;sdcc-mullong.c:60: _mullong (long a, long b) > ; genLabel > ; genFunction > ; --------------------------------- > ; Function _mullong > ; --------------------------------- > __mullong_start:: > __mullong: > push ix > ld ix,#0 > add ix,sp > ld hl,#-26 > add hl,sp > ld sp,hl > ;sdcc-mullong.c:64: t.i.hi = bcast(a)->b.b0 * bcast(b)->b.b2; // > A > ; genAddrOf > ; AOP_STK for __mullong__1_0 > ld hl,#0x0016 > add hl,sp > ld -8 (ix),l > ld -7 (ix),h > ; genPlus > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld a,-8 (ix) > add a,#0x02 > ld -6 (ix),a > ld a,-7 (ix) > adc a,#0x00 > ld -5 (ix),a > ; genAddrOf > ld hl,#0x001E > add hl,sp > ; peephole 74 used ex to load hl into de. > ex de,hl > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld a,(de) > ld -9 (ix),a > ; genAddrOf > ; AOP_STK for __mullong__1_0 > ld hl,#0x0022 > add hl,sp > ld -11 (ix),l > ld -10 (ix),h > ; genPlus > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld a,-11 (ix) > add a,#0x02 > ld -13 (ix),a > ld a,-10 (ix) > adc a,#0x00 > ld -12 (ix),a > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-13 (ix) > ld h,-12 (ix) > ld c,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > ld a,c > push af > inc sp > ; genIpush > ; AOP_STK for __mullong__1_0 > ld a,-9 (ix) > push af > inc sp > ; genCall > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-6 (ix) > ld h,-5 (ix) > ld (hl),c > inc hl > ld (hl),b > ;sdcc-mullong.c:65: t.i.lo = bcast(a)->b.b0 * bcast(b)->b.b0; // > A > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ld l,-11 (ix) > ld h,-10 (ix) > ld a,(hl) > ld -6 (ix),a > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > ; AOP_STK for __mullong__1_0 > ; genIpush > ; AOP_STK for __mullong__1_0 > ; peephole 0za pushed -6 (ix), -9(ix) through hl instead of af. > ld h,-6 (ix) > ld l,-9 (ix) > push hl > ; genCall > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-8 (ix) > ld h,-7 (ix) > ld (hl),c > inc hl > ld (hl),b > ;sdcc-mullong.c:66: t.b.b3 += bcast(a)->b.b3 * bcast(b)->b.b0; // > G > ; genAddrOf > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ; peephole 43a removed loads by exploiting commutativity of addition. > ; peephole 43b removed loads by exploiting commutativity of addition. > ld hl,#0x0016 + 0x0003 > add hl,sp > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld -8 (ix),l > ld -7 (ix),h > ; peephole 72 used hl instead of -7 (ix), -8 (ix) to load hl. > ; peephole -1 removed redundant load. > ; peephole -1 removed redundant load. > ld b,(hl) > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld hl,#0x0003 > add hl,de > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld -15 (ix),l > ld -14 (ix),h > ; peephole 72 used hl instead of -14 (ix), -15 (ix) to load hl. > ; peephole -1 removed redundant load. > ; peephole -1 removed redundant load. > ld c,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 1 deSending: 0 > push bc > push de > ; AOP_STK for __mullong__1_0 > ; genIpush > ; peephole 0y pushed bc instead of pushing a twice. > ; peephole 0s loaded b from -6 (ix) instead of going through a. > ld b, -6 (ix) > push bc > ; genCall > call __muluchar_rrx_s > pop af > ld c,l > pop de > pop af > ; genPlus > ; peephole 0b loaded a into a directly instead of going through b. > ; peephole -1 removed redundant load. > add a,c > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-8 (ix) > ld h,-7 (ix) > ld (hl),a > ;sdcc-mullong.c:67: t.b.b3 += bcast(a)->b.b2 * bcast(b)->b.b1; // > F > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-8 (ix) > ld h,-7 (ix) > ld b,(hl) > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld hl,#0x0002 > add hl,de > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ld -17 (ix),l > ld -16 (ix),h > ; peephole 72 used hl instead of -16 (ix), -17 (ix) to load hl. > ; peephole -1 removed redundant load. > ; peephole -1 removed redundant load. > ld a,(hl) > ld -18 (ix),a > ; genPlus > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld a,-11 (ix) > add a,#0x01 > ld -20 (ix),a > ld a,-10 (ix) > adc a,#0x00 > ld -19 (ix),a > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-20 (ix) > ld h,-19 (ix) > ld c,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 1 deSending: 0 > push bc > push de > ld a,c > push af > inc sp > ; genIpush > ; AOP_STK for __mullong__1_0 > ld a,-18 (ix) > push af > inc sp > ; genCall > call __muluchar_rrx_s > pop af > ld c,l > pop de > pop af > ; genPlus > ; peephole 0b loaded a into a directly instead of going through b. > ; peephole -1 removed redundant load. > add a,c > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-8 (ix) > ld h,-7 (ix) > ld (hl),a > ;sdcc-mullong.c:68: t.i.hi += bcast(a)->b.b2 * bcast(b)->b.b0; // > E <- b lost in .lst > ; genAddrOf > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ; peephole 43a removed loads by exploiting commutativity of addition. > ; peephole 43b removed loads by exploiting commutativity of addition. > ld hl,#0x0016 + 0x0002 > add hl,sp > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ld -8 (ix),l > ld -7 (ix),h > ; peephole 72 used hl instead of -7 (ix), -8 (ix) to load hl. > ; peephole -1 removed redundant load. > ; peephole -1 removed redundant load. > ld a,(hl) > ld -22 (ix),a > inc hl > ld a,(hl) > ld -21 (ix),a > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-17 (ix) > ld h,-16 (ix) > ld c,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > ; AOP_STK for __mullong__1_0 > ; genIpush > ; peephole 0y pushed bc instead of pushing a twice. > ; peephole 0s loaded b from -6 (ix) instead of going through a. > ld b, -6 (ix) > push bc > ; genCall > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ; genPlus > ; AOP_STK for __mullong__1_0 > ld a,-22 (ix) > add a,c > ld c,a > ld a,-21 (ix) > adc a,b > ld b,a > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-8 (ix) > ld h,-7 (ix) > ld (hl),c > inc hl > ld (hl),b > ;sdcc-mullong.c:70: t.i.hi += bcast(a)->b.b1 * bcast(b)->b.b1; // > D <- b lost in .lst > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ld l,-8 (ix) > ld h,-7 (ix) > ld a,(hl) > ld -22 (ix),a > inc hl > ld a,(hl) > ld -21 (ix),a > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld hl,#0x0001 > add hl,de > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld -17 (ix),l > ld -16 (ix),h > ; peephole 72 used hl instead of -16 (ix), -17 (ix) to load hl. > ; peephole -1 removed redundant load. > ; peephole -1 removed redundant load. > ld c,(hl) > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-20 (ix) > ld h,-19 (ix) > ld b,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > push bc > inc sp > ; genIpush > ld a,c > push af > inc sp > ; genCall > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ; genPlus > ; AOP_STK for __mullong__1_0 > ld a,-22 (ix) > add a,c > ld c,a > ld a,-21 (ix) > adc a,b > ld b,a > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-8 (ix) > ld h,-7 (ix) > ld (hl),c > inc hl > ld (hl),b > ;sdcc-mullong.c:72: bcast(a)->bi.b3 = bcast(a)->b.b1 * bcast(b)->b.b2; // > C > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-17 (ix) > ld h,-16 (ix) > ld c,(hl) > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-13 (ix) > ld h,-12 (ix) > ld b,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > push bc > inc sp > ; genIpush > ld a,c > push af > inc sp > ; genCall > call __muluchar_rrx_s > pop af > ld c,l > pop de > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-15 (ix) > ld h,-14 (ix) > ld (hl),c > ;sdcc-mullong.c:73: bcast(a)->bi.i12 = bcast(a)->b.b1 * bcast(b)->b.b0; // > C > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld hl,#0x0001 > add hl,de > ld -22 (ix),l > ld -21 (ix),h > ; genPlus > ; genPlusIncr > ld c,e > ld b,d > inc bc > ; genPointerGet > ld a,(bc) > ld c,a > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > ; AOP_STK for __mullong__1_0 > ; genIpush > ; peephole 0y pushed bc instead of pushing a twice. > ; peephole 0s loaded b from -6 (ix) instead of going through a. > ld b, -6 (ix) > push bc > ; genCall > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-22 (ix) > ld h,-21 (ix) > ld (hl),c > inc hl > ld (hl),b > ;sdcc-mullong.c:75: bcast(b)->bi.b3 = bcast(a)->b.b0 * bcast(b)->b.b3; // > B > ; genPlus > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld a,-11 (ix) > add a,#0x03 > ld -22 (ix),a > ld a,-10 (ix) > adc a,#0x00 > ld -21 (ix),a > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ld l,-22 (ix) > ld h,-21 (ix) > ld c,(hl) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > push de > ld a,c > push af > inc sp > ; genIpush > ; AOP_STK for __mullong__1_0 > ld a,-9 (ix) > push af > inc sp > ; genCall > call __muluchar_rrx_s > pop af > ld c,l > pop de > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-22 (ix) > ld h,-21 (ix) > ld (hl),c > ;sdcc-mullong.c:76: bcast(b)->bi.i12 = bcast(a)->b.b0 * bcast(b)->b.b1; // > B > ; genPlus > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld a,-11 (ix) > add a,#0x01 > ld -22 (ix),a > ld a,-10 (ix) > adc a,#0x00 > ld -21 (ix),a > ; genPlus > ; AOP_STK for __mullong__1_0 > ; genPlusIncr > ld c,-11 (ix) > ld b,-10 (ix) > inc bc > ; genPointerGet > ld a,(bc) > ; genIpush > ; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 > ; peephole 0n removed redundant load of a through c. > push de > push af > inc sp > ; genIpush > ; AOP_STK for __mullong__1_0 > ld a,-9 (ix) > push af > inc sp > ; genCall > call __muluchar_rrx_s > pop af > ld b,h > ld c,l > pop de > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-22 (ix) > ld h,-21 (ix) > ld (hl),c > inc hl > ld (hl),b > ;sdcc-mullong.c:78: bcast(b)->bi.b0 = 0; // > B > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-11 (ix) > ld h,-10 (ix) > ld (hl),#0x00 > ;sdcc-mullong.c:79: bcast(a)->bi.b0 = 0; // > C > ; genAssign (pointer) > ; isBitvar = 0 > ld a,#0x00 > ld (de),a > ;sdcc-mullong.c:80: t.l += a; > ; genAddrOf > ; AOP_STK for __mullong__1_0 > ld hl,#0x0016 > add hl,sp > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ld -22 (ix),l > ld -21 (ix),h > ; peephole 72 used hl instead of -21 (ix), -22 (ix) to load hl. > ; peephole -1 removed redundant load. > ; peephole -1 removed redundant load. > ld a,(hl) > ld -26 (ix),a > inc hl > ld a,(hl) > ld -25 (ix),a > inc hl > ld a,(hl) > ld -24 (ix),a > inc hl > ld a,(hl) > ld -23 (ix),a > ; genAssign > ; AOP_STK for > ld c,4 (ix) > ld b,5 (ix) > ld e,6 (ix) > ld d,7 (ix) > ; genPlus > ; AOP_STK for __mullong__1_0 > ld a,-26 (ix) > add a,c > ld c,a > ld a,-25 (ix) > adc a,b > ld b,a > ld a,-24 (ix) > adc a,e > ld e,a > ld a,-23 (ix) > adc a,d > ld d,a > ; genAssign (pointer) > ; AOP_STK for __mullong__1_0 > ; isBitvar = 0 > ld l,-22 (ix) > ld h,-21 (ix) > ld (hl),c > inc hl > ld (hl),b > inc hl > ld (hl),e > inc hl > ld (hl),d > ;sdcc-mullong.c:82: return t.l + b; > ; genPointerGet > ; AOP_STK for __mullong__1_0 > ; AOP_STK for __mullong__1_0 > ld l,-22 (ix) > ld h,-21 (ix) > ld a,(hl) > ld -26 (ix),a > inc hl > ld a,(hl) > ld -25 (ix),a > inc hl > ld a,(hl) > ld -24 (ix),a > inc hl > ld a,(hl) > ld -23 (ix),a > ; genAssign > ; AOP_STK for > ld c,8 (ix) > ld b,9 (ix) > ld e,10 (ix) > ld d,11 (ix) > ; genPlus > ; AOP_STK for __mullong__1_0 > ld a,-26 (ix) > add a,c > ld c,a > ld a,-25 (ix) > adc a,b > ld b,a > ld a,-24 (ix) > adc a,e > ld e,a > ld a,-23 (ix) > adc a,d > ld d,a > ; genRet > ; Dump of IC_LEFT: type AOP_REG size 4 > ; reg = debc > ld l,c > ld h,b > ; genLabel > ; peephole z12 removed unused label 00101$. > ; genEndFunction > ld sp,ix > pop ix > ret > __mullong_end:: > .area _CODE > .area _CABS > -------------------------------------------------------------------------------- > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 -------------------------------------------------------------------------------- > _______________________________________________ > sdcc-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/sdcc-devel > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user