 |
|
|
|
Actions
|
|
[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [coldfire-gnu-discuss] Toolchain, asm parameters numbering and optimisation flags
- To: "Nathan Sidwell" <nathan@xxxxxxxxxxxxxxxx>
- Subject: Re: [coldfire-gnu-discuss] Toolchain, asm parameters numbering and optimisation flags
- From: fred@xxxxxxxxxxxx
- Date: Wed, 6 Dec 2006 00:14:57 +0100 (CET)
> Here's your problem. The inline asm semantics are that all the input
> operands
> are read before any of the output operands are written. thus it is safe
> to
> allocate the same register(s) for inputs and outputs. All gcc targets are
> the
> same in this regard. Your assembly breaks that. you can fix this by
> telling
> gcc that 'sum' is an early clobber
> :"=&d" (sum)
>
Hi Nathan, your knowledge is some order of magnitude beyound mine! :)
I've corrected those points, now I can compile with -O0.
But GCC still scramble the registers (assigning D0 to %2 and %3 for
example).
for example :
C source :
move.l (%[X])+, %[tmp1];
move.l (%[Y])+, %[tmp2];
move.w %[tmp1], %[R1];
move.w %[tmp2], %[R2];
generates, with -O2 :
move.l (a0)+, d1;
move.l (a1)+, d1; ouch!
move.w d1, d2;
move.w d1, d3;
I really don't understand why it nicelly works with -O0 and not
with -O2.
Any idea?
Thanx again
|
|