mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Fix some shift bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21126 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aeca558788
commit
020ef42c19
@ -2779,9 +2779,14 @@ 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);
|
||||
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;
|
||||
if (isLeftShift) {
|
||||
@ -2805,6 +2810,10 @@ void PPC32ISel::emitShiftOperation(MachineBasicBlock *MBB,
|
||||
BuildMI(*MBB, IP, PPC::OR, 2, DestReg+1).addReg(SrcReg)
|
||||
.addReg(SrcReg);
|
||||
}
|
||||
if (isSigned)
|
||||
BuildMI(*MBB, IP, PPC::SRAWI, 2, DestReg).addReg(SrcReg)
|
||||
.addImm(31);
|
||||
else
|
||||
BuildMI(*MBB, IP,PPC::LI, 1, DestReg).addSImm(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user