Use the x86-32 implementation for x86-64, i.e. replace =r plus xchgq with =b.
Using =r seems like a workaround when RBX as a base register did not
work well =b (2014-09 416efb5f909e45f67ee81d382a708fc41666c5c6), likely
no longer relevant today.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
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
Comment Actions
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.
This patch can work around the bug.