Re: Converting addc to adcx

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

 



On Fri, May 31, 2019 at 7:19 AM Segher Boessenkool
<segher@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Fri, May 31, 2019 at 06:34:19AM -0400, Jeffrey Walton wrote:
> > We have this inline asm on x86_64. Notice adcq and the constant $0:
> >
> >     asm ("addq %2, %0; adcq $0, %1;" : "+r"(a0), "+r"(a1) : "r"(b) : "cc");
> >
> > I convert it to adcx. This conversion tests OK.
> >
> >     asm ("addq %2, %0; adcx %3, %1;" : "+r"(a0), "+r"(a1) : "r"(b),
> > "r"(0ULL) : "cc");
> >
> > Is this a valid conversion?
>
> Writing to %0 can clobber %3, the way you wrote it.  Use an earlyclobber?
>
> (Look at the generated code to see what is happening -- use -S instead of -c
> for example).

Man, it did not like that when using "&=r"(0ULL) (hundreds of them):

     error: lvalue required in asm statement

(I assume you wanted an early clobber on the input %3).

Jeff



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux