@@ -654,7 +654,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
654
654
// non-optsize case.
655
655
setLoadExtAction(ISD::EXTLOAD, MVT::f64, MVT::f32, Expand);
656
656
657
- // clang-format off
658
657
for (auto VT : { MVT::f32, MVT::f64 }) {
659
658
// Use ANDPD to simulate FABS.
660
659
setOperationAction(ISD::FABS, VT, Custom);
@@ -673,9 +672,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
673
672
setOperationAction(ISD::FSIN , VT, Expand);
674
673
setOperationAction(ISD::FCOS , VT, Expand);
675
674
setOperationAction(ISD::FSINCOS, VT, Expand);
676
- setOperationAction(ISD::FTAN , VT, Expand);
677
675
}
678
- // clang-format on
679
676
680
677
// Half type will be promoted by default.
681
678
setF16Action(MVT::f16, Promote);
@@ -747,19 +744,15 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
747
744
setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
748
745
749
746
// We don't support sin/cos/fmod
750
- // clang-format off
751
747
setOperationAction(ISD::FSIN , MVT::f32, Expand);
752
748
setOperationAction(ISD::FCOS , MVT::f32, Expand);
753
749
setOperationAction(ISD::FSINCOS, MVT::f32, Expand);
754
- setOperationAction(ISD::FTAN , MVT::f32, Expand);
755
- // clang-format on
756
750
757
751
if (UseX87) {
758
752
// Always expand sin/cos functions even though x87 has an instruction.
759
753
setOperationAction(ISD::FSIN, MVT::f64, Expand);
760
754
setOperationAction(ISD::FCOS, MVT::f64, Expand);
761
755
setOperationAction(ISD::FSINCOS, MVT::f64, Expand);
762
- setOperationAction(ISD::FTAN, MVT::f64, Expand);
763
756
}
764
757
} else if (UseX87) {
765
758
// f32 and f64 in x87.
@@ -775,7 +768,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
775
768
setOperationAction(ISD::FSIN , VT, Expand);
776
769
setOperationAction(ISD::FCOS , VT, Expand);
777
770
setOperationAction(ISD::FSINCOS, VT, Expand);
778
- setOperationAction(ISD::FTAN, VT, Expand);
779
771
}
780
772
}
781
773
@@ -842,10 +834,12 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
842
834
}
843
835
844
836
// Always expand sin/cos functions even though x87 has an instruction.
837
+ // clang-format off
845
838
setOperationAction(ISD::FSIN , MVT::f80, Expand);
846
839
setOperationAction(ISD::FCOS , MVT::f80, Expand);
847
840
setOperationAction(ISD::FSINCOS, MVT::f80, Expand);
848
- setOperationAction(ISD::FTAN, MVT::f80, Expand);
841
+ setOperationAction(ISD::FTAN , MVT::f80, Expand);
842
+ // clang-format on
849
843
850
844
setOperationAction(ISD::FFLOOR, MVT::f80, Expand);
851
845
setOperationAction(ISD::FCEIL, MVT::f80, Expand);
@@ -898,13 +892,15 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
898
892
setOperationAction(ISD::FNEG, MVT::f128, Custom);
899
893
setOperationAction(ISD::FCOPYSIGN, MVT::f128, Custom);
900
894
895
+ // clang-format off
901
896
setOperationAction(ISD::FSIN, MVT::f128, LibCall);
902
897
setOperationAction(ISD::STRICT_FSIN, MVT::f128, LibCall);
903
898
setOperationAction(ISD::FCOS, MVT::f128, LibCall);
904
899
setOperationAction(ISD::STRICT_FCOS, MVT::f128, LibCall);
905
900
setOperationAction(ISD::FSINCOS, MVT::f128, LibCall);
906
- setOperationAction(ISD::FTAN, MVT::f128, LibCall);
907
- setOperationAction(ISD::STRICT_FTAN, MVT::f128, LibCall);
901
+ setOperationAction(ISD::FTAN, MVT::f128, LibCall);
902
+ setOperationAction(ISD::STRICT_FTAN, MVT::f128, LibCall);
903
+ // clang-format on
908
904
// No STRICT_FSINCOS
909
905
setOperationAction(ISD::FSQRT, MVT::f128, LibCall);
910
906
setOperationAction(ISD::STRICT_FSQRT, MVT::f128, LibCall);
@@ -956,10 +952,11 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
956
952
for (auto VT : { MVT::v8f16, MVT::v16f16, MVT::v32f16,
957
953
MVT::v4f32, MVT::v8f32, MVT::v16f32,
958
954
MVT::v2f64, MVT::v4f64, MVT::v8f64 }) {
955
+ // clang-format off
959
956
setOperationAction(ISD::FSIN, VT, Expand);
960
957
setOperationAction(ISD::FSINCOS, VT, Expand);
961
958
setOperationAction(ISD::FCOS, VT, Expand);
962
- setOperationAction(ISD::FTAN, VT, Expand);
959
+ setOperationAction(ISD::FTAN, VT, Expand);
963
960
setOperationAction(ISD::FREM, VT, Expand);
964
961
setOperationAction(ISD::FCOPYSIGN, VT, Expand);
965
962
setOperationAction(ISD::FPOW, VT, Expand);
@@ -969,6 +966,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
969
966
setOperationAction(ISD::FEXP, VT, Expand);
970
967
setOperationAction(ISD::FEXP2, VT, Expand);
971
968
setOperationAction(ISD::FEXP10, VT, Expand);
969
+ // clang-format on
972
970
}
973
971
974
972
// First set operation action for all vector types to either promote
@@ -2486,14 +2484,21 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
2486
2484
// function casting to f64 and calling `fmod`.
2487
2485
if (Subtarget.is32Bit() &&
2488
2486
(Subtarget.isTargetWindowsMSVC() || Subtarget.isTargetWindowsItanium()))
2489
- for (ISD::NodeType Op :
2490
- {ISD::FCEIL, ISD::STRICT_FCEIL, ISD::FCOS, ISD::STRICT_FCOS,
2491
- ISD::FEXP, ISD::STRICT_FEXP, ISD::FFLOOR, ISD::STRICT_FFLOOR,
2492
- ISD::FREM, ISD::STRICT_FREM, ISD::FLOG, ISD::STRICT_FLOG,
2493
- ISD::FLOG10, ISD::STRICT_FLOG10, ISD::FPOW, ISD::STRICT_FPOW,
2494
- ISD::FSIN, ISD::STRICT_FSIN, ISD::FTAN, ISD::STRICT_FTAN})
2487
+ // clang-format off
2488
+ for (ISD::NodeType Op :
2489
+ {ISD::FCEIL, ISD::STRICT_FCEIL,
2490
+ ISD::FCOS, ISD::STRICT_FCOS,
2491
+ ISD::FEXP, ISD::STRICT_FEXP,
2492
+ ISD::FFLOOR, ISD::STRICT_FFLOOR,
2493
+ ISD::FREM, ISD::STRICT_FREM,
2494
+ ISD::FLOG, ISD::STRICT_FLOG,
2495
+ ISD::FLOG10, ISD::STRICT_FLOG10,
2496
+ ISD::FPOW, ISD::STRICT_FPOW,
2497
+ ISD::FSIN, ISD::STRICT_FSIN,
2498
+ ISD::FTAN, ISD::STRICT_FTAN})
2495
2499
if (isOperationExpand(Op, MVT::f32))
2496
2500
setOperationAction(Op, MVT::f32, Promote);
2501
+ // clang-format on
2497
2502
2498
2503
// We have target-specific dag combine patterns for the following nodes:
2499
2504
setTargetDAGCombine({ISD::VECTOR_SHUFFLE,
0 commit comments