CurDAG->ReplaceAllUsesWith(Op, New);
N = New.Val;
}
- break;
+ return SDOperand(N, 0);
}
case ISD::CopyFromReg: {
SDOperand Chain = Select(N->getOperand(0));
CurDAG->ReplaceAllUsesWith(Op, New);
N = New.Val;
}
- break;
+ return SDOperand(N, 0);
}
case ISD::Constant: {
assert(N->getValueType(0) == MVT::i32);
CurDAG->SelectNodeTo(N, PPC::IMPLICIT_DEF_GPR, MVT::i32);
else
CurDAG->SelectNodeTo(N, PPC::IMPLICIT_DEF_FP, N->getValueType(0));
- break;
+ return SDOperand(N, 0);
case ISD::FrameIndex: {
int FI = cast<FrameIndexSDNode>(N)->getIndex();
CurDAG->SelectNodeTo(N, PPC::ADDI, MVT::i32,
CurDAG->getTargetFrameIndex(FI, MVT::i32),
getI32Imm(0));
- break;
+ return SDOperand(N, 0);
}
case ISD::ConstantPool: {
Constant *C = cast<ConstantPoolSDNode>(N)->get();
else
Tmp = CurDAG->getTargetNode(PPC::LIS, MVT::i32, CPI);
CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, CPI);
- break;
+ return SDOperand(N, 0);
}
case ISD::GlobalAddress: {
GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
CurDAG->SelectNodeTo(N, PPC::LWZ, MVT::i32, GA, Tmp);
else
CurDAG->SelectNodeTo(N, PPC::LA, MVT::i32, Tmp, GA);
- break;
+ return SDOperand(N, 0);
}
case ISD::DYNAMIC_STACKALLOC: {
// FIXME: We are currently ignoring the requested alignment for handling
// Finally, replace the DYNAMIC_STACKALLOC with the copyfromreg.
CurDAG->ReplaceAllUsesWith(N, Result.Val);
- N = Result.Val;
- break;
+ return SDOperand(Result.Val, Op.ResNo);
}
case ISD::SIGN_EXTEND_INREG:
switch(cast<VTSDNode>(N->getOperand(1))->getVT()) {
CurDAG->SelectNodeTo(N, PPC::EXTSB, MVT::i32, Select(N->getOperand(0)));
break;
}
- break;
+ return SDOperand(N, 0);
case ISD::CTLZ:
assert(N->getValueType(0) == MVT::i32);
CurDAG->SelectNodeTo(N, PPC::CNTLZW, MVT::i32, Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
case PPCISD::FSEL:
CurDAG->SelectNodeTo(N, PPC::FSEL, N->getValueType(0),
Select(N->getOperand(0)),
Select(N->getOperand(1)),
Select(N->getOperand(2)));
- break;
+ return SDOperand(N, 0);
case PPCISD::FCTIWZ:
CurDAG->SelectNodeTo(N, PPC::FCTIWZ, N->getValueType(0),
Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
case ISD::ADD: {
MVT::ValueType Ty = N->getValueType(0);
if (Ty == MVT::i32) {
CurDAG->SelectNodeTo(N, PPC::ADD, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
}
- break;
+ return SDOperand(N, 0);
}
if (!NoExcessFPPrecision) { // Match FMA ops
Select(N->getOperand(0).getOperand(0)),
Select(N->getOperand(0).getOperand(1)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
} else if (N->getOperand(1).getOpcode() == ISD::MUL &&
N->getOperand(1).hasOneUse()) {
++FusedFP; // Statistic
Select(N->getOperand(1).getOperand(0)),
Select(N->getOperand(1).getOperand(1)),
Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
}
}
CurDAG->SelectNodeTo(N, Ty == MVT::f64 ? PPC::FADD : PPC::FADDS, Ty,
Select(N->getOperand(0)), Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::SUB: {
MVT::ValueType Ty = N->getValueType(0);
else
CurDAG->SelectNodeTo(N, PPC::SUBFIC, Ty, Select(N->getOperand(1)),
getI32Imm(Lo16(Imm)));
- break;
+ return SDOperand(N, 0);
}
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0), N->getOperand(1),
PPC::ADDIS, PPC::ADDI, true, true)) {
CurDAG->SelectNodeTo(N, PPC::SUBF, Ty, Select(N->getOperand(1)),
Select(N->getOperand(0)));
}
- break;
+ return SDOperand(N, 0);
}
if (!NoExcessFPPrecision) { // Match FMA ops
Select(N->getOperand(0).getOperand(0)),
Select(N->getOperand(0).getOperand(1)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
} else if (N->getOperand(1).getOpcode() == ISD::MUL &&
N->getOperand(1).Val->hasOneUse()) {
++FusedFP; // Statistic
Select(N->getOperand(1).getOperand(0)),
Select(N->getOperand(1).getOperand(1)),
Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
}
}
CurDAG->SelectNodeTo(N, Ty == MVT::f64 ? PPC::FSUB : PPC::FSUBS, Ty,
Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::MUL: {
unsigned Imm, Opc;
if (isIntImmediate(N->getOperand(1), Imm) && isInt16(Imm)) {
CurDAG->SelectNodeTo(N, PPC::MULLI, MVT::i32,
Select(N->getOperand(0)), getI32Imm(Lo16(Imm)));
- break;
+ return SDOperand(N, 0);
}
switch (N->getValueType(0)) {
default: assert(0 && "Unhandled multiply type!");
}
CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::SDIV: {
unsigned Imm;
getI32Imm(Log2_32(Imm)));
CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32,
Op.getValue(0), Op.getValue(1));
- break;
+ return SDOperand(N, 0);
} else if ((signed)Imm < 0 && isPowerOf2_32(-Imm)) {
SDOperand Op =
CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag,
CurDAG->getTargetNode(PPC::ADDZE, MVT::i32, Op.getValue(0),
Op.getValue(1));
CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT);
- break;
+ return SDOperand(N, 0);
} else if (Imm) {
SDOperand Result = Select(BuildSDIVSequence(N));
assert(Result.ResNo == 0);
CurDAG->ReplaceAllUsesWith(Op, Result);
N = Result.Val;
- break;
+ return SDOperand(N, 0);
}
}
}
CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::UDIV: {
// If this is a divide by constant, we can emit code using some magic
assert(Result.ResNo == 0);
CurDAG->ReplaceAllUsesWith(Op, Result);
N = Result.Val;
- break;
+ return SDOperand(N, 0);
}
CurDAG->SelectNodeTo(N, PPC::DIVWU, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::MULHS:
assert(N->getValueType(0) == MVT::i32);
CurDAG->SelectNodeTo(N, PPC::MULHW, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
case ISD::MULHU:
assert(N->getValueType(0) == MVT::i32);
CurDAG->SelectNodeTo(N, PPC::MULHWU, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
case ISD::AND: {
unsigned Imm;
// If this is an and of a value rotated between 0 and 31 bits and then and'd
}
CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Val, getI32Imm(SH),
getI32Imm(MB), getI32Imm(ME));
- break;
+ return SDOperand(N, 0);
}
// Finally, check for the case where we are being asked to select
// and (not(a), b) or and (a, not(b)) which can be selected as andc.
else
CurDAG->SelectNodeTo(N, PPC::AND, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::OR:
if (SDNode *I = SelectBitfieldInsert(N)) {
CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
- break;
+ return SDOperand(N, 0);
}
if (SDNode *I = SelectIntImmediateExpr(N->getOperand(0),
N->getOperand(1),
PPC::ORIS, PPC::ORI)) {
CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
- break;
+ return SDOperand(N, 0);
}
// Finally, check for the case where we are being asked to select
// 'or (not(a), b)' or 'or (a, not(b))' which can be selected as orc.
else
CurDAG->SelectNodeTo(N, PPC::OR, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
case ISD::XOR:
// Check whether or not this node is a logical 'not'. This is represented
// by llvm as a xor with the constant value -1 (all bits set). If this is a
Val.getOperand(1));
else
CurDAG->SelectNodeTo(N, PPC::NOR, MVT::i32, Val, Val);
- break;
+ return SDOperand(N, 0);
}
// If this is a xor with an immediate other than -1, then codegen it as high
// and low 16 bit immediate xors.
PPC::XORIS, PPC::XORI)) {
CurDAG->ReplaceAllUsesWith(Op, SDOperand(I, 0));
N = I;
- break;
+ return SDOperand(N, 0);
}
// Finally, check for the case where we are being asked to select
// xor (not(a), b) which is equivalent to not(xor a, b), which is eqv
else
CurDAG->SelectNodeTo(N, PPC::XOR, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
case ISD::SHL: {
unsigned Imm, SH, MB, ME;
if (isOpcWithIntImmediate(N->getOperand(0).Val, ISD::AND, Imm) &&
else
CurDAG->SelectNodeTo(N, PPC::SLW, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::SRL: {
unsigned Imm, SH, MB, ME;
else
CurDAG->SelectNodeTo(N, PPC::SRW, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::SRA: {
unsigned Imm, SH, MB, ME;
else
CurDAG->SelectNodeTo(N, PPC::SRAW, MVT::i32, Select(N->getOperand(0)),
Select(N->getOperand(1)));
- break;
+ return SDOperand(N, 0);
}
case ISD::FABS:
CurDAG->SelectNodeTo(N, PPC::FABS, N->getValueType(0),
Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
case ISD::FP_EXTEND:
assert(MVT::f64 == N->getValueType(0) &&
MVT::f32 == N->getOperand(0).getValueType() && "Illegal FP_EXTEND");
// We need to emit an FMR to make sure that the result has the right value
// type.
CurDAG->SelectNodeTo(N, PPC::FMR, MVT::f64, Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
case ISD::FP_ROUND:
assert(MVT::f32 == N->getValueType(0) &&
MVT::f64 == N->getOperand(0).getValueType() && "Illegal FP_ROUND");
CurDAG->SelectNodeTo(N, PPC::FRSP, MVT::f32, Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
case ISD::FNEG: {
SDOperand Val = Select(N->getOperand(0));
MVT::ValueType Ty = N->getValueType(0);
else
CurDAG->SelectNodeTo(N, Opc, Ty, Val.getOperand(0),
Val.getOperand(1), Val.getOperand(2));
- break;
+ return SDOperand(N, 0);
}
}
CurDAG->SelectNodeTo(N, PPC::FNEG, Ty, Val);
- break;
+ return SDOperand(N, 0);
}
case ISD::FSQRT: {
MVT::ValueType Ty = N->getValueType(0);
CurDAG->SelectNodeTo(N, Ty == MVT::f64 ? PPC::FSQRT : PPC::FSQRTS, Ty,
Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
}
case ISD::ADD_PARTS: {
CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other,
Op1, Op2, Select(N->getOperand(0)));
- break;
+ return SDOperand(N, Op.ResNo);
}
case ISD::TRUNCSTORE:
CurDAG->SelectNodeTo(N, Opc, MVT::Other, Select(N->getOperand(1)),
AddrOp1, AddrOp2, Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
}
case ISD::SETCC: {
break;
}
}
- break;
+ return SDOperand(N, 0);
} else if (Imm == ~0U) { // setcc op, -1
SDOperand Op = Select(N->getOperand(0));
switch (CC) {
CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, getI32Imm(1));
break;
}
- break;
+ return SDOperand(N, 0);
}
}
CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1));
}
- break;
+ return SDOperand(N, 0);
}
case ISD::SELECT_CC: {
LHS, getI32Imm(~0U));
CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, Tmp, LHS,
Tmp.getValue(1));
- break;
+ return SDOperand(N, 0);
}
SDOperand CCReg = SelectCC(N->getOperand(0), N->getOperand(1), CC);
CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), CCReg,
Select(N->getOperand(2)), Select(N->getOperand(3)),
getI32Imm(BROpc));
- break;
+ return SDOperand(N, 0);
}
case ISD::CALLSEQ_START:
PPC::ADJCALLSTACKDOWN : PPC::ADJCALLSTACKUP;
CurDAG->SelectNodeTo(N, Opc, MVT::Other,
getI32Imm(Amt), Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
}
case ISD::CALL:
case ISD::TAILCALL: {
// Finally, select this to a blr (return) instruction.
CurDAG->SelectNodeTo(N, PPC::BLR, MVT::Other, Chain);
- break;
+ return SDOperand(N, 0);
}
case ISD::BR:
CurDAG->SelectNodeTo(N, PPC::B, MVT::Other, N->getOperand(1),
Select(N->getOperand(0)));
- break;
+ return SDOperand(N, 0);
case ISD::BR_CC:
case ISD::BRTWOWAY_CC: {
SDOperand Chain = Select(N->getOperand(0));
getI32Imm(Opc), N->getOperand(4),
CurDAG->getBasicBlock(It), Chain);
}
- break;
+ return SDOperand(N, 0);
}
}
+
+ assert(0 && "Unreachable!");
+ abort();
return SDOperand(N, Op.ResNo);
}