[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
Nate Begeman
natebegeman at mac.com
Wed Apr 6 15:42:19 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelSimple.cpp updated: 1.133 -> 1.134
---
Log message:
Fix some shift bugs
---
Diffs of the changes: (+12 -3)
PPC32ISelSimple.cpp | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.133 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.134
--- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.133 Mon Apr 4 23:22:58 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Wed Apr 6 17:42:08 2005
@@ -2779,8 +2779,13 @@
.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 @@
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 {
More information about the llvm-commits
mailing list