summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-03-17 23:14:23 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-03-17 23:14:23 +0000
commit0910b5afacf35704c854f103b7ecca03e3e11f28 (patch)
tree6f9d8a48cbd2255db56493f16cc527bd12106c05 /llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
parent8609782366bac7117f9e752c53f4fde999f70661 (diff)
downloadbcm5719-llvm-0910b5afacf35704c854f103b7ecca03e3e11f28.tar.gz
bcm5719-llvm-0910b5afacf35704c854f103b7ecca03e3e11f28.zip
Fixed a bug in the IT mask printing where T means the cond bit in the mask
matches that of Firstcond[0] and E means otherwise. The Firstcond[0] is also tagged in the Mask to facilitate Asm printing. The disassembler also depends on this arrangement. This is similar to what's described in A2.5.2 ITSTATE. Ran: utils/lit/lit.py test/CodeGen/ARM test/CodeGen/Thumb test/CodeGen/Thumb2 successfully. llvm-svn: 98775
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp')
-rw-r--r--llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp b/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
index f5ba155f402..f36d4ef7567 100644
--- a/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
+++ b/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp
@@ -78,14 +78,16 @@ bool Thumb2ITBlockPass::InsertITBlocks(MachineBasicBlock &MBB) {
DebugLoc ndl = NMI->getDebugLoc();
unsigned NPredReg = 0;
ARMCC::CondCodes NCC = getPredicate(NMI, NPredReg);
- if (NCC == OCC) {
- Mask |= (1 << Pos);
- } else if (NCC != CC)
+ if (NCC == CC || NCC == OCC)
+ Mask |= (NCC & 1) << Pos;
+ else
break;
--Pos;
++MBBI;
}
Mask |= (1 << Pos);
+ // Tag along (firstcond[0] << 4) with the mask.
+ Mask |= (CC & 1) << 4;
MIB.addImm(Mask);
Modified = true;
++NumITs;
OpenPOWER on IntegriCloud