Skip to content

Commit 99b4eb6

Browse files
committed
PPC: Custom lower ppcf128 is_fpclass if is_fpclass is custom
Unfortunately expandIS_FPCLASS is called directly in SelectionDAGBuilder depending on whether IS_FPCLASS is custom or not. This helps avoid ppc test regressions in a future patch where the custom lowering would be bypassed.
1 parent a105877 commit 99b4eb6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
12211221
setOperationAction(ISD::IS_FPCLASS, MVT::f32, Custom);
12221222
setOperationAction(ISD::IS_FPCLASS, MVT::f64, Custom);
12231223
setOperationAction(ISD::IS_FPCLASS, MVT::f128, Custom);
1224+
setOperationAction(ISD::IS_FPCLASS, MVT::ppcf128, Custom);
12241225
}
12251226

12261227
// 128 bit shifts can be accomplished via 3 instructions for SHL and
@@ -11479,6 +11480,12 @@ SDValue PPCTargetLowering::LowerIS_FPCLASS(SDValue Op,
1147911480
uint64_t RHSC = Op.getConstantOperandVal(1);
1148011481
SDLoc Dl(Op);
1148111482
FPClassTest Category = static_cast<FPClassTest>(RHSC);
11483+
if (LHS.getValueType() == MVT::ppcf128) {
11484+
// The higher part determines the value class.
11485+
LHS = DAG.getNode(ISD::EXTRACT_ELEMENT, Dl, MVT::f64, LHS,
11486+
DAG.getConstant(1, Dl, MVT::i32));
11487+
}
11488+
1148211489
return getDataClassTest(LHS, Category, Dl, DAG, Subtarget);
1148311490
}
1148411491

0 commit comments

Comments
 (0)