This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mc] Make the suffix matcher more accurate.
ClosedPublic

Authored by pengfei on May 26 2020, 8:18 PM.

Details

Summary

Some instruction like VPMULDQ is NOT the variant of VPMULD but a new one
So we should make sure the suffix matcher only works for memory variant
that has the same size with the suffix.
Currently we only check for SSE/AVX* instructions, because many legacy
instructions didn't declare the alias instructions of their variants.

Diff Detail

Event Timeline

pengfei created this revision.May 26 2020, 8:18 PM
craig.topper added inline comments.May 26 2020, 9:06 PM
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
3461

How about isVectorReg?

craig.topper added inline comments.May 26 2020, 9:08 PM
llvm/lib/Target/X86/AsmParser/X86Operand.h
461

Include MMX?

This is also currently broken

maskmov %mm0, %mm0

should only accept
maskmovq %mm0, %mm0

pengfei updated this revision to Diff 266431.May 26 2020, 11:13 PM
pengfei marked 2 inline comments as done.

Address review comments.

craig.topper accepted this revision.May 26 2020, 11:27 PM

I'd like a more robust way to do this, but I don't have any great ideas how. So I guess, LGTM Please put "[X86]" in the commit message before commiting and in review titles for X86 specific things. I have an email filter looking for that. I'd guess others do as well.

This revision is now accepted and ready to land.May 26 2020, 11:27 PM
This revision was automatically updated to reflect the committed changes.
MaskRay added inline comments.May 27 2020, 9:58 AM
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
3474

This breaks assembling of movzb 1280(%rbx,%r12), %r12 (!HasVectorReg)

I fixed it in 5b4cd2d4c42360469ccc9f59aa04a1a24b290df9 . There may be further clean-ups.