Re: Proper use of x86/x86_64 CPUID instruction with extended assembler

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

 



>> According to Assembler Templates
>> (https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#AssemblerTemplate),
>> the save of the EBX register and the call to CPUID can be reordered,
>> even with volatile.
>
> No, it doesn't say that.  It says that asm statements may not be
> consecutive.  This is one asm statement.
>
Thanks Andrew. I parsed this incorrectly (I managed to invert it):

    Do not expect a sequence of asm statements to remain
    perfectly consecutive after compilation, even when you
    are using the volatile qualifier. If certain instructions need
    to remain consecutive in the output, put them in a single
    multi-instruction asm statement.

Sorry about that.

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