diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-05-29 11:58:52 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-05-29 11:58:52 +0000 |
commit | 2d664abbfca8b9fa3d99e8a2f74bd52faf007f12 (patch) | |
tree | ef3e64c5251a4118e32a0393799793277d7259f4 /lib/Target/SystemZ/SystemZInstrInfo.cpp | |
parent | b8303eb654c1ba1833cfd048ed1f01309b19afe2 (diff) | |
download | llvm-2d664abbfca8b9fa3d99e8a2f74bd52faf007f12.tar.gz llvm-2d664abbfca8b9fa3d99e8a2f74bd52faf007f12.tar.bz2 llvm-2d664abbfca8b9fa3d99e8a2f74bd52faf007f12.tar.xz |
[SystemZ] Immediate compare-and-branch support
This patch adds support for the CIJ and CGIJ instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZInstrInfo.cpp')
-rw-r--r-- | lib/Target/SystemZ/SystemZInstrInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Target/SystemZ/SystemZInstrInfo.cpp b/lib/Target/SystemZ/SystemZInstrInfo.cpp index dcce5a7b7f..5339bf14ac 100644 --- a/lib/Target/SystemZ/SystemZInstrInfo.cpp +++ b/lib/Target/SystemZ/SystemZInstrInfo.cpp @@ -373,10 +373,12 @@ SystemZInstrInfo::getBranchInfo(const MachineInstr *MI) const { return SystemZII::Branch(SystemZII::BranchNormal, MI->getOperand(0).getImm(), &MI->getOperand(1)); + case SystemZ::CIJ: case SystemZ::CRJ: return SystemZII::Branch(SystemZII::BranchC, MI->getOperand(2).getImm(), &MI->getOperand(3)); + case SystemZ::CGIJ: case SystemZ::CGRJ: return SystemZII::Branch(SystemZII::BranchCG, MI->getOperand(2).getImm(), &MI->getOperand(3)); @@ -440,12 +442,17 @@ unsigned SystemZInstrInfo::getOpcodeForOffset(unsigned Opcode, return 0; } -unsigned SystemZInstrInfo::getCompareAndBranch(unsigned Opcode) const { +unsigned SystemZInstrInfo::getCompareAndBranch(unsigned Opcode, + const MachineInstr *MI) const { switch (Opcode) { case SystemZ::CR: return SystemZ::CRJ; case SystemZ::CGR: return SystemZ::CGRJ; + case SystemZ::CHI: + return MI && isInt<8>(MI->getOperand(1).getImm()) ? SystemZ::CIJ : 0; + case SystemZ::CGHI: + return MI && isInt<8>(MI->getOperand(1).getImm()) ? SystemZ::CGIJ : 0; default: return 0; } |