OSDN Git Service

[X86] Print %st(0) as %st to match what gcc inline asm uses as the clobber name to...
authorCraig Topper <craig.topper@intel.com>
Sun, 3 Feb 2019 07:53:39 +0000 (07:53 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 3 Feb 2019 07:53:39 +0000 (07:53 +0000)
commit09007689382322124ce579d5e62074ddd1e440bc
tree8bc1b6dc48a4dcb077208c77c658796b80777f0c
parent240f582809041bbc8ec2ea353e7c51ecfb0f0edb
[X86] Print %st(0) as %st to match what gcc inline asm uses as the clobber name to make MS inline asm work correctly

Summary:
When calculating clobbers for MS style inline assembly we fail if the asm clobbers stack top because we print st(0) and try to pass it through the gcc register name check. This was found with when I attempted to make a emms/femms clobber all ST registers. If you use emms/femms in MS inline asm we would try to use st(0) as the clobber name but clang would think that wasn't a valid clobber name.

This also matches what objdump disassembly prints. It's also what is printed by gcc -S.

Reviewers: RKSimon, rnk, efriedma, spatel, andreadb, lebedev.ri

Reviewed By: rnk

Subscribers: eraman, gbedwell, lebedev.ri, llvm-commits

Differential Revision: https://reviews.llvm.org/D57621

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352985 91177308-0d34-0410-b5e6-96231b3b80d8
42 files changed:
lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/X86InstrFPStack.td
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86RegisterInfo.td
test/CodeGen/X86/2007-09-27-LDIntrinsics.ll
test/CodeGen/X86/avx512-regcall-NoMask.ll
test/CodeGen/X86/fcmove.ll
test/CodeGen/X86/finite-libcalls.ll
test/CodeGen/X86/fmf-flags.ll
test/CodeGen/X86/fp-cvt.ll
test/CodeGen/X86/fp128-cast.ll
test/CodeGen/X86/inline-asm-fpstack.ll
test/CodeGen/X86/pr13577.ll
test/CodeGen/X86/pr33349.ll
test/CodeGen/X86/pr34080.ll
test/CodeGen/X86/pr34177.ll
test/CodeGen/X86/scalar-fp-to-i64.ll
test/CodeGen/X86/select.ll
test/CodeGen/X86/sibcall.ll
test/CodeGen/X86/x87-schedule.ll
test/MC/Disassembler/X86/fp-stack.txt
test/MC/Disassembler/X86/x86-16.txt
test/MC/X86/PPRO-32.s
test/MC/X86/PPRO-64.s
test/MC/X86/X87-32.s
test/MC/X86/X87-64.s
test/MC/X86/intel-syntax.s
test/MC/X86/x86-16.s
test/MC/X86/x86-32-coverage.s
test/MC/X86/x86-32.s
test/MC/X86/x86-64.s
test/tools/llvm-mca/X86/Atom/resources-x87.s
test/tools/llvm-mca/X86/BdVer2/resources-x87.s
test/tools/llvm-mca/X86/Broadwell/resources-x87.s
test/tools/llvm-mca/X86/BtVer2/resources-x87.s
test/tools/llvm-mca/X86/Generic/resources-x87.s
test/tools/llvm-mca/X86/Haswell/resources-x87.s
test/tools/llvm-mca/X86/SLM/resources-x87.s
test/tools/llvm-mca/X86/SandyBridge/resources-x87.s
test/tools/llvm-mca/X86/SkylakeClient/resources-x87.s
test/tools/llvm-mca/X86/SkylakeServer/resources-x87.s
test/tools/llvm-mca/X86/Znver1/resources-x87.s