-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
clang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsics
Description
#include <cpuid.h>
unsigned get_cpuid_max(unsigned ext, unsigned* sig)
{
return __get_cpuid_max(ext, sig);
}-masm=intel
Expected: Should work, like gcc; the relevant asm supports both at&t and intel syntax https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/cpuid.h#L280
Actual: The clang version of that header is at&t syntax only https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/cpuid.h#L271, and returns
In file included from <source>:1:
/opt/compiler-explorer/clang-19.1.0/lib/clang/19/include/cpuid.h:309:5: error: unknown token in expression
309 | __cpuid(__leaf, __eax, __ebx, __ecx, __edx);
| ^
/opt/compiler-explorer/clang-19.1.0/lib/clang/19/include/cpuid.h:271:12: note: expanded from macro '__cpuid'
271 | " cpuid\n" \
| ^
<inline asm>:2:11: note: instantiated into assembly here
2 | xchgq %rbx,rdi
| ^
In file included from <source>:1:
/opt/compiler-explorer/clang-19.1.0/lib/clang/19/include/cpuid.h:309:5: error: unknown token in expression
309 | __cpuid(__leaf, __eax, __ebx, __ecx, __edx);
| ^
/opt/compiler-explorer/clang-19.1.0/lib/clang/19/include/cpuid.h:270:11: note: expanded from macro '__cpuid'
270 | __asm(" xchgq %%rbx,%q1\n" \
| ^
<inline asm>:4:10: note: instantiated into assembly here
4 | xchgq %rbx,rdi
| ^
Metadata
Metadata
Assignees
Labels
clang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsics