diff options
author | Nate Begeman <natebegeman@mac.com> | 2006-01-11 21:21:00 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2006-01-11 21:21:00 +0000 |
commit | 1b8121b2279119a079b0becfee7f0e227f76ed73 (patch) | |
tree | a026f0159a7415ce92c2152114804cc61b95cc13 /llvm/lib/Target/PowerPC | |
parent | 602dfea79c7f3acec9204315b31726f7f037d4b9 (diff) | |
download | bcm5719-llvm-1b8121b2279119a079b0becfee7f0e227f76ed73.tar.gz bcm5719-llvm-1b8121b2279119a079b0becfee7f0e227f76ed73.zip |
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
llvm-svn: 25222
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.td | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 9674432deef..a5ba28d0b05 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -68,6 +68,9 @@ PPCTargetLowering::PPCTargetLowering(TargetMachine &TM) setOperationAction(ISD::CTPOP, MVT::i32 , Expand); setOperationAction(ISD::CTTZ , MVT::i32 , Expand); + // PowerPC does not have ROTR + setOperationAction(ISD::ROTR, MVT::i32 , Expand); + // PowerPC does not have Select setOperationAction(ISD::SELECT, MVT::i32, Expand); setOperationAction(ISD::SELECT, MVT::f32, Expand); diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td index 2af0dd16a3b..e8f359318a8 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td +++ b/llvm/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)>; |