This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Proper use of x86/x86_64 CPUID instruction with extended assembler
- From: Andrew Haley <aph at redhat dot com>
- To: noloader at gmail dot com, Avi Kivity <avi at cloudius-systems dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 19 Aug 2015 10:59:52 +0100
- Subject: Re: Proper use of x86/x86_64 CPUID instruction with extended assembler
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8n9Vr3zeO0odOr3Jizv6vcO4o=s68OyPQwDa+ihaUMoNg at mail dot gmail dot com> <55D42400 dot 2060408 at cloudius-systems dot com> <CAH8yC8kkf5gWA-KWXFM=W6gKzYTzFdT3wcCkpBE8fRHLoc3xZg at mail dot gmail dot com> <55D43DCE dot 6080501 at cloudius-systems dot com> <CAH8yC8kyOtt4rUPXHw9qh+Aymsz2mZtJh9KKTh59F_aOSx-c5g at mail dot gmail dot com>
On 08/19/2015 10:48 AM, Jeffrey Walton wrote:
> Thanks. Another related question....
>
> 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.
Andrew.