summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2004-09-04 05:00:00 +0000
committerNate Begeman <natebegeman@mac.com>2004-09-04 05:00:00 +0000
commit4bfceb1ed57fca6be15f3e650d10ca9dcff13f0f (patch)
treed5aab0c28ad5f2836a29e86a4737f103ef09db54 /llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
parentb9c90a2b024f790c3828fcd0e0b80d1aebfac425 (diff)
downloadbcm5719-llvm-4bfceb1ed57fca6be15f3e650d10ca9dcff13f0f.tar.gz
bcm5719-llvm-4bfceb1ed57fca6be15f3e650d10ca9dcff13f0f.zip
All PPC instructions are now auto-printed
32 and 64 bit AsmWriters unified Darwin and AIX specific features of AsmWriter split out llvm-svn: 16163
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
index 2a13bfbd929..621648e8b18 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -624,12 +624,13 @@ void ISel::copyConstantToRegister(MachineBasicBlock *MBB,
copyGlobalBaseToRegister(MBB, IP, GlobalBase);
BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, Reg1).addReg(GlobalBase)
.addConstantPoolIndex(CPI);
- BuildMI(*MBB, IP, Opcode, 2, R).addReg(Reg1).addConstantPoolIndex(CPI);
+ BuildMI(*MBB, IP, Opcode, 2, R).addConstantPoolIndex(CPI).addReg(Reg1);
} else if (isa<ConstantPointerNull>(C)) {
// Copy zero (null pointer) to the register.
BuildMI(*MBB, IP, PPC::LI, 1, R).addSImm(0);
} else if (GlobalValue *GV = dyn_cast<GlobalValue>(C)) {
// GV is located at base + distance
+
unsigned GlobalBase = makeAnotherReg(Type::IntTy);
unsigned TmpReg = makeAnotherReg(GV->getType());
unsigned Opcode = (GV->hasWeakLinkage()
@@ -640,7 +641,7 @@ void ISel::copyConstantToRegister(MachineBasicBlock *MBB,
copyGlobalBaseToRegister(MBB, IP, GlobalBase);
BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, TmpReg).addReg(GlobalBase)
.addGlobalAddress(GV);
- BuildMI(*MBB, IP, Opcode, 2, R).addReg(TmpReg).addGlobalAddress(GV);
+ BuildMI(*MBB, IP, Opcode, 2, R).addGlobalAddress(GV).addReg(TmpReg);
// Add the GV to the list of things whose addresses have been taken.
TM.AddressTaken.insert(GV);
@@ -1179,7 +1180,7 @@ void ISel::emitSelectOperation(MachineBasicBlock *MBB,
Opcode = getPPCOpcodeForSetCCNumber(SCI->getOpcode());
} else {
unsigned CondReg = getReg(Cond, MBB, IP);
- BuildMI(*MBB, IP, PPC::CMPI, 2, PPC::CR0).addReg(CondReg).addSImm(0);
+ BuildMI(*MBB, IP, PPC::CMPWI, 2, PPC::CR0).addReg(CondReg).addSImm(0);
Opcode = getPPCOpcodeForSetCCNumber(Instruction::SetNE);
}
unsigned TrueValue = getReg(TrueVal, BB, BB->end());
OpenPOWER on IntegriCloud