26 #define DEBUG_TYPE "legalize-types" 41 RTLIB::UNKNOWN_LIBCALL;
48 void DAGTypeLegalizer::SoftenFloatResult(
SDNode *
N,
unsigned ResNo) {
56 dbgs() <<
"SoftenFloatResult #" << ResNo <<
": ";
66 R = SoftenFloatRes_EXTRACT_VECTOR_ELT(N, ResNo);
break;
67 case ISD::FABS: R = SoftenFloatRes_FABS(N);
break;
73 case ISD::FADD: R = SoftenFloatRes_FADD(N);
break;
74 case ISD::FCBRT: R = SoftenFloatRes_FCBRT(N);
break;
76 case ISD::FCEIL: R = SoftenFloatRes_FCEIL(N);
break;
79 case ISD::FCOS: R = SoftenFloatRes_FCOS(N);
break;
81 case ISD::FDIV: R = SoftenFloatRes_FDIV(N);
break;
83 case ISD::FEXP: R = SoftenFloatRes_FEXP(N);
break;
85 case ISD::FEXP2: R = SoftenFloatRes_FEXP2(N);
break;
87 case ISD::FFLOOR: R = SoftenFloatRes_FFLOOR(N);
break;
89 case ISD::FLOG: R = SoftenFloatRes_FLOG(N);
break;
91 case ISD::FLOG2: R = SoftenFloatRes_FLOG2(N);
break;
93 case ISD::FLOG10: R = SoftenFloatRes_FLOG10(N);
break;
95 case ISD::FMA: R = SoftenFloatRes_FMA(N);
break;
97 case ISD::FMUL: R = SoftenFloatRes_FMUL(N);
break;
100 case ISD::FNEG: R = SoftenFloatRes_FNEG(N);
break;
107 case ISD::FPOW: R = SoftenFloatRes_FPOW(N);
break;
109 case ISD::FPOWI: R = SoftenFloatRes_FPOWI(N);
break;
111 case ISD::FREM: R = SoftenFloatRes_FREM(N);
break;
113 case ISD::FRINT: R = SoftenFloatRes_FRINT(N);
break;
115 case ISD::FROUND: R = SoftenFloatRes_FROUND(N);
break;
117 case ISD::FSIN: R = SoftenFloatRes_FSIN(N);
break;
119 case ISD::FSQRT: R = SoftenFloatRes_FSQRT(N);
break;
121 case ISD::FSUB: R = SoftenFloatRes_FSUB(N);
break;
123 case ISD::FTRUNC: R = SoftenFloatRes_FTRUNC(N);
break;
124 case ISD::LOAD: R = SoftenFloatRes_LOAD(N);
break;
126 case ISD::SELECT: R = SoftenFloatRes_SELECT(N);
break;
132 case ISD::UNDEF: R = SoftenFloatRes_UNDEF(N);
break;
133 case ISD::VAARG: R = SoftenFloatRes_VAARG(N);
break;
139 SetSoftenedFloat(
SDValue(N, ResNo), R);
146 unsigned Offset = IsStrict ? 1 : 0;
148 "Unexpected number of operands!");
154 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Op,
155 CallOptions,
SDLoc(N),
158 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
165 unsigned Offset = IsStrict ? 1 : 0;
167 "Unexpected number of operands!");
169 GetSoftenedFloat(N->
getOperand(1 + Offset)) };
175 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Ops,
176 CallOptions,
SDLoc(N),
179 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
183 SDValue DAGTypeLegalizer::SoftenFloatRes_BITCAST(
SDNode *N) {
187 SDValue DAGTypeLegalizer::SoftenFloatRes_MERGE_VALUES(
SDNode *N,
189 SDValue Op = DisintegrateMERGE_VALUES(N, ResNo);
190 return BitConvertToInteger(Op);
193 SDValue DAGTypeLegalizer::SoftenFloatRes_BUILD_PAIR(
SDNode *N) {
202 SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(
SDNode *N) {
215 APInt Val(128, words);
226 SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(
SDNode *N,
unsigned ResNo) {
245 SDValue DAGTypeLegalizer::SoftenFloatRes_FMINNUM(
SDNode *N) {
251 RTLIB::FMIN_PPCF128));
254 SDValue DAGTypeLegalizer::SoftenFloatRes_FMAXNUM(
SDNode *N) {
260 RTLIB::FMAX_PPCF128));
269 RTLIB::ADD_PPCF128));
278 RTLIB::CBRT_PPCF128));
287 RTLIB::CEIL_PPCF128));
290 SDValue DAGTypeLegalizer::SoftenFloatRes_FCOPYSIGN(
SDNode *N) {
296 EVT RVT = RHS.getValueType();
317 }
else if (SizeDiff < 0) {
344 RTLIB::COS_PPCF128));
353 RTLIB::DIV_PPCF128));
362 RTLIB::EXP_PPCF128));
371 RTLIB::EXP2_PPCF128));
380 RTLIB::FLOOR_PPCF128));
389 RTLIB::LOG_PPCF128));
398 RTLIB::LOG2_PPCF128));
407 RTLIB::LOG10_PPCF128));
413 unsigned Offset = IsStrict ? 1 : 0;
416 GetSoftenedFloat(N->
getOperand(2 + Offset)) };
423 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG,
430 NVT, Ops, CallOptions,
SDLoc(N), Chain);
432 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
442 RTLIB::MUL_PPCF128));
445 SDValue DAGTypeLegalizer::SoftenFloatRes_FNEARBYINT(
SDNode *N) {
447 RTLIB::NEARBYINT_F32,
448 RTLIB::NEARBYINT_F64,
449 RTLIB::NEARBYINT_F80,
450 RTLIB::NEARBYINT_F128,
451 RTLIB::NEARBYINT_PPCF128));
464 SDValue DAGTypeLegalizer::SoftenFloatRes_FP_EXTEND(
SDNode *N) {
472 Op = GetPromotedFloat(Op);
476 return BitConvertToInteger(Op);
493 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_EXTEND!");
497 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Op,
498 CallOptions,
SDLoc(N),
501 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
507 SDValue DAGTypeLegalizer::SoftenFloatRes_FP16_TO_FP(
SDNode *N) {
514 CallOptions,
SDLoc(N)).first;
520 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_EXTEND!");
524 SDValue DAGTypeLegalizer::SoftenFloatRes_FP_ROUND(
SDNode *N) {
530 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_ROUND!");
534 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Op,
535 CallOptions,
SDLoc(N),
538 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
548 RTLIB::POW_PPCF128));
553 unsigned Offset = IsStrict ? 1 : 0;
555 "Unsupported power type!");
561 RTLIB::POWI_PPCF128);
577 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Ops,
578 CallOptions,
SDLoc(N),
581 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
591 RTLIB::REM_PPCF128));
600 RTLIB::RINT_PPCF128));
609 RTLIB::ROUND_PPCF128));
618 RTLIB::SIN_PPCF128));
627 RTLIB::SQRT_PPCF128));
636 RTLIB::SUB_PPCF128));
645 RTLIB::TRUNC_PPCF128));
678 return BitConvertToInteger(ExtendNode);
688 SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT_CC(
SDNode *N) {
719 SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(
SDNode *N) {
739 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported XINT_TO_FP!");
748 std::pair<SDValue, SDValue> Tmp =
750 Op, CallOptions, dl, Chain);
753 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
762 bool DAGTypeLegalizer::SoftenFloatOperand(
SDNode *N,
unsigned OpNo) {
770 dbgs() <<
"SoftenFloatOperand Op #" << OpNo <<
": ";
775 case ISD::BITCAST: Res = SoftenFloatOp_BITCAST(N);
break;
776 case ISD::BR_CC: Res = SoftenFloatOp_BR_CC(N);
break;
785 case ISD::LROUND: Res = SoftenFloatOp_LROUND(N);
break;
787 case ISD::LLROUND: Res = SoftenFloatOp_LLROUND(N);
break;
789 case ISD::LRINT: Res = SoftenFloatOp_LRINT(N);
break;
791 case ISD::LLRINT: Res = SoftenFloatOp_LLRINT(N);
break;
795 case ISD::SETCC: Res = SoftenFloatOp_SETCC(N);
break;
796 case ISD::STORE: Res = SoftenFloatOp_STORE(N, OpNo);
break;
801 if (!Res.getNode())
return false;
805 if (Res.getNode() ==
N)
809 "Invalid operand softening");
811 ReplaceValueWith(
SDValue(N, 0), Res);
821 SDValue DAGTypeLegalizer::SoftenFloatOp_FP_ROUND(
SDNode *N) {
834 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_ROUND libcall");
837 Op = GetSoftenedFloat(Op);
840 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, RVT, Op,
841 CallOptions,
SDLoc(N),
844 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
845 ReplaceValueWith(
SDValue(N, 0), Tmp.first);
856 NewLHS = GetSoftenedFloat(NewLHS);
857 NewRHS = GetSoftenedFloat(NewRHS);
863 if (!NewRHS.getNode()) {
875 SDValue DAGTypeLegalizer::SoftenFloatOp_FP_TO_XINT(
SDNode *N) {
899 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_TO_XINT!");
901 Op = GetSoftenedFloat(Op);
905 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Op,
906 CallOptions, dl, Chain);
914 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
915 ReplaceValueWith(
SDValue(N, 0), Res);
919 SDValue DAGTypeLegalizer::SoftenFloatOp_SELECT_CC(
SDNode *N) {
924 NewLHS = GetSoftenedFloat(NewLHS);
925 NewRHS = GetSoftenedFloat(NewRHS);
931 if (!NewRHS.getNode()) {
949 cast<CondCodeSDNode>(N->
getOperand(IsStrict ? 3 : 2))->
get();
952 SDValue NewLHS = GetSoftenedFloat(Op0);
953 SDValue NewRHS = GetSoftenedFloat(Op1);
969 "Unexpected setcc expansion!");
972 ReplaceValueWith(
SDValue(N, 0), NewLHS);
973 ReplaceValueWith(
SDValue(N, 1), Chain);
979 SDValue DAGTypeLegalizer::SoftenFloatOp_STORE(
SDNode *N,
unsigned OpNo) {
981 assert(OpNo == 1 &&
"Can only soften the stored value!");
991 Val = GetSoftenedFloat(Val);
997 SDValue DAGTypeLegalizer::SoftenFloatOp_FCOPYSIGN(
SDNode *N) {
1007 unsigned RSize = RVT.getSizeInBits();
1010 int SizeDiff = RSize - LSize;
1018 }
else if (SizeDiff < 0) {
1034 unsigned Offset = IsStrict ? 1 : 0;
1040 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, NVT, Op,
1041 CallOptions,
SDLoc(N),
1044 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
1045 ReplaceValueWith(
SDValue(N, 0), Tmp.first);
1059 RTLIB::LROUND_PPCF128));
1062 SDValue DAGTypeLegalizer::SoftenFloatOp_LLROUND(
SDNode *N) {
1068 RTLIB::LLROUND_F128,
1069 RTLIB::LLROUND_PPCF128));
1079 RTLIB::LRINT_PPCF128));
1089 RTLIB::LLRINT_PPCF128));
1100 void DAGTypeLegalizer::ExpandFloatResult(
SDNode *N,
unsigned ResNo) {
1112 dbgs() <<
"ExpandFloatResult #" << ResNo <<
": ";
1115 llvm_unreachable(
"Do not know how to expand the result of this operator!");
1117 case ISD::UNDEF: SplitRes_UNDEF(N, Lo, Hi);
break;
1118 case ISD::SELECT: SplitRes_SELECT(N, Lo, Hi);
break;
1122 case ISD::BITCAST: ExpandRes_BITCAST(N, Lo, Hi);
break;
1126 case ISD::VAARG: ExpandRes_VAARG(N, Lo, Hi);
break;
1129 case ISD::FABS: ExpandFloatRes_FABS(N, Lo, Hi);
break;
1131 case ISD::FMINNUM: ExpandFloatRes_FMINNUM(N, Lo, Hi);
break;
1133 case ISD::FMAXNUM: ExpandFloatRes_FMAXNUM(N, Lo, Hi);
break;
1135 case ISD::FADD: ExpandFloatRes_FADD(N, Lo, Hi);
break;
1136 case ISD::FCBRT: ExpandFloatRes_FCBRT(N, Lo, Hi);
break;
1138 case ISD::FCEIL: ExpandFloatRes_FCEIL(N, Lo, Hi);
break;
1141 case ISD::FCOS: ExpandFloatRes_FCOS(N, Lo, Hi);
break;
1143 case ISD::FDIV: ExpandFloatRes_FDIV(N, Lo, Hi);
break;
1145 case ISD::FEXP: ExpandFloatRes_FEXP(N, Lo, Hi);
break;
1147 case ISD::FEXP2: ExpandFloatRes_FEXP2(N, Lo, Hi);
break;
1149 case ISD::FFLOOR: ExpandFloatRes_FFLOOR(N, Lo, Hi);
break;
1151 case ISD::FLOG: ExpandFloatRes_FLOG(N, Lo, Hi);
break;
1153 case ISD::FLOG2: ExpandFloatRes_FLOG2(N, Lo, Hi);
break;
1155 case ISD::FLOG10: ExpandFloatRes_FLOG10(N, Lo, Hi);
break;
1157 case ISD::FMA: ExpandFloatRes_FMA(N, Lo, Hi);
break;
1159 case ISD::FMUL: ExpandFloatRes_FMUL(N, Lo, Hi);
break;
1162 case ISD::FNEG: ExpandFloatRes_FNEG(N, Lo, Hi);
break;
1166 case ISD::FPOW: ExpandFloatRes_FPOW(N, Lo, Hi);
break;
1168 case ISD::FPOWI: ExpandFloatRes_FPOWI(N, Lo, Hi);
break;
1170 case ISD::FRINT: ExpandFloatRes_FRINT(N, Lo, Hi);
break;
1172 case ISD::FROUND: ExpandFloatRes_FROUND(N, Lo, Hi);
break;
1174 case ISD::FSIN: ExpandFloatRes_FSIN(N, Lo, Hi);
break;
1176 case ISD::FSQRT: ExpandFloatRes_FSQRT(N, Lo, Hi);
break;
1178 case ISD::FSUB: ExpandFloatRes_FSUB(N, Lo, Hi);
break;
1180 case ISD::FTRUNC: ExpandFloatRes_FTRUNC(N, Lo, Hi);
break;
1181 case ISD::LOAD: ExpandFloatRes_LOAD(N, Lo, Hi);
break;
1185 case ISD::FREM: ExpandFloatRes_FREM(N, Lo, Hi);
break;
1193 void DAGTypeLegalizer::ExpandFloatRes_ConstantFP(
SDNode *N,
SDValue &
Lo,
1197 "Do not know how to expand this float constant!");
1198 APInt C = cast<ConstantFPSDNode>(
N)->getValueAPF().bitcastToAPInt();
1201 APInt(64, C.getRawData()[1])),
1204 APInt(64, C.getRawData()[0])),
1211 unsigned Offset = IsStrict ? 1 : 0;
1219 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
1220 GetPairElements(Tmp.first, Lo, Hi);
1226 unsigned Offset = IsStrict ? 1 : 0;
1231 Ops, CallOptions,
SDLoc(N),
1234 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
1235 GetPairElements(Tmp.first, Lo, Hi);
1238 void DAGTypeLegalizer::ExpandFloatRes_FABS(
SDNode *N,
SDValue &Lo,
1241 "Logic only correct for ppcf128!");
1252 void DAGTypeLegalizer::ExpandFloatRes_FMINNUM(
SDNode *N,
SDValue &Lo,
1255 RTLIB::FMIN_F32, RTLIB::FMIN_F64,
1256 RTLIB::FMIN_F80, RTLIB::FMIN_F128,
1257 RTLIB::FMIN_PPCF128), Lo, Hi);
1260 void DAGTypeLegalizer::ExpandFloatRes_FMAXNUM(
SDNode *N,
SDValue &Lo,
1263 RTLIB::FMAX_F32, RTLIB::FMAX_F64,
1264 RTLIB::FMAX_F80, RTLIB::FMAX_F128,
1265 RTLIB::FMAX_PPCF128), Lo, Hi);
1268 void DAGTypeLegalizer::ExpandFloatRes_FADD(
SDNode *N,
SDValue &Lo,
1271 RTLIB::ADD_F32, RTLIB::ADD_F64,
1272 RTLIB::ADD_F80, RTLIB::ADD_F128,
1273 RTLIB::ADD_PPCF128), Lo, Hi);
1276 void DAGTypeLegalizer::ExpandFloatRes_FCBRT(
SDNode *N,
SDValue &Lo,
1279 RTLIB::CBRT_F64, RTLIB::CBRT_F80,
1281 RTLIB::CBRT_PPCF128), Lo, Hi);
1284 void DAGTypeLegalizer::ExpandFloatRes_FCEIL(
SDNode *N,
1287 RTLIB::CEIL_F32, RTLIB::CEIL_F64,
1288 RTLIB::CEIL_F80, RTLIB::CEIL_F128,
1289 RTLIB::CEIL_PPCF128), Lo, Hi);
1292 void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(
SDNode *N,
1295 RTLIB::COPYSIGN_F32,
1296 RTLIB::COPYSIGN_F64,
1297 RTLIB::COPYSIGN_F80,
1298 RTLIB::COPYSIGN_F128,
1299 RTLIB::COPYSIGN_PPCF128), Lo, Hi);
1302 void DAGTypeLegalizer::ExpandFloatRes_FCOS(
SDNode *N,
1305 RTLIB::COS_F32, RTLIB::COS_F64,
1306 RTLIB::COS_F80, RTLIB::COS_F128,
1307 RTLIB::COS_PPCF128), Lo, Hi);
1310 void DAGTypeLegalizer::ExpandFloatRes_FDIV(
SDNode *N,
SDValue &Lo,
1317 RTLIB::DIV_PPCF128), Lo, Hi);
1320 void DAGTypeLegalizer::ExpandFloatRes_FEXP(
SDNode *N,
1323 RTLIB::EXP_F32, RTLIB::EXP_F64,
1324 RTLIB::EXP_F80, RTLIB::EXP_F128,
1325 RTLIB::EXP_PPCF128), Lo, Hi);
1328 void DAGTypeLegalizer::ExpandFloatRes_FEXP2(
SDNode *N,
1331 RTLIB::EXP2_F32, RTLIB::EXP2_F64,
1332 RTLIB::EXP2_F80, RTLIB::EXP2_F128,
1333 RTLIB::EXP2_PPCF128), Lo, Hi);
1336 void DAGTypeLegalizer::ExpandFloatRes_FFLOOR(
SDNode *N,
1339 RTLIB::FLOOR_F32, RTLIB::FLOOR_F64,
1340 RTLIB::FLOOR_F80, RTLIB::FLOOR_F128,
1341 RTLIB::FLOOR_PPCF128), Lo, Hi);
1344 void DAGTypeLegalizer::ExpandFloatRes_FLOG(
SDNode *N,
1347 RTLIB::LOG_F32, RTLIB::LOG_F64,
1348 RTLIB::LOG_F80, RTLIB::LOG_F128,
1349 RTLIB::LOG_PPCF128), Lo, Hi);
1352 void DAGTypeLegalizer::ExpandFloatRes_FLOG2(
SDNode *N,
1355 RTLIB::LOG2_F32, RTLIB::LOG2_F64,
1356 RTLIB::LOG2_F80, RTLIB::LOG2_F128,
1357 RTLIB::LOG2_PPCF128), Lo, Hi);
1360 void DAGTypeLegalizer::ExpandFloatRes_FLOG10(
SDNode *N,
1363 RTLIB::LOG10_F32, RTLIB::LOG10_F64,
1364 RTLIB::LOG10_F80, RTLIB::LOG10_F128,
1365 RTLIB::LOG10_PPCF128), Lo, Hi);
1368 void DAGTypeLegalizer::ExpandFloatRes_FMA(
SDNode *N,
SDValue &Lo,
1371 unsigned Offset = IsStrict ? 1 : 0;
1381 RTLIB::FMA_PPCF128),
1385 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
1386 GetPairElements(Tmp.first, Lo, Hi);
1389 void DAGTypeLegalizer::ExpandFloatRes_FMUL(
SDNode *N,
SDValue &Lo,
1396 RTLIB::MUL_PPCF128), Lo, Hi);
1399 void DAGTypeLegalizer::ExpandFloatRes_FNEARBYINT(
SDNode *N,
1402 RTLIB::NEARBYINT_F32,
1403 RTLIB::NEARBYINT_F64,
1404 RTLIB::NEARBYINT_F80,
1405 RTLIB::NEARBYINT_F128,
1406 RTLIB::NEARBYINT_PPCF128), Lo, Hi);
1409 void DAGTypeLegalizer::ExpandFloatRes_FNEG(
SDNode *N,
SDValue &Lo,
1417 void DAGTypeLegalizer::ExpandFloatRes_FP_EXTEND(
SDNode *N,
SDValue &Lo,
1443 ReplaceValueWith(
SDValue(N, 1), Chain);
1446 void DAGTypeLegalizer::ExpandFloatRes_FPOW(
SDNode *N,
1449 RTLIB::POW_F32, RTLIB::POW_F64,
1450 RTLIB::POW_F80, RTLIB::POW_F128,
1451 RTLIB::POW_PPCF128), Lo, Hi);
1454 void DAGTypeLegalizer::ExpandFloatRes_FPOWI(
SDNode *N,
1457 RTLIB::POWI_F32, RTLIB::POWI_F64,
1458 RTLIB::POWI_F80, RTLIB::POWI_F128,
1459 RTLIB::POWI_PPCF128), Lo, Hi);
1462 void DAGTypeLegalizer::ExpandFloatRes_FREM(
SDNode *N,
1465 RTLIB::REM_F32, RTLIB::REM_F64,
1466 RTLIB::REM_F80, RTLIB::REM_F128,
1467 RTLIB::REM_PPCF128), Lo, Hi);
1470 void DAGTypeLegalizer::ExpandFloatRes_FRINT(
SDNode *N,
1473 RTLIB::RINT_F32, RTLIB::RINT_F64,
1474 RTLIB::RINT_F80, RTLIB::RINT_F128,
1475 RTLIB::RINT_PPCF128), Lo, Hi);
1478 void DAGTypeLegalizer::ExpandFloatRes_FROUND(
SDNode *N,
1485 RTLIB::ROUND_PPCF128), Lo, Hi);
1488 void DAGTypeLegalizer::ExpandFloatRes_FSIN(
SDNode *N,
1491 RTLIB::SIN_F32, RTLIB::SIN_F64,
1492 RTLIB::SIN_F80, RTLIB::SIN_F128,
1493 RTLIB::SIN_PPCF128), Lo, Hi);
1496 void DAGTypeLegalizer::ExpandFloatRes_FSQRT(
SDNode *N,
1499 RTLIB::SQRT_F32, RTLIB::SQRT_F64,
1500 RTLIB::SQRT_F80, RTLIB::SQRT_F128,
1501 RTLIB::SQRT_PPCF128), Lo, Hi);
1504 void DAGTypeLegalizer::ExpandFloatRes_FSUB(
SDNode *N,
SDValue &Lo,
1511 RTLIB::SUB_PPCF128), Lo, Hi);
1514 void DAGTypeLegalizer::ExpandFloatRes_FTRUNC(
SDNode *N,
1517 RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
1518 RTLIB::TRUNC_F80, RTLIB::TRUNC_F128,
1519 RTLIB::TRUNC_PPCF128), Lo, Hi);
1522 void DAGTypeLegalizer::ExpandFloatRes_LOAD(
SDNode *N,
SDValue &Lo,
1525 ExpandRes_NormalLoad(N, Lo, Hi);
1547 APInt(NVT.getSizeInBits(), 0)), dl, NVT);
1551 ReplaceValueWith(
SDValue(LD, 1), Chain);
1554 void DAGTypeLegalizer::ExpandFloatRes_XINT_TO_FP(
SDNode *N,
SDValue &Lo,
1579 LC = RTLIB::SINTTOFP_I64_PPCF128;
1582 LC = RTLIB::SINTTOFP_I128_PPCF128;
1584 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported XINT_TO_FP!");
1588 Hi = TLI.
makeLibCall(DAG, LC, VT, Src, CallOptions, dl).first;
1589 GetPairElements(Hi, Lo, Hi);
1600 static const uint64_t TwoE32[] = { 0x41f0000000000000LL, 0 };
1601 static const uint64_t TwoE64[] = { 0x43f0000000000000LL, 0 };
1602 static const uint64_t TwoE128[] = { 0x47f0000000000000LL, 0 };
1626 GetPairElements(Lo, Lo, Hi);
1638 bool DAGTypeLegalizer::ExpandFloatOperand(
SDNode *N,
unsigned OpNo) {
1649 dbgs() <<
"ExpandFloatOperand Op #" << OpNo <<
": ";
1658 case ISD::BR_CC: Res = ExpandFloatOp_BR_CC(N);
break;
1666 case ISD::LROUND: Res = ExpandFloatOp_LROUND(N);
break;
1667 case ISD::LLROUND: Res = ExpandFloatOp_LLROUND(N);
break;
1668 case ISD::LRINT: Res = ExpandFloatOp_LRINT(N);
break;
1669 case ISD::LLRINT: Res = ExpandFloatOp_LLRINT(N);
break;
1671 case ISD::SETCC: Res = ExpandFloatOp_SETCC(N);
break;
1672 case ISD::STORE: Res = ExpandFloatOp_STORE(cast<StoreSDNode>(N),
1677 if (!Res.getNode())
return false;
1681 if (Res.getNode() ==
N)
1685 "Invalid operand expansion");
1687 ReplaceValueWith(
SDValue(N, 0), Res);
1693 void DAGTypeLegalizer::FloatExpandSetCCOperands(
SDValue &NewLHS,
1697 SDValue LHSLo, LHSHi, RHSLo, RHSHi;
1698 GetExpandedFloat(NewLHS, LHSLo, LHSHi);
1699 GetExpandedFloat(NewRHS, RHSLo, RHSHi);
1712 LHSLo, RHSLo, CCCode);
1717 LHSHi, RHSHi, CCCode);
1719 NewLHS = DAG.
getNode(
ISD::OR, dl, Tmp1.getValueType(), Tmp1, Tmp3);
1726 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(N));
1741 SDValue DAGTypeLegalizer::ExpandFloatOp_FCOPYSIGN(
SDNode *N) {
1743 "Logic only correct for ppcf128!");
1752 SDValue DAGTypeLegalizer::ExpandFloatOp_FP_ROUND(
SDNode *N) {
1755 "Logic only correct for ppcf128!");
1769 ReplaceValueWith(
SDValue(N, 0), Hi);
1777 ReplaceValueWith(
SDValue(N, 0), Expansion);
1781 SDValue DAGTypeLegalizer::ExpandFloatOp_FP_TO_SINT(
SDNode *N) {
1789 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_TO_SINT!");
1791 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, RVT, Op,
1792 CallOptions, dl, Chain);
1796 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
1797 ReplaceValueWith(
SDValue(N, 0), Tmp.first);
1801 SDValue DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(
SDNode *N) {
1809 assert(LC != RTLIB::UNKNOWN_LIBCALL &&
"Unsupported FP_TO_UINT!");
1811 std::pair<SDValue, SDValue> Tmp = TLI.
makeLibCall(DAG, LC, RVT, Op,
1812 CallOptions, dl, Chain);
1816 ReplaceValueWith(
SDValue(N, 1), Tmp.second);
1817 ReplaceValueWith(
SDValue(N, 0), Tmp.first);
1821 SDValue DAGTypeLegalizer::ExpandFloatOp_SELECT_CC(
SDNode *N) {
1824 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(N));
1842 FloatExpandSetCCOperands(NewLHS, NewRHS, CCCode,
SDLoc(N));
1847 "Unexpected setcc expansion!");
1856 SDValue DAGTypeLegalizer::ExpandFloatOp_STORE(
SDNode *N,
unsigned OpNo) {
1858 return ExpandOp_NormalStore(N, OpNo);
1861 assert(OpNo == 1 &&
"Can only expand the stored value so far");
1889 RTLIB::LROUND_PPCF128),
1893 SDValue DAGTypeLegalizer::ExpandFloatOp_LLROUND(
SDNode *N) {
1901 RTLIB::LLROUND_F128,
1902 RTLIB::LLROUND_PPCF128),
1915 RTLIB::LRINT_PPCF128),
1928 RTLIB::LLRINT_PPCF128),
1947 bool DAGTypeLegalizer::PromoteFloatOperand(
SDNode *N,
unsigned OpNo) {
1965 dbgs() <<
"PromoteFloatOperand Op #" << OpNo <<
": ";
1970 case ISD::BITCAST: R = PromoteFloatOp_BITCAST(N, OpNo);
break;
1971 case ISD::FCOPYSIGN: R = PromoteFloatOp_FCOPYSIGN(N, OpNo);
break;
1974 case ISD::FP_EXTEND: R = PromoteFloatOp_FP_EXTEND(N, OpNo);
break;
1975 case ISD::SELECT_CC: R = PromoteFloatOp_SELECT_CC(N, OpNo);
break;
1976 case ISD::SETCC: R = PromoteFloatOp_SETCC(N, OpNo);
break;
1977 case ISD::STORE: R = PromoteFloatOp_STORE(N, OpNo);
break;
1981 ReplaceValueWith(
SDValue(N, 0), R);
1985 SDValue DAGTypeLegalizer::PromoteFloatOp_BITCAST(
SDNode *N,
unsigned OpNo) {
2003 SDValue DAGTypeLegalizer::PromoteFloatOp_FCOPYSIGN(
SDNode *N,
unsigned OpNo) {
2004 assert (OpNo == 1 &&
"Only Operand 1 must need promotion here");
2012 SDValue DAGTypeLegalizer::PromoteFloatOp_FP_TO_XINT(
SDNode *N,
unsigned OpNo) {
2017 SDValue DAGTypeLegalizer::PromoteFloatOp_FP_EXTEND(
SDNode *N,
unsigned OpNo) {
2032 SDValue DAGTypeLegalizer::PromoteFloatOp_SELECT_CC(
SDNode *N,
unsigned OpNo) {
2043 SDValue DAGTypeLegalizer::PromoteFloatOp_SETCC(
SDNode *N,
unsigned OpNo) {
2055 SDValue DAGTypeLegalizer::PromoteFloatOp_STORE(
SDNode *N,
unsigned OpNo) {
2060 SDValue Promoted = GetPromotedFloat(Val);
2076 void DAGTypeLegalizer::PromoteFloatResult(
SDNode *N,
unsigned ResNo) {
2082 if (CustomLowerNode(N, N->
getValueType(ResNo),
true)) {
2094 dbgs() <<
"PromoteFloatResult #" << ResNo <<
": ";
2099 case ISD::BITCAST: R = PromoteFloatRes_BITCAST(N);
break;
2102 R = PromoteFloatRes_EXTRACT_VECTOR_ELT(N);
break;
2135 case ISD::FSUB: R = PromoteFloatRes_BinOp(N);
break;
2138 case ISD::FMAD: R = PromoteFloatRes_FMAD(N);
break;
2140 case ISD::FPOWI: R = PromoteFloatRes_FPOWI(N);
break;
2143 case ISD::LOAD: R = PromoteFloatRes_LOAD(N);
break;
2144 case ISD::SELECT: R = PromoteFloatRes_SELECT(N);
break;
2149 case ISD::UNDEF: R = PromoteFloatRes_UNDEF(N);
break;
2154 SetPromotedFloat(
SDValue(N, ResNo), R);
2162 SDValue DAGTypeLegalizer::PromoteFloatRes_BITCAST(
SDNode *N) {
2173 SDValue DAGTypeLegalizer::PromoteFloatRes_ConstantFP(
SDNode *N) {
2194 SDValue DAGTypeLegalizer::PromoteFloatRes_EXTRACT_VECTOR_ELT(
SDNode *N) {
2205 uint64_t IdxVal = cast<ConstantSDNode>(Idx)->getZExtValue();
2207 switch (getTypeAction(VecVT)) {
2211 ReplaceValueWith(
SDValue(N, 0), Res);
2215 Vec = GetWidenedVector(Vec);
2217 ReplaceValueWith(
SDValue(N, 0), Res);
2222 GetSplitVector(Vec, Lo, Hi);
2226 if (IdxVal < LoElts)
2232 ReplaceValueWith(
SDValue(N, 0), Res);
2256 SDValue DAGTypeLegalizer::PromoteFloatRes_FCOPYSIGN(
SDNode *N) {
2269 SDValue DAGTypeLegalizer::PromoteFloatRes_UnaryOp(
SDNode *N) {
2280 SDValue DAGTypeLegalizer::PromoteFloatRes_BinOp(
SDNode *N) {
2299 SDValue DAGTypeLegalizer::PromoteFloatRes_FPOWI(
SDNode *N) {
2310 SDValue DAGTypeLegalizer::PromoteFloatRes_FP_ROUND(
SDNode *N) {
2347 SDValue DAGTypeLegalizer::PromoteFloatRes_SELECT(
SDNode *N) {
2357 SDValue DAGTypeLegalizer::PromoteFloatRes_SELECT_CC(
SDNode *N) {
2368 SDValue DAGTypeLegalizer::PromoteFloatRes_XINT_TO_FP(
SDNode *N) {
2379 SDValue DAGTypeLegalizer::PromoteFloatRes_UNDEF(
SDNode *N) {
2384 SDValue DAGTypeLegalizer::BitcastToInt_ATOMIC_SWAP(
SDNode *N) {
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
EVT getValueType() const
Return the ValueType of the referenced return value.
const SDValue & getOffset() const
Constrained versions of libm-equivalent floating point intrinsics.
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
MakeLibCallOptions & setTypeListBeforeSoften(ArrayRef< EVT > OpsVT, EVT RetVT, bool Value=true)
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
DiagnosticInfoOptimizationBase::Argument NV
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
BR_CC - Conditional branch.
This class represents lattice values for constants.
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0...
const SDValue & getVal() const
This structure is used to pass arguments to makeLibCall function.
const SDValue & getBasePtr() const
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
const SDValue & getValue() const
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
const SDValue & getBasePtr() const
const SDValue & getChain() const
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc, or post-dec.
static const fltSemantics & EVTToAPFloatSemantics(EVT VT)
Returns an APFloat semantics tag appropriate for the given type.
unsigned getAlignment() const
Constrained versions of the binary floating point operators.
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
const SDNodeFlags getFlags() const
SDNode * getNode() const
get the SDNode which holds the desired result
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
bool isByteSized() const
Return true if the bit size is a multiple of 8.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
Libcall getFPROUND(EVT OpVT, EVT RetVT)
getFPROUND - Return the FPROUND_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
bool isTruncatingStore() const
Return true if the op does a truncation before store.
Libcall getUINTTOFP(EVT OpVT, EVT RetVT)
getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
Shift and rotation operations.
bool isNormalStore(const SDNode *N)
Returns true if the specified node is a non-truncating and unindexed store.
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
The memory access is dereferenceable (i.e., doesn't trap).
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt) For double-word atomic operations: ValLo, ValHi, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amtLo, amtHi) ValLo, ValHi, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amtLo, amtHi) These correspond to the atomicrmw instruction.
const DataLayout & getDataLayout() const
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
This is an SDNode representing atomic operations.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
void emitError(unsigned LocCookie, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only...
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
bool isUNINDEXEDStore(const SDNode *N)
Returns true if the specified node is an unindexed store.
void clearBit(unsigned BitPosition)
Set a given bit to 0.
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
X = STRICT_FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
static RTLIB::Libcall GetFPLibCall(EVT VT, RTLIB::Libcall Call_F32, RTLIB::Libcall Call_F64, RTLIB::Libcall Call_F80, RTLIB::Libcall Call_F128, RTLIB::Libcall Call_PPCF128)
GetFPLibCall - Return the right libcall for the given floating point type.
SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, MachineMemOperand *MMO)
Gets a node for an atomic op, produces result (if relevant) and chain and takes 2 operands...
UNDEF - An undefined node.
This class is used to represent ISD::STORE nodes.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
const SDValue & getBasePtr() const
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
Simple binary floating point operators.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
const SDValue & getOperand(unsigned Num) const
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Libcall getFPTOSINT(EVT OpVT, EVT RetVT)
getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
unsigned getNumOperands() const
Return the number of values used by this operation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
bool isUNINDEXEDLoad(const SDNode *N)
Returns true if the specified node is an unindexed load.
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type...
Libcall getFPEXT(EVT OpVT, EVT RetVT)
getFPEXT - Return the FPEXT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
static APInt getSignMask(unsigned BitWidth)
Get the SignMask for a specific bit width.
void dump() const
Dump this node, for debugging.
Returns platform specific canonical encoding of a floating point number.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
EVT getVectorElementType() const
Given a vector type, return the type of each element.
SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
MakeLibCallOptions & setSExt(bool Value=true)
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
EVT getMemoryVT() const
Return the type of the in-memory value.
Class for arbitrary precision integers.
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
Select(COND, TRUEVAL, FALSEVAL).
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
const uint64_t * getRawData() const
This function returns a pointer to the internal storage of the APInt.
static const fltSemantics & PPCDoubleDouble() LLVM_READNONE
Libcall getFPTOUINT(EVT OpVT, EVT RetVT)
getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
Bitwise operators - logical and, logical or, logical xor.
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
Flags getFlags() const
Return the raw flags of the source value,.
The memory access always returns the same value (or traps).
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
SDValue getValue(unsigned R) const
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
SDValue getCondCode(ISD::CondCode Cond)
Libcall getSINTTOFP(EVT OpVT, EVT RetVT)
getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or UNKNOWN_LIBCALL if there is none...
SDValue getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue SV, unsigned Align)
VAArg produces a result and token chain, and takes a pointer and a source value as input...
const MachinePointerInfo & getPointerInfo() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
std::pair< SDValue, SDValue > makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC, EVT RetVT, ArrayRef< SDValue > Ops, MakeLibCallOptions CallOptions, const SDLoc &dl, SDValue Chain=SDValue()) const
Returns a pair of (return value, chain).
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
const APFloat & getValueAPF() const
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
SetCC operator - This evaluates to a true value iff the condition is true.
APInt bitcastToAPInt() const
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
bool isStrictFPOpcode()
Test if this node is a strict floating point pseudo-op.
TRUNCATE - Completely drop the high bits.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
Perform various unary floating-point operations inspired by libm.
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
static ISD::NodeType GetPromotionOpcode(EVT OpVT, EVT RetVT)
LLVMContext * getContext() const
void softenSetCCOperands(SelectionDAG &DAG, EVT VT, SDValue &NewLHS, SDValue &NewRHS, ISD::CondCode &CCCode, const SDLoc &DL, const SDValue OldLHS, const SDValue OldRHS) const
Soften the operands of a comparison.
EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL, bool LegalTypes=true) const
const char * getLibcallName(RTLIB::Libcall Call) const
Get the libcall routine name for the specified libcall.
This class is used to represent ISD::LOAD nodes.