diff options
author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2016-10-04 06:59:23 +0000 |
---|---|---|
committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2016-10-04 06:59:23 +0000 |
commit | 11049f8f07330c30c689d54ed91d63909b360cf2 (patch) | |
tree | a70b349635cb8c9c5d445cc77595f2794e5e0dc4 /llvm/lib/Target/PowerPC/PPCInstrInfo.h | |
parent | 6b929d5ba91eec2acd6f47c6921ce0dff9a94cd6 (diff) | |
download | bcm5719-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/PPCInstrInfo.h')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.h b/llvm/lib/Target/PowerPC/PPCInstrInfo.h index b1988dee18f..32b2f009a3f 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.h +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.h @@ -61,6 +61,15 @@ enum PPC970_Unit { PPC970_VPERM = 6 << PPC970_Shift, // Vector Permute Unit PPC970_BRU = 7 << PPC970_Shift // Branch Unit }; + +enum { + /// Shift count to bypass PPC970 flags + NewDef_Shift = 6, + + /// The VSX instruction that uses VSX register (vs0-vs63), instead of VMX + /// register (v0-v31). + UseVSXReg = 0x1 << NewDef_Shift +}; } // end namespace PPCII class PPCSubtarget; @@ -273,6 +282,14 @@ public: // Lower pseudo instructions after register allocation. bool expandPostRAPseudo(MachineInstr &MI) const override; + + static bool isVFRegister(unsigned Reg) { + return Reg >= PPC::VF0 && Reg <= PPC::VF31; + } + static bool isVRRegister(unsigned Reg) { + return Reg >= PPC::V0 && Reg <= PPC::V31; + } + const TargetRegisterClass *updatedRC(const TargetRegisterClass *RC) const; }; } |