mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-26 07:29:55 +00:00
Instead of requiring TLI.LowerCallTo to return an ISD::BUILD_PAIR,
use ISD::EXTRACT_ELEMENT. SelectionDAG has a special fast-path for the cast of an EXTRACT_ELEMENT with a BUILD_PAIR operand, for the common case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7787d4a34b
commit
98d07102d6
@ -860,9 +860,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FADD(SDNode *N, SDValue &Lo,
|
||||
RTLIB::ADD_F32, RTLIB::ADD_F64,
|
||||
RTLIB::ADD_F80, RTLIB::ADD_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FCEIL(SDNode *N,
|
||||
@ -871,9 +874,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FCEIL(SDNode *N,
|
||||
RTLIB::CEIL_F32, RTLIB::CEIL_F64,
|
||||
RTLIB::CEIL_F80, RTLIB::CEIL_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FCOS(SDNode *N,
|
||||
@ -882,9 +888,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FCOS(SDNode *N,
|
||||
RTLIB::COS_F32, RTLIB::COS_F64,
|
||||
RTLIB::COS_F80, RTLIB::COS_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FDIV(SDNode *N, SDValue &Lo,
|
||||
@ -897,9 +906,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FDIV(SDNode *N, SDValue &Lo,
|
||||
RTLIB::DIV_PPCF128),
|
||||
N->getValueType(0), Ops, 2, false,
|
||||
N->getDebugLoc());
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FEXP(SDNode *N,
|
||||
@ -908,9 +920,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FEXP(SDNode *N,
|
||||
RTLIB::EXP_F32, RTLIB::EXP_F64,
|
||||
RTLIB::EXP_F80, RTLIB::EXP_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FEXP2(SDNode *N,
|
||||
@ -919,9 +934,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FEXP2(SDNode *N,
|
||||
RTLIB::EXP2_F32, RTLIB::EXP2_F64,
|
||||
RTLIB::EXP2_F80, RTLIB::EXP2_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FFLOOR(SDNode *N,
|
||||
@ -930,9 +948,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FFLOOR(SDNode *N,
|
||||
RTLIB::FLOOR_F32,RTLIB::FLOOR_F64,
|
||||
RTLIB::FLOOR_F80,RTLIB::FLOOR_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FLOG(SDNode *N,
|
||||
@ -941,9 +962,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FLOG(SDNode *N,
|
||||
RTLIB::LOG_F32, RTLIB::LOG_F64,
|
||||
RTLIB::LOG_F80, RTLIB::LOG_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FLOG2(SDNode *N,
|
||||
@ -952,9 +976,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FLOG2(SDNode *N,
|
||||
RTLIB::LOG2_F32, RTLIB::LOG2_F64,
|
||||
RTLIB::LOG2_F80, RTLIB::LOG2_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FLOG10(SDNode *N,
|
||||
@ -963,9 +990,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FLOG10(SDNode *N,
|
||||
RTLIB::LOG10_F32,RTLIB::LOG10_F64,
|
||||
RTLIB::LOG10_F80,RTLIB::LOG10_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FMUL(SDNode *N, SDValue &Lo,
|
||||
@ -978,9 +1008,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FMUL(SDNode *N, SDValue &Lo,
|
||||
RTLIB::MUL_PPCF128),
|
||||
N->getValueType(0), Ops, 2, false,
|
||||
N->getDebugLoc());
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FNEARBYINT(SDNode *N,
|
||||
@ -991,9 +1024,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FNEARBYINT(SDNode *N,
|
||||
RTLIB::NEARBYINT_F80,
|
||||
RTLIB::NEARBYINT_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FNEG(SDNode *N, SDValue &Lo,
|
||||
@ -1017,9 +1053,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FPOW(SDNode *N,
|
||||
RTLIB::POW_F32, RTLIB::POW_F64,
|
||||
RTLIB::POW_F80, RTLIB::POW_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FPOWI(SDNode *N,
|
||||
@ -1028,9 +1067,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FPOWI(SDNode *N,
|
||||
RTLIB::POWI_F32, RTLIB::POWI_F64,
|
||||
RTLIB::POWI_F80, RTLIB::POWI_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FRINT(SDNode *N,
|
||||
@ -1039,9 +1081,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FRINT(SDNode *N,
|
||||
RTLIB::RINT_F32, RTLIB::RINT_F64,
|
||||
RTLIB::RINT_F80, RTLIB::RINT_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FSIN(SDNode *N,
|
||||
@ -1050,9 +1095,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FSIN(SDNode *N,
|
||||
RTLIB::SIN_F32, RTLIB::SIN_F64,
|
||||
RTLIB::SIN_F80, RTLIB::SIN_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FSQRT(SDNode *N,
|
||||
@ -1061,9 +1109,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FSQRT(SDNode *N,
|
||||
RTLIB::SQRT_F32, RTLIB::SQRT_F64,
|
||||
RTLIB::SQRT_F80, RTLIB::SQRT_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FSUB(SDNode *N, SDValue &Lo,
|
||||
@ -1076,9 +1127,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FSUB(SDNode *N, SDValue &Lo,
|
||||
RTLIB::SUB_PPCF128),
|
||||
N->getValueType(0), Ops, 2, false,
|
||||
N->getDebugLoc());
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_FTRUNC(SDNode *N,
|
||||
@ -1087,9 +1141,12 @@ void DAGTypeLegalizer::ExpandFloatRes_FTRUNC(SDNode *N,
|
||||
RTLIB::TRUNC_F32, RTLIB::TRUNC_F64,
|
||||
RTLIB::TRUNC_F80, RTLIB::TRUNC_PPCF128),
|
||||
N, false);
|
||||
assert(Call.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Call.getOperand(0); Hi = Call.getOperand(1);
|
||||
MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0));
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Call,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::ExpandFloatRes_LOAD(SDNode *N, SDValue &Lo,
|
||||
@ -1157,9 +1214,10 @@ void DAGTypeLegalizer::ExpandFloatRes_XINT_TO_FP(SDNode *N, SDValue &Lo,
|
||||
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported XINT_TO_FP!");
|
||||
|
||||
Hi = MakeLibCall(LC, VT, &Src, 1, true, dl);
|
||||
assert(Hi.getNode()->getOpcode() == ISD::BUILD_PAIR &&
|
||||
"Call lowered wrongly!");
|
||||
Lo = Hi.getOperand(0); Hi = Hi.getOperand(1);
|
||||
Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Hi,
|
||||
DAG.getIntPtrConstant(0));
|
||||
Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, NVT, Hi,
|
||||
DAG.getIntPtrConstant(1));
|
||||
}
|
||||
|
||||
if (isSigned)
|
||||
|
Loading…
Reference in New Issue
Block a user