parent
72d6f8800d
commit
cfb9a74c2e
|
@ -352,19 +352,18 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
|
||||||
// 'not', then fold 'or' into 'nor', and so forth for the supported ops.
|
// 'not', then fold 'or' into 'nor', and so forth for the supported ops.
|
||||||
if (isOprNot(N)) {
|
if (isOprNot(N)) {
|
||||||
unsigned Opc;
|
unsigned Opc;
|
||||||
switch(N->getOperand(0).getOpcode()) {
|
SDOperand Val = Select(N->getOperand(0));
|
||||||
|
switch (Val.getTargetOpcode()) {
|
||||||
default: Opc = 0; break;
|
default: Opc = 0; break;
|
||||||
case ISD::OR: Opc = PPC::NOR; break;
|
case PPC::OR: Opc = PPC::NOR; break;
|
||||||
case ISD::AND: Opc = PPC::NAND; break;
|
case PPC::AND: Opc = PPC::NAND; break;
|
||||||
case ISD::XOR: Opc = PPC::EQV; break;
|
case PPC::XOR: Opc = PPC::EQV; break;
|
||||||
}
|
}
|
||||||
if (Opc)
|
if (Opc)
|
||||||
CurDAG->SelectNodeTo(N, MVT::i32, Opc,
|
CurDAG->SelectNodeTo(N, MVT::i32, Opc, Val.getOperand(0),
|
||||||
Select(N->getOperand(0).getOperand(0)),
|
Val.getOperand(1));
|
||||||
Select(N->getOperand(0).getOperand(1)));
|
|
||||||
else
|
else
|
||||||
CurDAG->SelectNodeTo(N, MVT::i32, PPC::NOR, Select(N->getOperand(0)),
|
CurDAG->SelectNodeTo(N, MVT::i32, PPC::NOR, Val, Val);
|
||||||
Select(N->getOperand(0)));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// If this is a xor with an immediate other than -1, then codegen it as high
|
// If this is a xor with an immediate other than -1, then codegen it as high
|
||||||
|
|
Loading…
Reference in New Issue