From a31f1f7cb273156a90aa197db9a97946c0e5812c Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Wed, 21 Jul 2004 20:30:18 +0000 Subject: [PATCH] * 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15087 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPC32ISelSimple.cpp | 5 ++++- lib/Target/PowerPC/PowerPCISelSimple.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp index 0ce018df320..25db30dfe71 100644 --- a/lib/Target/PowerPC/PPC32ISelSimple.cpp +++ b/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 , ~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/lib/Target/PowerPC/PowerPCISelSimple.cpp b/lib/Target/PowerPC/PowerPCISelSimple.cpp index 0ce018df320..25db30dfe71 100644 --- a/lib/Target/PowerPC/PowerPCISelSimple.cpp +++ b/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 , ~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. -- 2.34.1