mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[LegalizeVectorOps] Split most of ExpandStrictFPOp into a separate UnrollStrictFPOp method. Call that method from ExpandUINT_TO_FLOAT.
ExpandStrictFPOp calls ExpandUINT_TO_FLOAT. Previously, ExpandUINT_TO_FLOAT returned SDValue() if it wasn't able to handle and needed to unroll. Then ExpandStrictFPOp would detect his SDValue() and do the unroll. After this change, ExpandUINT_TO_FLOAT will directly call UnrollStrictFPOp and return the unrolled result.
This commit is contained in:
parent
bdc5b287f8
commit
c3e9b9b27d
@ -148,6 +148,8 @@ class VectorLegalizer {
|
|||||||
SDValue ExpandFixedPointMul(SDValue Op);
|
SDValue ExpandFixedPointMul(SDValue Op);
|
||||||
SDValue ExpandStrictFPOp(SDValue Op);
|
SDValue ExpandStrictFPOp(SDValue Op);
|
||||||
|
|
||||||
|
SDValue UnrollStrictFPOp(SDValue Op);
|
||||||
|
|
||||||
/// Implements vector promotion.
|
/// Implements vector promotion.
|
||||||
///
|
///
|
||||||
/// This is essentially just bitcasting the operands to a different type and
|
/// This is essentially just bitcasting the operands to a different type and
|
||||||
@ -1208,8 +1210,11 @@ SDValue VectorLegalizer::ExpandUINT_TO_FLOAT(SDValue Op) {
|
|||||||
TargetLowering::Expand) ||
|
TargetLowering::Expand) ||
|
||||||
(IsStrict && TLI.getOperationAction(ISD::STRICT_SINT_TO_FP, VT) ==
|
(IsStrict && TLI.getOperationAction(ISD::STRICT_SINT_TO_FP, VT) ==
|
||||||
TargetLowering::Expand)) ||
|
TargetLowering::Expand)) ||
|
||||||
TLI.getOperationAction(ISD::SRL, VT) == TargetLowering::Expand)
|
TLI.getOperationAction(ISD::SRL, VT) == TargetLowering::Expand) {
|
||||||
return IsStrict ? SDValue() : DAG.UnrollVectorOp(Op.getNode());
|
if (IsStrict)
|
||||||
|
return UnrollStrictFPOp(Op);
|
||||||
|
return DAG.UnrollVectorOp(Op.getNode());
|
||||||
|
}
|
||||||
|
|
||||||
unsigned BW = VT.getScalarSizeInBits();
|
unsigned BW = VT.getScalarSizeInBits();
|
||||||
assert((BW == 64 || BW == 32) &&
|
assert((BW == 64 || BW == 32) &&
|
||||||
@ -1386,11 +1391,13 @@ SDValue VectorLegalizer::ExpandFixedPointMul(SDValue Op) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDValue VectorLegalizer::ExpandStrictFPOp(SDValue Op) {
|
SDValue VectorLegalizer::ExpandStrictFPOp(SDValue Op) {
|
||||||
if (Op.getOpcode() == ISD::STRICT_UINT_TO_FP) {
|
if (Op.getOpcode() == ISD::STRICT_UINT_TO_FP)
|
||||||
if (SDValue Res = ExpandUINT_TO_FLOAT(Op))
|
return ExpandUINT_TO_FLOAT(Op);
|
||||||
return Res;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return UnrollStrictFPOp(Op);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDValue VectorLegalizer::UnrollStrictFPOp(SDValue Op) {
|
||||||
EVT VT = Op.getValue(0).getValueType();
|
EVT VT = Op.getValue(0).getValueType();
|
||||||
EVT EltVT = VT.getVectorElementType();
|
EVT EltVT = VT.getVectorElementType();
|
||||||
unsigned NumElems = VT.getVectorNumElements();
|
unsigned NumElems = VT.getVectorNumElements();
|
||||||
|
Loading…
Reference in New Issue
Block a user