diff options
author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2016-09-23 13:25:31 +0000 |
---|---|---|
committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2016-09-23 13:25:31 +0000 |
commit | d2c3c51a70a3c0f6234b40db82442a6183992191 (patch) | |
tree | 297e5f15c74a272cbebdb84e8787b686bcb13045 /llvm/lib/Target/PowerPC/InstPrinter | |
parent | f34f45fd534140f082d41dbb6a7c60dc675870c4 (diff) | |
download | bcm5719-llvm-d2c3c51a70a3c0f6234b40db82442a6183992191.tar.gz bcm5719-llvm-d2c3c51a70a3c0f6234b40db82442a6183992191.zip |
[Power9] Exploit move and splat instructions for build_vector improvement
This patch corresponds to review:
https://reviews.llvm.org/D21135
This patch exploits the following instructions:
mtvsrws
lxvwsx
mtvsrdd
mfvsrld
In order to improve some build_vector and extractelement patterns.
llvm-svn: 282246
Diffstat (limited to 'llvm/lib/Target/PowerPC/InstPrinter')
-rw-r--r-- | llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp index 8190f31004e..9513fd3cdaf 100644 --- a/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp +++ b/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp @@ -328,10 +328,12 @@ void PPCInstPrinter::printU7ImmOperand(const MCInst *MI, unsigned OpNo, O << (unsigned int)Value; } +// Operands of BUILD_VECTOR are signed and we use this to print operands +// of XXSPLTIB which are unsigned. So we simply truncate to 8 bits and +// print as unsigned. void PPCInstPrinter::printU8ImmOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) { - unsigned int Value = MI->getOperand(OpNo).getImm(); - assert(Value <= 255 && "Invalid u8imm argument!"); + unsigned char Value = MI->getOperand(OpNo).getImm(); O << (unsigned int)Value; } |