Re: 128-bit inline assembly addition

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

 



On Mon, 16 Jul 2018, Marcel Keller wrote:

I've found that the attached program, which supposedly adds 1 and 0 as 128-bit numbers using inline assembly, outputs 2^64 + 1 instead when compiled with g++ 7 or 8 and at least -O1. Am I doing something wrong, or is this a compiler bug?

I think the keyword is early-clobber. Try "+&r" for the first variable, which is overwritten in the first instruction, so gcc knows not to merge it with x[1].

--
Marc Glisse



[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