1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

Fix some shift bugs

llvm-svn: 21126
This commit is contained in:
Nate Begeman 2005-04-06 22:42:08 +00:00
parent 242fe17bc4
commit 6c5e4c3bb1

View File

@ -2779,8 +2779,13 @@ void PPC32ISel::emitShiftOperation(MachineBasicBlock *MBB,
.addImm(32-Amount).addImm(Amount).addImm(31);
BuildMI(*MBB, IP, PPC::RLWIMI, 5, DestReg+1).addReg(TempReg)
.addReg(SrcReg).addImm(32-Amount).addImm(0).addImm(Amount-1);
BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(SrcReg)
.addImm(32-Amount).addImm(Amount).addImm(31);
if (isSigned) {
BuildMI(*MBB, IP, PPC::SRAWI, 2, DestReg).addReg(SrcReg)
.addImm(Amount);
} else {
BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(SrcReg)
.addImm(32-Amount).addImm(Amount).addImm(31);
}
}
} else { // Shifting more than 32 bits
Amount -= 32;
@ -2805,7 +2810,11 @@ void PPC32ISel::emitShiftOperation(MachineBasicBlock *MBB,
BuildMI(*MBB, IP, PPC::OR, 2, DestReg+1).addReg(SrcReg)
.addReg(SrcReg);
}
BuildMI(*MBB, IP,PPC::LI, 1, DestReg).addSImm(0);
if (isSigned)
BuildMI(*MBB, IP, PPC::SRAWI, 2, DestReg).addReg(SrcReg)
.addImm(31);
else
BuildMI(*MBB, IP,PPC::LI, 1, DestReg).addSImm(0);
}
}
} else {