Skip to content

Commit 3e743a5

Browse files
authored
[X86] lowerShuffleAsBitMask - generalize FP handling. (#135345)
Don't explicitly handle f32/f64 cases - allow any fp value type and convert to equivalent int type with MVT::changeTypeToInteger
1 parent 52a3247 commit 3e743a5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10871,12 +10871,11 @@ static SDValue lowerShuffleAsBitMask(const SDLoc &DL, MVT VT, SDValue V1,
1087110871
}
1087210872

1087310873
MVT LogicVT = VT;
10874-
if (EltVT == MVT::f32 || EltVT == MVT::f64) {
10874+
if (EltVT.isFloatingPoint()) {
1087510875
Zero = DAG.getConstantFP(0.0, DL, EltVT);
1087610876
APFloat AllOnesValue = APFloat::getAllOnesValue(EltVT.getFltSemantics());
1087710877
AllOnes = DAG.getConstantFP(AllOnesValue, DL, EltVT);
10878-
LogicVT =
10879-
MVT::getVectorVT(EltVT == MVT::f64 ? MVT::i64 : MVT::i32, Mask.size());
10878+
LogicVT = MVT::getVectorVT(EltVT.changeTypeToInteger(), Mask.size());
1088010879
} else {
1088110880
Zero = DAG.getConstant(0, DL, EltVT);
1088210881
AllOnes = DAG.getAllOnesConstant(DL, EltVT);

0 commit comments

Comments
 (0)