From 77effd8d7e510b04e92e3ef4d81c0fd713862245 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Mon, 15 Dec 2014 19:17:54 +0000 Subject: [PATCH] [X86] Also pretty-print shuffle mask for INSERTPS rm variants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224260 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/InstPrinter/X86InstComments.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/Target/X86/InstPrinter/X86InstComments.cpp b/lib/Target/X86/InstPrinter/X86InstComments.cpp index a8f15e6b948..b53e52fb626 100644 --- a/lib/Target/X86/InstPrinter/X86InstComments.cpp +++ b/lib/Target/X86/InstPrinter/X86InstComments.cpp @@ -140,11 +140,15 @@ bool llvm::EmitAnyX86InstComments(const MCInst *MI, raw_ostream &OS, case X86::INSERTPSrr: case X86::VINSERTPSrr: + Src2Name = getRegName(MI->getOperand(2).getReg()); + // FALL THROUGH. + case X86::INSERTPSrm: + case X86::VINSERTPSrm: DestName = getRegName(MI->getOperand(0).getReg()); Src1Name = getRegName(MI->getOperand(1).getReg()); - Src2Name = getRegName(MI->getOperand(2).getReg()); - if(MI->getOperand(3).isImm()) - DecodeINSERTPSMask(MI->getOperand(3).getImm(), ShuffleMask); + if(MI->getOperand(MI->getNumOperands()-1).isImm()) + DecodeINSERTPSMask(MI->getOperand(MI->getNumOperands()-1).getImm(), + ShuffleMask); break; case X86::MOVLHPSrr: