I have manually decoded the imm field of an insertps one too many
commit718e2ae5130b72b86e9ad89012d79a72fb7d90b7
authorChris Lattner <sabre@nondot.org>
Sat, 28 Aug 2010 20:42:31 +0000 (28 20:42 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Aug 2010 20:42:31 +0000 (28 20:42 +0000)
tree33e326ee324a3d9d64cc2a4d6b8fb4ba67377769
parent8e3c7f0b6da3ce934e4e61bba30f70a79450b6fa
I have manually decoded the imm field of an insertps one too many
times.  This patch causes llc and llvm-mc (which both default to
verbose-asm) to print out comments after a few common shuffle
instructions which indicates the shuffle mask, e.g.:

insertps $113, %xmm3, %xmm0     ## xmm0 = zero,xmm0[1,2],xmm3[1]
unpcklps %xmm1, %xmm0    ## xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
pshufd $1, %xmm1, %xmm1        ## xmm1 = xmm1[1,0,0,0]

This is carefully factored to keep the information extraction (of the
shuffle mask) separate from the printing logic.  I plan to move the
extraction part out somewhere else at some point for other parts of
the x86 backend that want to introspect on the behavior of shuffles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112387 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/AsmPrinter/CMakeLists.txt
lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/AsmPrinter/X86InstComments.cpp [new file with mode: 0644]
lib/Target/X86/AsmPrinter/X86InstComments.h [new file with mode: 0644]
lib/Target/X86/AsmPrinter/X86IntelInstPrinter.cpp