[PATCH] D128461: [X86] Simplify __cpuid_count

2022-06-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Ah, OK. I am investigating a miscompile that `: "=a"(__eax), "=r" (__ebx), "=c"(__ecx), "=d"(__edx) \` may assign `"=r"` to use RDX. The output then looks like xchgq %rbx, %rdx cpuid xchgq %rbx, %rdx and rbx is clobbered, since cpuid writes rax/rbx/rcx/rdx. Rep

[PATCH] D128461: [X86] Simplify __cpuid_count

2022-06-23 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. I think it's still relevant. We had the same issue on Windows as recently as https://github.com/llvm/llvm-project/issues/49477 see also https://github.com/llvm/llvm-project/issues/17204 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D128461: [X86] Simplify __cpuid_count

2022-06-23 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. Herald added subscribers: jsji, StephenFan, pengfei. Herald added a project: All. MaskRay requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Use the x86-32 implementation for x86-64, i.e. replace =r plus xchgq wi