summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
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
commit1b8121b2279119a079b0becfee7f0e227f76ed73 (patch)
treea026f0159a7415ce92c2152114804cc61b95cc13 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent602dfea79c7f3acec9204315b31726f7f037d4b9 (diff)
downloadbcm5719-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/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index db5c8e2ff99..fe6c4768175 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2112,6 +2112,24 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
}
break;
+ case ISD::ROTL:
+ case ISD::ROTR:
+ Tmp1 = LegalizeOp(Node->getOperand(0)); // LHS
+ Tmp2 = LegalizeOp(Node->getOperand(1)); // RHS
+ switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) {
+ case TargetLowering::Custom:
+ case TargetLowering::Promote:
+ case TargetLowering::Expand:
+ assert(0 && "Cannot handle this yet!");
+ case TargetLowering::Legal:
+ if (Tmp1 != Node->getOperand(0) ||
+ Tmp2 != Node->getOperand(1))
+ Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1,
+ Tmp2);
+ break;
+ }
+ break;
+
case ISD::CTPOP:
case ISD::CTTZ:
case ISD::CTLZ:
OpenPOWER on IntegriCloud