summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-26 20:25:03 +0000
committerChris Lattner <sabre@nondot.org>2005-08-26 20:25:03 +0000
commitb2854fadda9048c2713c8e14f790769b60eae6e8 (patch)
tree252b9de33d0803ef4184b2637d664ca214c183c4 /llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
parentc36c9bdb5d926409496ab7b00d0d743335e2ee85 (diff)
downloadbcm5719-llvm-b2854fadda9048c2713c8e14f790769b60eae6e8.tar.gz
bcm5719-llvm-b2854fadda9048c2713c8e14f790769b60eae6e8.zip
Make fsel emission work with both the pattern and dag-dag selectors, by
giving it a non-instruction opcode. The dag->dag selector used to not select the operands of the fsel, because it thought that whole tree was already selected. llvm-svn: 23091
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 8c0d6d00bec..934f811fb14 100644
--- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -629,7 +629,8 @@ SDOperand PPC32DAGToDAGISel::BuildUDIVSequence(SDNode *N) {
// target-specific node if it hasn't already been changed.
SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
SDNode *N = Op.Val;
- if (N->getOpcode() >= ISD::BUILTIN_OP_END)
+ if (N->getOpcode() >= ISD::BUILTIN_OP_END &&
+ N->getOpcode() < PPCISD::FIRST_NUMBER)
return Op; // Already selected.
switch (N->getOpcode()) {
@@ -747,6 +748,12 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
assert(N->getValueType(0) == MVT::i32);
CurDAG->SelectNodeTo(N, PPC::CNTLZW, MVT::i32, Select(N->getOperand(0)));
break;
+ case PPCISD::FSEL:
+ CurDAG->SelectNodeTo(N, PPC::FSEL, N->getValueType(0),
+ Select(N->getOperand(0)),
+ Select(N->getOperand(1)),
+ Select(N->getOperand(2)));
+ break;
case ISD::ADD: {
MVT::ValueType Ty = N->getValueType(0);
if (Ty == MVT::i32) {
OpenPOWER on IntegriCloud