This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add x, t and g modifiers for inline asm
ClosedPublic

Authored by Amanieu on Apr 27 2020, 6:16 PM.

Details

Summary

This patch adds the x, t and g modifiers for inline asm from GCC. These will print a vector register as xmm*, ymm* or zmm* respectively.

I also fixed register names with modifiers with inteldialect so they are no longer printed with a leading %.

Diff Detail

Event Timeline

Amanieu created this revision.Apr 27 2020, 6:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 6:16 PM

Are these documented somewhere for gcc? I don't see them in the operand modifiers here https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html

They are not mentioned in the GCC documentation, but are documented in this comment in the GCC code:

If CODE is 'x', pretend the mode is V4SFmode.
If CODE is 't', pretend the mode is V8SFmode.
If CODE is 'g', pretend the mode is V16SFmode.

We need these modifiers for the new inline assembly support in Rust.

Amanieu updated this revision to Diff 260549.Apr 27 2020, 11:58 PM

clang-format

craig.topper accepted this revision.Apr 28 2020, 12:21 AM

Thanks for the gcc link. How do they expect people to know they exist if they aren't documented?

Anyway this patch, LGTM

This revision is now accepted and ready to land.Apr 28 2020, 12:21 AM

I don't have commit access, could you commit this for me?

This revision was automatically updated to reflect the committed changes.