aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCInstrInfo.td
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2006-01-11 21:21:00 +0000
committerNate Begeman <natebegeman@mac.com>2006-01-11 21:21:00 +0000
commit35ef913ec21de0f4f1b39c811b4335438717a9b8 (patch)
treede64c2b7d38a608eebb10fe434876c35470fefb0 /lib/Target/PowerPC/PPCInstrInfo.td
parenta243db8c41bd8ace6e002c9e1fdcdc7256ebf677 (diff)
downloadexternal_llvm-35ef913ec21de0f4f1b39c811b4335438717a9b8.zip
external_llvm-35ef913ec21de0f4f1b39c811b4335438717a9b8.tar.gz
external_llvm-35ef913ec21de0f4f1b39c811b4335438717a9b8.tar.bz2
Add bswap, rotl, and rotr nodes
Add dag combiner code to recognize rotl, rotr Add ppc code to match rotl Targets should add rotl/rotr patterns if they have them git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.td')
-rw-r--r--lib/Target/PowerPC/PPCInstrInfo.td9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td
index 2af0dd1..e8f3593 100644
--- a/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/lib/Target/PowerPC/PPCInstrInfo.td
@@ -982,9 +982,6 @@ def : Pat<(or GPRC:$in, imm:$imm),
// XOR an arbitrary immediate.
def : Pat<(xor GPRC:$in, imm:$imm),
(XORIS (XORI GPRC:$in, (LO16 imm:$imm)), (HI16 imm:$imm))>;
-def : Pat<(or (shl GPRC:$rS, GPRC:$rB),
- (srl GPRC:$rS, (sub 32, GPRC:$rB))),
- (RLWNM GPRC:$rS, GPRC:$rB, 0, 31)>;
// Return void support.
def : Pat<(ret), (BLR)>;
@@ -1008,6 +1005,12 @@ def : Pat<(srl GPRC:$in, (i32 imm:$imm)),
def : Pat<(srl G8RC:$in, (i64 imm:$imm)),
(RLDICL G8RC:$in, (SRL64 imm:$imm), imm:$imm)>;
+// ROTL
+def : Pat<(rotl GPRC:$in, GPRC:$sh),
+ (RLWNM GPRC:$in, GPRC:$sh, 0, 31)>;
+def : Pat<(rotl GPRC:$in, (i32 imm:$imm)),
+ (RLWINM GPRC:$in, imm:$imm, 0, 31)>;
+
// Hi and Lo for Darwin Global Addresses.
def : Pat<(PPChi tglobaladdr:$in, 0), (LIS tglobaladdr:$in)>;
def : Pat<(PPClo tglobaladdr:$in, 0), (LI tglobaladdr:$in)>;