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

Re: help with inline asm!!??



On Thu, 31 May 2001, Antti Antinoja wrote:
> #  define MLX(hi, lo, x, y)  \
>     __asm__ ("muls.d %2, %3"  \
>          : "=r" (lo), "=r" (hi)  \
>          : "%r" (x), "r" (y) \
>          : "0")
> 
> I think that the lo is assigned correctly, but hi will contain some "data"
> from some register...

...

> ...So is it that I have to tell the compiler to fetch the MOF somehow for my
> hi variable?

Is there any particular reason you want to do this in inline-asm ? The
compiler generates the above as necessary anyway, and gets MOF correct,
like:

   long b;
   long c;

   long long a = (long long)b * c;

gives this code at the core:

        muls.d $r9,$r11
        move $mof,$r12

(you can probably get the inline asm construct to understand mof as an
output register or simply do the explicit move, but if you don't
absolutely need the asm, don't do it :)

/BW