@@ -841,18 +841,21 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
841
841
setOperationPromotedToType(ISD::FRINT, V4Narrow, MVT::v4f32);
842
842
setOperationPromotedToType(ISD::FNEARBYINT, V4Narrow, MVT::v4f32);
843
843
setOperationPromotedToType(ISD::FCANONICALIZE, V4Narrow, MVT::v4f32);
844
+ setOperationPromotedToType(ISD::SETCC, V4Narrow, MVT::v4f32);
844
845
845
846
setOperationAction(ISD::FABS, V4Narrow, Legal);
846
- setOperationAction(ISD::FNEG, V4Narrow, Legal);
847
+ setOperationAction(ISD::FNEG, V4Narrow, Legal);
847
848
setOperationAction(ISD::FMA, V4Narrow, Expand);
848
- setOperationAction(ISD::SETCC, V4Narrow, Custom);
849
849
setOperationAction(ISD::BR_CC, V4Narrow, Expand);
850
850
setOperationAction(ISD::SELECT, V4Narrow, Expand);
851
851
setOperationAction(ISD::SELECT_CC, V4Narrow, Expand);
852
852
setOperationAction(ISD::FCOPYSIGN, V4Narrow, Custom);
853
853
setOperationAction(ISD::FSQRT, V4Narrow, Expand);
854
854
855
855
auto V8Narrow = MVT::getVectorVT(ScalarVT, 8);
856
+ setOperationPromotedToType(ISD::FCANONICALIZE, V8Narrow, MVT::v8f32);
857
+ setOperationPromotedToType(ISD::SETCC, V8Narrow, MVT::v8f32);
858
+
856
859
setOperationAction(ISD::FABS, V8Narrow, Legal);
857
860
setOperationAction(ISD::FADD, V8Narrow, Legal);
858
861
setOperationAction(ISD::FCEIL, V8Narrow, Legal);
@@ -862,19 +865,17 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
862
865
setOperationAction(ISD::FMA, V8Narrow, Expand);
863
866
setOperationAction(ISD::FMUL, V8Narrow, Legal);
864
867
setOperationAction(ISD::FNEARBYINT, V8Narrow, Legal);
865
- setOperationAction(ISD::FNEG, V8Narrow, Legal);
868
+ setOperationAction(ISD::FNEG, V8Narrow, Legal);
866
869
setOperationAction(ISD::FROUND, V8Narrow, Legal);
867
870
setOperationAction(ISD::FROUNDEVEN, V8Narrow, Legal);
868
871
setOperationAction(ISD::FRINT, V8Narrow, Legal);
869
872
setOperationAction(ISD::FSQRT, V8Narrow, Expand);
870
873
setOperationAction(ISD::FSUB, V8Narrow, Legal);
871
874
setOperationAction(ISD::FTRUNC, V8Narrow, Legal);
872
- setOperationAction(ISD::SETCC, V8Narrow, Expand);
873
875
setOperationAction(ISD::BR_CC, V8Narrow, Expand);
874
876
setOperationAction(ISD::SELECT, V8Narrow, Expand);
875
877
setOperationAction(ISD::SELECT_CC, V8Narrow, Expand);
876
878
setOperationAction(ISD::FP_EXTEND, V8Narrow, Expand);
877
- setOperationPromotedToType(ISD::FCANONICALIZE, V8Narrow, MVT::v8f32);
878
879
};
879
880
880
881
if (!Subtarget->hasFullFP16()) {
@@ -15905,6 +15906,11 @@ SDValue AArch64TargetLowering::LowerVSETCC(SDValue Op,
15905
15906
if (LHS.getValueType().getVectorElementType().isInteger())
15906
15907
return Op;
15907
15908
15909
+ assert((!Subtarget->hasFullFP16() &&
15910
+ LHS.getValueType().getVectorElementType() != MVT::f16) ||
15911
+ LHS.getValueType().getVectorElementType() != MVT::bf16 ||
15912
+ LHS.getValueType().getVectorElementType() != MVT::f128);
15913
+
15908
15914
// Lower isnan(x) | isnan(never-nan) to x != x.
15909
15915
// Lower !isnan(x) & !isnan(never-nan) to x == x.
15910
15916
if (CC == ISD::SETUO || CC == ISD::SETO) {
@@ -15923,26 +15929,6 @@ SDValue AArch64TargetLowering::LowerVSETCC(SDValue Op,
15923
15929
}
15924
15930
}
15925
15931
15926
- const bool FullFP16 = DAG.getSubtarget<AArch64Subtarget>().hasFullFP16();
15927
-
15928
- // Make v4f16 (only) fcmp operations utilise vector instructions
15929
- // v8f16 support will be a litle more complicated
15930
- if ((!FullFP16 && LHS.getValueType().getVectorElementType() == MVT::f16) ||
15931
- LHS.getValueType().getVectorElementType() == MVT::bf16) {
15932
- if (LHS.getValueType().getVectorNumElements() == 4) {
15933
- LHS = DAG.getNode(ISD::FP_EXTEND, dl, MVT::v4f32, LHS);
15934
- RHS = DAG.getNode(ISD::FP_EXTEND, dl, MVT::v4f32, RHS);
15935
- SDValue NewSetcc = DAG.getSetCC(dl, MVT::v4i16, LHS, RHS, CC);
15936
- DAG.ReplaceAllUsesWith(Op, NewSetcc);
15937
- CmpVT = MVT::v4i32;
15938
- } else
15939
- return SDValue();
15940
- }
15941
-
15942
- assert((!FullFP16 && LHS.getValueType().getVectorElementType() != MVT::f16) ||
15943
- LHS.getValueType().getVectorElementType() != MVT::bf16 ||
15944
- LHS.getValueType().getVectorElementType() != MVT::f128);
15945
-
15946
15932
// Unfortunately, the mapping of LLVM FP CC's onto AArch64 CC's isn't totally
15947
15933
// clean. Some of them require two branches to implement.
15948
15934
AArch64CC::CondCode CC1, CC2;
0 commit comments