diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-07-21 20:30:18 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-07-21 20:30:18 +0000 |
commit | dbd14bc3e58029f93d64f9b75df5ed1e113381b1 (patch) | |
tree | 37edcff3aeb493528591fddcf9de68ecfb830b61 /llvm/lib | |
parent | 87e07f859672d043af511d856390c43961c9bf14 (diff) | |
download | bcm5719-llvm-dbd14bc3e58029f93d64f9b75df5ed1e113381b1.tar.gz bcm5719-llvm-dbd14bc3e58029f93d64f9b75df5ed1e113381b1.zip |
* Add the lost fix to define the second reg of a 2-reg representation of longs
* Fix opcode RLWNM -> RLWINM since it uses an immediate const shift value
llvm-svn: 15087
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp index 0ce018df320..25db30dfe71 100644 --- a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp +++ b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp @@ -1154,6 +1154,9 @@ void ISel::emitSelectOperation(MachineBasicBlock *MBB, BB = sinkMBB; BuildMI(BB, PPC32::PHI, 4, DestReg).addReg(FalseValue) .addMBB(copy0MBB).addReg(TrueValue).addMBB(copy1MBB); + // For a register pair representing a long value, define the second reg + if (getClass(TrueVal->getType()) == cLong) + BuildMI(BB, PPC32::LI, 1, DestReg+1).addImm(0); return; } @@ -2801,7 +2804,7 @@ void ISel::visitAllocaInst(AllocaInst &I) { // AlignedSize = and <AddedSize>, ~15 unsigned AlignedSize = makeAnotherReg(Type::UIntTy); - BuildMI(BB, PPC32::RLWNM, 4, AlignedSize).addReg(AddedSizeReg).addImm(0) + BuildMI(BB, PPC32::RLWINM, 4, AlignedSize).addReg(AddedSizeReg).addImm(0) .addImm(0).addImm(27); // Subtract size from stack pointer, thereby allocating some space. diff --git a/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp b/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp index 0ce018df320..25db30dfe71 100644 --- a/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp +++ b/llvm/lib/Target/PowerPC/PowerPCISelSimple.cpp @@ -1154,6 +1154,9 @@ void ISel::emitSelectOperation(MachineBasicBlock *MBB, BB = sinkMBB; BuildMI(BB, PPC32::PHI, 4, DestReg).addReg(FalseValue) .addMBB(copy0MBB).addReg(TrueValue).addMBB(copy1MBB); + // For a register pair representing a long value, define the second reg + if (getClass(TrueVal->getType()) == cLong) + BuildMI(BB, PPC32::LI, 1, DestReg+1).addImm(0); return; } @@ -2801,7 +2804,7 @@ void ISel::visitAllocaInst(AllocaInst &I) { // AlignedSize = and <AddedSize>, ~15 unsigned AlignedSize = makeAnotherReg(Type::UIntTy); - BuildMI(BB, PPC32::RLWNM, 4, AlignedSize).addReg(AddedSizeReg).addImm(0) + BuildMI(BB, PPC32::RLWINM, 4, AlignedSize).addReg(AddedSizeReg).addImm(0) .addImm(0).addImm(27); // Subtract size from stack pointer, thereby allocating some space. |