avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Optimization around mul and restoring r1


From: Georg-Johann Lay
Subject: Re: [avr-gcc-list] Optimization around mul and restoring r1
Date: Tue, 01 Oct 2013 23:29:19 +0200
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

David Brown schrieb:
On 01/10/13 09:41, Simon Kirby wrote:
Hello!

How difficult would it be to convince avr-gcc to not re-zero r1 instantly
after mul, but delay it until a zero is actually needed? For example,
see this actual avr-gcc output:

        Vneutral = (uint16_t)Vbus * t >> 8;
->
        lds     r25, 0x20FD
        mul     r24, r25
        movw    r24, r0
        eor     r1, r1
        sts     0x205C, r25

Could be just:

        lds     r25, 0x20FD
        mul     r24, r25
        sts     0x205C, r1
        eor     r1, r1

Saving one whole cycle! ;)

In general, it would be a good thing to delay the zeroing of r1, and it
is worth searching the issue database for previous issues and filing a
new "missed optimisation" issue if it is not there already:

IMHO everyone working on the avr back-end is aware of this problem.

Johann



reply via email to

[Prev in Thread] Current Thread [Next in Thread]