This is an archive of the discontinued LLVM Phabricator instance.

[X86] Print %st(0) as %st to match what gcc inline asm uses as the clobber name to make MS inline asm work correctly
ClosedPublic

Authored by craig.topper on Feb 1 2019, 2:33 PM.

Details

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 print the wrong clobber name

This also matches what objdump disassembly prints.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Feb 1 2019, 2:33 PM
rnk added a comment.Feb 1 2019, 2:48 PM

This is a pretty big change. I feel like it would be reasonable to add some logic to ParseStmtAsm.cpp in clang to do this translation, rather than changing how we print %st / %st(0) everywhere.

What does GCC's -S output look like?

rnk accepted this revision.Feb 1 2019, 3:09 PM

Then let's ship it. :) I'm sure someone will break. Maybe wait a day to see if there are other opinions.

This revision is now accepted and ready to land.Feb 1 2019, 3:09 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2019, 11:55 PM