After managing to build mspgcc from version 3.4 I can tell that the compiler
still doesn't make use of autoincrement instructions with byte operands.
This is true with moves but also with other arithmetic operations.

msp430.md looks good (to my humble knowlegde). So where to look at for
improvements?

BTW there are some other deteriorations in code quality with 3.4.
For example, the compiler doesn't use bit operations as frequently as
version 20030506, but uses "move &mem,reg/and #mask" sequences, clobbering
registers unnecessarily.

Regards,
Ralf

"Ralf Guetlein" <ralf.guetl...@web.de> schrieb im Newsbeitrag
news:bh819s$5v...@sea.gmane.org...
> Hi all,
>
> as you see in the disassembly listing below, there is
> a small lack of optimisation:
>
> The compiler refuses to use autoincrement when moving
> byte blocks. With integer values it works ok.
>
> move bytes:
>    6: ee 4f 00 00  mov.b @r15, 0(r14) ;
>    a: 1f 53        inc r15  ;
>    c: 1e 53        inc r14  ;
>
> move integers:
>   1c: be 4f 00 00  mov @r15+, 0(r14) ;
>   20: 2e 53        incd r14  ;
>
> I assume this can be fixed easily, but I'm not too much
> involved in gcc programming now, so I ask for your support.
>
> Regards,
> Ralf
>
> See the whole listing below:
>
>
>
> test.o:     file format elf32-msp430
>
> Disassembly of section .text:
>
> 00000000 <copybytes>:
> void copybytes(char *src, char *dst, int len)
> {
>   while (len--)
>    0: 3d 53        add #-1, r13 ;r3 As==11
>    2: 3d 93        cmp #-1, r13 ;r3 As==11
>    4: 07 24        jz $+16      ;abs 0x14
>     *dst++ = *src++;
>    6: ee 4f 00 00  mov.b @r15, 0(r14) ;
>    a: 1f 53        inc r15  ;
>    c: 1e 53        inc r14  ;
>    e: 3d 53        add #-1, r13 ;r3 As==11
>   10: 3d 93        cmp #-1, r13 ;r3 As==11
>   12: f9 23        jnz $-12      ;abs 0x6
> }
>   14: 30 41        ret
>
> 00000016 <copywords>:
>
>
> void copywords(int *src, int *dst, int len)
> {
>   while (len--)
>   16: 3d 53        add #-1, r13 ;r3 As==11
>   18: 3d 93        cmp #-1, r13 ;r3 As==11
>   1a: 06 24        jz $+14      ;abs 0x28
>     *dst++ = *src++;
>   1c: be 4f 00 00  mov @r15+, 0(r14) ;
>   20: 2e 53        incd r14  ;
>   22: 3d 53        add #-1, r13 ;r3 As==11
>   24: 3d 93        cmp #-1, r13 ;r3 As==11
>   26: fa 23        jnz $-10      ;abs 0x1c
> }
>   28: 30 41        ret
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01




Reply via email to