[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] foo++, subi vs inc?
From: |
Sparr |
Subject: |
Re: [avr-gcc-list] foo++, subi vs inc? |
Date: |
Wed, 12 Nov 2008 17:38:38 -0500 |
An ubuntu bug is keeping me from [easily] working with the gcc source,
having that information when i finally do get started will save some
time. I will experiment with finding out why it is picking subi
instead of inc, but I think inc should come ahead of subi in general,
so that's at least one thing I can put in a patch.
PS: is gccint.info a typo?
On Wed, Nov 12, 2008 at 4:51 PM, Marek Michalkiewicz
<address@hidden> wrote:
> The addqi3 pattern already has alternatives that use inc/dec - listed
> after the one using subi. You could try to change the order so that
> "subi" is the last one and inc/dec is preferred, all else being equal.
> Not sure why this doesn't already work as expected in your case though,
> despite this paragraph from gccint.info:
>
> If all the operands fit any one alternative, the instruction is valid.
> Otherwise, for each alternative, the compiler counts how many
> instructions must be added to copy the operands so that that
> alternative applies. The alternative requiring the least copying is
> chosen. If two alternatives need the same amount of copying, the one
> that comes first is chosen. These choices can be altered with the `?'
> and `!' characters:
>
> Based on the above, it seems GCC thinks the two alternatives require the
> same amount of copying, even though subi may need more as it only works
> with r16-r31. You could also experiment with putting `?' in the second
> alternative, to disparage "subi" slightly.
>
> Hope this helps,
> Marek
>
- [avr-gcc-list] foo++, subi vs inc?, Sparr, 2008/11/11
- RE: [avr-gcc-list] foo++, subi vs inc?, Weddington, Eric, 2008/11/11
- Re: [avr-gcc-list] foo++, subi vs inc?, Gre7g Luterman, 2008/11/11
- Re: [avr-gcc-list] foo++, subi vs inc?, Joerg Wunsch, 2008/11/12
- Re: [avr-gcc-list] foo++, subi vs inc?, Marek Michalkiewicz, 2008/11/12
- Re: [avr-gcc-list] foo++, subi vs inc?,
Sparr <=