This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: commutative asm operands


Hi,

On Mon, 5 Aug 2002, Alan Modra wrote:

> > >         * recog.c (constrain_operands): Handle commutative operands.
> >
> > What exactly does this patch fix?
>
> The ICE reported at the beginning of this thread, and the following
> similar one.

It's not fixing the problem, it's hiding it (and not very good).

> produces, with my patch:
>
> .f:
> #APP
>         addc 3, 3, 5
>         adde 4, 4, 6
>         addc 3, 5, 3
>         adde 4, 4, 6
> #NO_APP

The "3, 5, 3" line isn't correct, it's conflicting with the constraints.
I had an even better test case, which really forced reloads, when '%' was
ommitted, but it somehow got lost.
Anyway, my patch tries to find best combination of operands, e.g. for your
example it automatically would do:

asm ("addc %0, %2, %3\n\t"
     "adde %1, %4, %5"
     : "=r,r,r,r" (lo), "=r,r,r,r" (hi)
     : "r,0,r,0" (__lo), "0,r,0,r" (lo), "r,r,1,1" (__hi), "1,1,r,r" (hi))

BTW your example misses the earlyclobber constraint (&) for operand 0.

bye, Roman




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]