[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp PPCInstrInfo.td

Nate Begeman natebegeman at mac.com
Wed Jan 11 13:21:18 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.62 -> 1.63
PPCInstrInfo.td updated: 1.172 -> 1.173
---
Log message:

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


---
Diffs of the changes:  (+9 -3)

 PPCISelLowering.cpp |    3 +++
 PPCInstrInfo.td     |    9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.62 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.63
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.62	Wed Jan 11 13:55:07 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Wed Jan 11 15:21:00 2006
@@ -68,6 +68,9 @@
   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);


Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.172 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.173
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.172	Mon Jan  9 18:15:59 2006
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td	Wed Jan 11 15:21:00 2006
@@ -982,9 +982,6 @@
 // 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 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)>;






More information about the llvm-commits mailing list