mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-09 13:41:47 +00:00
implement support for inserting a cond branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
34a84ac81c
commit
54108068b7
@ -240,15 +240,19 @@ void PPCInstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
|
||||
const std::vector<MachineOperand> &Cond) const {
|
||||
// Shouldn't be a fall through.
|
||||
assert(TBB && "InsertBranch must not be told to insert a fallthrough");
|
||||
assert((Cond.size() == 2 || Cond.size() == 0) &&
|
||||
"PPC branch conditions have two components!");
|
||||
|
||||
// Unconditional branch?
|
||||
// One-way branch.
|
||||
if (FBB == 0) {
|
||||
BuildMI(&MBB, PPC::B, 1).addMBB(TBB);
|
||||
if (Cond.empty()) // Unconditional branch
|
||||
BuildMI(&MBB, PPC::B, 1).addMBB(TBB);
|
||||
else // Conditional branch
|
||||
BuildMI(&MBB, PPC::COND_BRANCH, 3)
|
||||
.addReg(Cond[0].getReg()).addImm(Cond[1].getImm()).addMBB(TBB);
|
||||
return;
|
||||
}
|
||||
|
||||
assert(Cond.size() == 2 && "PPC branch conditions have two components!");
|
||||
|
||||
// Conditional branch
|
||||
BuildMI(&MBB, PPC::COND_BRANCH, 3)
|
||||
.addReg(Cond[0].getReg()).addImm(Cond[1].getImm()).addMBB(TBB);
|
||||
|
Loading…
Reference in New Issue
Block a user