Re: Inline assembly and clobbered registers

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

 



Hi,

Ian Lance Taylor <iant@xxxxxxxxxx> writes:

> ludo@xxxxxxx (Ludovic CourtÃs) writes:

[...]

>> Namely, clobbering a specific register doesnât sound wise here since
>> this asm snippet will be part of the bytecode interpreter, where GCCâs
>> register allocator can supposedly do a better job if I donât make its
>> life harder by clobbering an arbitrarily-chosen register.
>
> I would do this anyhow.  Assuming your target has several general
> purpose registers, then the register allocator will work around the loss
> of one of them across an asm statement.  How about something like
>
>    int result asm ("r1");
>
> and then mark the asm as clobbering r1.

Yes, thatâd work.

However, Iâm targeting x86, hence my concern for register allocation.

Thanks for taking the time!

Ludoâ.



[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