Re: x87 register clobber returns "unknown register name" error

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

 



Hi,

On 04.01.2016 21:55 Hadrien Grasland wrote:
> Hi Bernd,
>
> Thanks for the tip, and sorry for my late reply. I have been moving 
> and lost internet connectivity for a while.
>
> If the "st" clobber provides no details regarding which stack 
> registers will be used, does it mean that the GCC register allocator 
> has no way to know how many stack registers are needed and must 
> invalidate all x87 registers in order to take the safe route ?
>

no, the documentation is always correct ;-)
If you use "t" as input and no output, and you clobber "st", you have to 
pop one register by yourself, but have zero headroom in the register stack.
If you clobber "st", "st(1)" you get one register headroom.
It works also with "t" and "u" as input, but not with "f" or "u" alone.

> In any case, if this is the proper syntax, the GCC manual should 
> perhaps be modified, as in the last example of its section 6.44.3.5 
> "x86 Floating-Point asm Operands" (bottom of 
> https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html ) it suggests 
> that st(x) can be used as a clobber.
>
> Regards,
> Hadrien
>
> Le 11/12/2015 09:07, Bernd Edlinger a écrit :
>> Hi Hadrien,
>>
>>>     asm volatile ("fstps (%1)" :
>>>                   : // No output
>>>                   "t" (input), "r" (output) :
>>>                   "memory", "st(0)");
>> st(0) may work in assembler, but in the clobber section you must 
>> write "st".
>>
>>
>>
>> Regards
>> Bernd.
>





[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