summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCVSXCopy.cpp
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2016-10-04 06:59:23 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2016-10-04 06:59:23 +0000
commit11049f8f07330c30c689d54ed91d63909b360cf2 (patch)
treea70b349635cb8c9c5d445cc77595f2794e5e0dc4 /llvm/lib/Target/PowerPC/PPCVSXCopy.cpp
parent6b929d5ba91eec2acd6f47c6921ce0dff9a94cd6 (diff)
downloadbcm5719-llvm-11049f8f07330c30c689d54ed91d63909b360cf2.tar.gz
bcm5719-llvm-11049f8f07330c30c689d54ed91d63909b360cf2.zip
[Power9] Part-word VSX integer scalar loads/stores and sign extend instructions
This patch corresponds to review: https://reviews.llvm.org/D23155 This patch removes the VSHRC register class (based on D20310) and adds exploitation of the Power9 sub-word integer loads into VSX registers as well as vector sign extensions. The new instructions are useful for a few purposes: Int to Fp conversions of 1 or 2-byte values loaded from memory Building vectors of 1 or 2-byte integers with values loaded from memory Storing individual 1 or 2-byte elements from integer vectors This patch implements all of those uses. llvm-svn: 283190
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCVSXCopy.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCVSXCopy.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCVSXCopy.cpp b/llvm/lib/Target/PowerPC/PPCVSXCopy.cpp
index e4989e5687f..3b5d8f094fd 100644
--- a/llvm/lib/Target/PowerPC/PPCVSXCopy.cpp
+++ b/llvm/lib/Target/PowerPC/PPCVSXCopy.cpp
@@ -101,11 +101,8 @@ protected:
// This is a copy *to* a VSX register from a non-VSX register.
Changed = true;
- const TargetRegisterClass *SrcRC =
- IsVRReg(SrcMO.getReg(), MRI) ? &PPC::VSHRCRegClass :
- &PPC::VSLRCRegClass;
+ const TargetRegisterClass *SrcRC = &PPC::VSLRCRegClass;
assert((IsF8Reg(SrcMO.getReg(), MRI) ||
- IsVRReg(SrcMO.getReg(), MRI) ||
IsVSSReg(SrcMO.getReg(), MRI) ||
IsVSFReg(SrcMO.getReg(), MRI)) &&
"Unknown source for a VSX copy");
@@ -116,8 +113,7 @@ protected:
.addImm(1) // add 1, not 0, because there is no implicit clearing
// of the high bits.
.addOperand(SrcMO)
- .addImm(IsVRReg(SrcMO.getReg(), MRI) ? PPC::sub_128
- : PPC::sub_64);
+ .addImm(PPC::sub_64);
// The source of the original copy is now the new virtual register.
SrcMO.setReg(NewVReg);
@@ -126,13 +122,10 @@ protected:
// This is a copy *from* a VSX register to a non-VSX register.
Changed = true;
- const TargetRegisterClass *DstRC =
- IsVRReg(DstMO.getReg(), MRI) ? &PPC::VSHRCRegClass :
- &PPC::VSLRCRegClass;
+ const TargetRegisterClass *DstRC = &PPC::VSLRCRegClass;
assert((IsF8Reg(DstMO.getReg(), MRI) ||
IsVSFReg(DstMO.getReg(), MRI) ||
- IsVSSReg(DstMO.getReg(), MRI) ||
- IsVRReg(DstMO.getReg(), MRI)) &&
+ IsVSSReg(DstMO.getReg(), MRI)) &&
"Unknown destination for a VSX copy");
// Copy the VSX value into a new VSX register of the correct subclass.
@@ -143,8 +136,7 @@ protected:
// Transform the original copy into a subregister extraction copy.
SrcMO.setReg(NewVReg);
- SrcMO.setSubReg(IsVRReg(DstMO.getReg(), MRI) ? PPC::sub_128 :
- PPC::sub_64);
+ SrcMO.setSubReg(PPC::sub_64);
}
}
OpenPOWER on IntegriCloud