Skip to content

Commit 46a77e3

Browse files
committed
Rebasing onto similar PR
Change-Id: Icdb7c3742dc30da0652701ffc6c7468b8504e416
1 parent fb775fb commit 46a77e3

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -541,18 +541,15 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
541541
setOperationAction(ISD::STRICT_UINT_TO_FP, MVT::i32, Custom);
542542
setOperationAction(ISD::STRICT_UINT_TO_FP, MVT::i64, Custom);
543543
setOperationAction(ISD::STRICT_UINT_TO_FP, MVT::i128, Custom);
544+
if (Subtarget->hasFPARMv8())
545+
setOperationAction(ISD::FP_ROUND, MVT::f16, Custom);
544546
setOperationAction(ISD::FP_ROUND, MVT::f32, Custom);
545547
setOperationAction(ISD::FP_ROUND, MVT::f64, Custom);
546-
setOperationAction(ISD::STRICT_FP_ROUND, MVT::f16, Custom);
548+
if (Subtarget->hasFPARMv8())
549+
setOperationAction(ISD::STRICT_FP_ROUND, MVT::f16, Custom);
547550
setOperationAction(ISD::STRICT_FP_ROUND, MVT::f32, Custom);
548551
setOperationAction(ISD::STRICT_FP_ROUND, MVT::f64, Custom);
549552

550-
if (Subtarget->hasFPARMv8()) {
551-
setOperationAction(ISD::BITCAST, MVT::i16, Custom);
552-
setOperationAction(ISD::BITCAST, MVT::f16, Custom);
553-
setOperationAction(ISD::BITCAST, MVT::bf16, Custom);
554-
}
555-
556553
setOperationAction(ISD::FP_TO_UINT_SAT, MVT::i32, Custom);
557554
setOperationAction(ISD::FP_TO_UINT_SAT, MVT::i64, Custom);
558555
setOperationAction(ISD::FP_TO_SINT_SAT, MVT::i32, Custom);
@@ -952,9 +949,11 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
952949
setTruncStoreAction(MVT::f128, MVT::f32, Expand);
953950
setTruncStoreAction(MVT::f128, MVT::f16, Expand);
954951

955-
setOperationAction(ISD::BITCAST, MVT::i16, Custom);
956-
setOperationAction(ISD::BITCAST, MVT::f16, Custom);
957-
setOperationAction(ISD::BITCAST, MVT::bf16, Custom);
952+
if (Subtarget->hasFPARMv8()) {
953+
setOperationAction(ISD::BITCAST, MVT::i16, Custom);
954+
setOperationAction(ISD::BITCAST, MVT::f16, Custom);
955+
setOperationAction(ISD::BITCAST, MVT::bf16, Custom);
956+
}
958957

959958
// Indexed loads and stores are supported.
960959
for (unsigned im = (unsigned)ISD::PRE_INC;
@@ -24620,10 +24619,6 @@ void AArch64TargetLowering::ReplaceBITCASTResults(
2462024619
EVT VT = N->getValueType(0);
2462124620
EVT SrcVT = Op.getValueType();
2462224621

24623-
if (!Subtarget->hasFPARMv8() &&
24624-
(SrcVT == MVT::f16 || SrcVT == MVT::i16 || SrcVT == MVT::bf16))
24625-
return;
24626-
2462724622
if (VT == MVT::v2i16 && SrcVT == MVT::i32) {
2462824623
CustomNonLegalBITCASTResults(N, Results, DAG, MVT::v2i32, MVT::v4i16);
2462924624
return;

0 commit comments

Comments
 (0)