Skip to content

Commit 94234cb

Browse files
Addressed the review comments2
1 parent 91d2f89 commit 94234cb

File tree

3 files changed

+15
-31
lines changed

3 files changed

+15
-31
lines changed

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5456,37 +5456,6 @@ void X86DAGToDAGISel::Select(SDNode *Node) {
54565456
break;
54575457
}
54585458

5459-
case X86ISD::FP_TO_SINT_SAT:
5460-
case X86ISD::FP_TO_UINT_SAT: {
5461-
assert(Subtarget->hasAVX10_2() && "Unsupported node");
5462-
bool IsSigned = Node->getOpcode() == X86ISD::FP_TO_SINT_SAT;
5463-
SDValue Op = Node->getOperand(0);
5464-
EVT VT = Node->getValueType(0);
5465-
EVT OpVT = Op.getValueType();
5466-
MachineSDNode *MachineNode;
5467-
5468-
if (VT == MVT::v4i32 && OpVT == MVT::v4f32) {
5469-
if (IsSigned)
5470-
MachineNode =
5471-
CurDAG->getMachineNode(X86::VCVTTPD2DQSZ128rr, dl, MVT::v4i32, Op);
5472-
else
5473-
MachineNode =
5474-
CurDAG->getMachineNode(X86::VCVTTPD2UDQSZ128rr, dl, MVT::v4i32, Op);
5475-
}
5476-
5477-
if ((VT == MVT::v2i64 && OpVT == MVT::v2f64)) {
5478-
if (IsSigned)
5479-
MachineNode =
5480-
CurDAG->getMachineNode(X86::VCVTTPS2QQSZ128rr, dl, MVT::v2i64, Op);
5481-
else
5482-
MachineNode =
5483-
CurDAG->getMachineNode(X86::VCVTTPS2UQQSZ128rr, dl, MVT::v2i64, Op);
5484-
}
5485-
5486-
SDValue NewNode = SDValue(MachineNode, 0);
5487-
ReplaceNode(Node, NewNode.getNode());
5488-
return;
5489-
}
54905459
case X86ISD::ANDNP:
54915460
if (tryVPTERNLOG(Node))
54925461
return;

llvm/lib/Target/X86/X86InstrAVX10.td

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,8 @@ let Predicates = [HasAVX10_2] in {
835835
// Patterns VCVTTPD2DQSZ128
836836

837837
// VCVTTPD2DQS
838+
def : Pat<(v4i32(X86fp2sisat(v4f32 VR128X:$src))),
839+
(VCVTTPD2DQSZ128rr VR128X:$src)>;
838840
def : Pat<(v4i32(fp_to_sint_sat(v4f64 VR256X:$src), i32)),
839841
(VCVTTPD2DQSZ256rr VR256X:$src)>;
840842
def : Pat<(v8i32(fp_to_sint_sat(v8f64 VR512:$src), i32)),
@@ -849,6 +851,8 @@ def : Pat<(v8i64(fp_to_sint_sat(v8f64 VR512:$src), i64)),
849851
(VCVTTPD2QQSZrr VR512:$src)>;
850852

851853
// VCVTTPD2UDQS
854+
def : Pat<(v4i32(X86fp2uisat(v4f32 VR128X:$src))),
855+
(VCVTTPD2UDQSZ128rr VR128X:$src)>;
852856
def : Pat<(v4i32(fp_to_uint_sat(v4f64 VR256X:$src), i32)),
853857
(VCVTTPD2UDQSZ256rr VR256X:$src)>;
854858
def : Pat<(v8i32(fp_to_uint_sat(v8f64 VR512:$src), i32)),
@@ -871,6 +875,8 @@ def : Pat<(v16i32(fp_to_sint_sat(v16f32 VR512:$src), i32)),
871875
(VCVTTPS2DQSZrr VR512:$src)>;
872876

873877
// VCVTTPS2QQS
878+
def : Pat<(v2i64(X86fp2sisat(v2f64 VR128X:$src))),
879+
(VCVTTPS2QQSZ128rr VR128X:$src)>;
874880
def : Pat<(v4i64(fp_to_sint_sat(v4f32 VR128X:$src), i64)),
875881
(VCVTTPS2QQSZ256rr VR128X:$src)>;
876882
def : Pat<(v8i64(fp_to_sint_sat(v8f32 VR256X:$src), i64)),
@@ -885,6 +891,8 @@ def : Pat<(v16i32(fp_to_uint_sat(v16f32 VR512:$src), i32)),
885891
(VCVTTPS2UDQSZrr VR512:$src)>;
886892

887893
// VCVTTPS2UQQS
894+
def : Pat<(v2i64(X86fp2uisat(v2f64 VR128X:$src))),
895+
(VCVTTPS2UQQSZ128rr VR128X:$src)>;
888896
def : Pat<(v4i64(fp_to_uint_sat(v4f32 VR128X:$src), i64)),
889897
(VCVTTPS2UQQSZ256rr VR128X:$src)>;
890898
def : Pat<(v8i64(fp_to_uint_sat(v8f32 VR256X:$src), i64)),

llvm/lib/Target/X86/X86InstrFragmentsSIMD.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ def SDTFmaRound : SDTypeProfile<1, 4, [SDTCisSameAs<0,1>,
390390
SDTCisSameAs<1,2>, SDTCisSameAs<1,3>,
391391
SDTCisFP<0>, SDTCisVT<4, i32>]>;
392392

393+
def SDTFPToxIntSatOp
394+
: SDTypeProfile<1,
395+
1, [SDTCisVec<0>, SDTCisVec<1>, SDTCisInt<0>, SDTCisFP<1>]>;
396+
397+
def X86fp2sisat : SDNode<"X86ISD::FP_TO_SINT_SAT", SDTFPToxIntSatOp>;
398+
def X86fp2uisat : SDNode<"X86ISD::FP_TO_UINT_SAT", SDTFPToxIntSatOp>;
399+
393400
def X86PAlignr : SDNode<"X86ISD::PALIGNR",
394401
SDTypeProfile<1, 3, [SDTCVecEltisVT<0, i8>,
395402
SDTCisSameAs<0,1>,

0 commit comments

Comments
 (0)