summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/PPCInstrInfo.td14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index e22c466b203..92cf29c4548 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -4668,7 +4668,7 @@ def DWLo32RotateInsertByte1 {
}
def ExtendLo32 {
- dag To64Bit =
+ dag ToLo32 =
(i64 (INSERT_SUBREG (i64 (IMPLICIT_DEF)),
DWLo32RotateInsertByte1.Left, sub_32));
}
@@ -4695,15 +4695,17 @@ def DWHi32RotateInsertByte1 {
(RLWIMI DWHi32RotateInsertByte3.Left, DWExtractHi32.SubReg, 8, 24, 31);
}
-def ExtendHi32 {
- dag To64Bit =
+def MoveHi32 {
+ dag ToLo32 =
(i64 (INSERT_SUBREG (i64 (IMPLICIT_DEF)),
DWHi32RotateInsertByte1.Left, sub_32));
}
-def DWShiftLo32 { // SLDI ExtendHi32.To64Bit, 32
- dag ToHi32 = (RLDICR ExtendHi32.To64Bit, 32, 31);
+// Now byte-swap within the high word and low word both are done, next
+// swap the high word and low word.
+def DWShiftLo32 { // SLDI ExtendLo32.ToLo32, 32
+ dag ToHi32 = (RLDICR ExtendLo32.ToLo32, 32, 31);
}
def : Pat<(i64 (bitreverse i64:$A)),
- (OR8 DWShiftLo32.ToHi32, ExtendLo32.To64Bit)>;
+ (OR8 DWShiftLo32.ToHi32, MoveHi32.ToLo32)>;
OpenPOWER on IntegriCloud