@@ -405,17 +405,19 @@ def MIPS16_RET_DF : RuntimeLibcall;
405405def MIPS16_RET_SC : RuntimeLibcall;
406406def MIPS16_RET_SF : RuntimeLibcall;
407407
408- multiclass LibmLongDoubleLibCall<string libcall_basename = !toupper(NAME),
409- string rtbasename = NAME> {
408+ multiclass LibmLongDoubleLibCall<string libcall_basename = !toupper(!substr(NAME, 0, !sub(!size(NAME), 1))),
409+ string rtname = NAME> {
410+
411+
410412 def NAME#"_f128"
411413 : RuntimeLibcallImpl<!cast<RuntimeLibcall>(libcall_basename#"_F128"),
412- !strconcat(rtbasename, "l") >;
414+ rtname >;
413415 def NAME#"_ppcf128"
414416 : RuntimeLibcallImpl<!cast<RuntimeLibcall>(libcall_basename#"_PPCF128"),
415- !strconcat(rtbasename, "l") >;
417+ rtname >;
416418 def NAME#"_f80"
417419 : RuntimeLibcallImpl<!cast<RuntimeLibcall>(libcall_basename#"_F80"),
418- !strconcat(rtbasename, "l") >;
420+ rtname >;
419421}
420422
421423// AArch64 calls
@@ -765,19 +767,19 @@ def fmodl_ppc128 : RuntimeLibcallImpl<REM_PPCF128, "fmodl">;
765767
766768def fmaf : RuntimeLibcallImpl<FMA_F32>;
767769def fma : RuntimeLibcallImpl<FMA_F64>;
768- defm fma : LibmLongDoubleLibCall;
770+ defm fmal : LibmLongDoubleLibCall;
769771
770772def sqrtf : RuntimeLibcallImpl<SQRT_F32>;
771773def sqrt : RuntimeLibcallImpl<SQRT_F64>;
772- defm sqrt : LibmLongDoubleLibCall;
774+ defm sqrtl : LibmLongDoubleLibCall;
773775
774776def cbrtf : RuntimeLibcallImpl<CBRT_F32>;
775777def cbrt : RuntimeLibcallImpl<CBRT_F64>;
776- defm cbrt : LibmLongDoubleLibCall;
778+ defm cbrtl : LibmLongDoubleLibCall;
777779
778780def logf : RuntimeLibcallImpl<LOG_F32>;
779781def log : RuntimeLibcallImpl<LOG_F64>;
780- defm log : LibmLongDoubleLibCall;
782+ defm logl : LibmLongDoubleLibCall;
781783
782784def __logf_finite : RuntimeLibcallImpl<LOG_FINITE_F32>;
783785def __log_finite : RuntimeLibcallImpl<LOG_FINITE_F64>;
@@ -787,7 +789,7 @@ def __logl_finite_ppcf128 : RuntimeLibcallImpl<LOG_FINITE_PPCF128, "__logl_finit
787789
788790def log2f : RuntimeLibcallImpl<LOG2_F32>;
789791def log2 : RuntimeLibcallImpl<LOG2_F64>;
790- defm log2 : LibmLongDoubleLibCall;
792+ defm log2l : LibmLongDoubleLibCall;
791793
792794def __log2f_finite : RuntimeLibcallImpl<LOG2_FINITE_F32>;
793795def __log2_finite : RuntimeLibcallImpl<LOG2_FINITE_F64>;
@@ -797,7 +799,7 @@ def __log2l_finite_ppcf128 : RuntimeLibcallImpl<LOG2_FINITE_PPCF128, "__log2l_fi
797799
798800def log10f : RuntimeLibcallImpl<LOG10_F32>;
799801def log10 : RuntimeLibcallImpl<LOG10_F64>;
800- defm log10 : LibmLongDoubleLibCall;
802+ defm log10l : LibmLongDoubleLibCall;
801803
802804def __log10f_finite : RuntimeLibcallImpl<LOG10_FINITE_F32>;
803805def __log10_finite : RuntimeLibcallImpl<LOG10_FINITE_F64>;
@@ -807,7 +809,7 @@ def __log10l_finite_ppcf128 : RuntimeLibcallImpl<LOG10_FINITE_PPCF128, "__log10l
807809
808810def expf : RuntimeLibcallImpl<EXP_F32>;
809811def exp : RuntimeLibcallImpl<EXP_F64>;
810- defm exp : LibmLongDoubleLibCall<"EXP", "exp ">;
812+ defm expl : LibmLongDoubleLibCall<"EXP">;
811813
812814def __expf_finite : RuntimeLibcallImpl<EXP_FINITE_F32>;
813815def __exp_finite : RuntimeLibcallImpl<EXP_FINITE_F64>;
@@ -817,7 +819,7 @@ def __expl_finite_ppcf128 : RuntimeLibcallImpl<EXP_FINITE_PPCF128, "__expl_finit
817819
818820def exp2f : RuntimeLibcallImpl<EXP2_F32>;
819821def exp2 : RuntimeLibcallImpl<EXP2_F64>;
820- defm exp2 : LibmLongDoubleLibCall<"EXP2", "exp2 ">;
822+ defm exp2l : LibmLongDoubleLibCall<"EXP2">;
821823
822824def __exp2f_finite : RuntimeLibcallImpl<EXP2_FINITE_F32>;
823825def __exp2_finite : RuntimeLibcallImpl<EXP2_FINITE_F64>;
@@ -827,47 +829,47 @@ def __exp2l_finite_ppcf128 : RuntimeLibcallImpl<EXP2_FINITE_PPCF128, "__exp2l_fi
827829
828830def sinf : RuntimeLibcallImpl<SIN_F32>;
829831def sin : RuntimeLibcallImpl<SIN_F64>;
830- defm sin : LibmLongDoubleLibCall;
832+ defm sinl : LibmLongDoubleLibCall;
831833
832834def cosf : RuntimeLibcallImpl<COS_F32>;
833835def cos : RuntimeLibcallImpl<COS_F64>;
834- defm cos : LibmLongDoubleLibCall;
836+ defm cosl : LibmLongDoubleLibCall;
835837
836838def tanf : RuntimeLibcallImpl<TAN_F32>;
837839def tan : RuntimeLibcallImpl<TAN_F64>;
838- defm tan : LibmLongDoubleLibCall;
840+ defm tanl : LibmLongDoubleLibCall;
839841
840842def sinhf : RuntimeLibcallImpl<SINH_F32>;
841843def sinh : RuntimeLibcallImpl<SINH_F64>;
842- defm sinh : LibmLongDoubleLibCall;
844+ defm sinhl : LibmLongDoubleLibCall;
843845
844846def coshf : RuntimeLibcallImpl<COSH_F32>;
845847def cosh : RuntimeLibcallImpl<COSH_F64>;
846- defm cosh : LibmLongDoubleLibCall;
848+ defm coshl : LibmLongDoubleLibCall;
847849
848850def tanhf : RuntimeLibcallImpl<TANH_F32>;
849851def tanh : RuntimeLibcallImpl<TANH_F64>;
850- defm tanh : LibmLongDoubleLibCall;
852+ defm tanhl : LibmLongDoubleLibCall;
851853
852854def asinf : RuntimeLibcallImpl<ASIN_F32>;
853855def asin : RuntimeLibcallImpl<ASIN_F64>;
854- defm asin : LibmLongDoubleLibCall;
856+ defm asinl : LibmLongDoubleLibCall;
855857
856858def acosf : RuntimeLibcallImpl<ACOS_F32>;
857859def acos : RuntimeLibcallImpl<ACOS_F64>;
858- defm acos : LibmLongDoubleLibCall;
860+ defm acosl : LibmLongDoubleLibCall;
859861
860862def atanf : RuntimeLibcallImpl<ATAN_F32>;
861863def atan : RuntimeLibcallImpl<ATAN_F64>;
862- defm atan : LibmLongDoubleLibCall;
864+ defm atanl : LibmLongDoubleLibCall;
863865
864866def atan2f : RuntimeLibcallImpl<ATAN2_F32>;
865867def atan2 : RuntimeLibcallImpl<ATAN2_F64>;
866- defm atan2 : LibmLongDoubleLibCall;
868+ defm atan2l : LibmLongDoubleLibCall;
867869
868870def powf : RuntimeLibcallImpl<POW_F32>;
869871def pow : RuntimeLibcallImpl<POW_F64>;
870- defm pow : LibmLongDoubleLibCall;
872+ defm powl : LibmLongDoubleLibCall;
871873
872874def __powf_finite : RuntimeLibcallImpl<POW_FINITE_F32>;
873875def __pow_finite : RuntimeLibcallImpl<POW_FINITE_F64>;
@@ -877,91 +879,91 @@ def __powl_finite_ppcf128 : RuntimeLibcallImpl<POW_FINITE_PPCF128, "__powl_finit
877879
878880def ceilf : RuntimeLibcallImpl<CEIL_F32>;
879881def ceil : RuntimeLibcallImpl<CEIL_F64>;
880- defm ceil : LibmLongDoubleLibCall;
882+ defm ceill : LibmLongDoubleLibCall;
881883
882884def truncf : RuntimeLibcallImpl<TRUNC_F32>;
883885def trunc : RuntimeLibcallImpl<TRUNC_F64>;
884- defm trunc : LibmLongDoubleLibCall;
886+ defm truncl : LibmLongDoubleLibCall;
885887
886888def rintf : RuntimeLibcallImpl<RINT_F32>;
887889def rint : RuntimeLibcallImpl<RINT_F64>;
888- defm rint : LibmLongDoubleLibCall;
890+ defm rintl : LibmLongDoubleLibCall;
889891
890892def nearbyintf : RuntimeLibcallImpl<NEARBYINT_F32>;
891893def nearbyint : RuntimeLibcallImpl<NEARBYINT_F64>;
892- defm nearbyint : LibmLongDoubleLibCall;
894+ defm nearbyintl : LibmLongDoubleLibCall;
893895
894896def roundf : RuntimeLibcallImpl<ROUND_F32>;
895897def round : RuntimeLibcallImpl<ROUND_F64>;
896- defm round : LibmLongDoubleLibCall;
898+ defm roundl : LibmLongDoubleLibCall;
897899
898900def roundevenf : RuntimeLibcallImpl<ROUNDEVEN_F32>;
899901def roundeven : RuntimeLibcallImpl<ROUNDEVEN_F64>;
900- defm roundeven : LibmLongDoubleLibCall;
902+ defm roundevenl : LibmLongDoubleLibCall;
901903
902904def floorf : RuntimeLibcallImpl<FLOOR_F32>;
903905def floor : RuntimeLibcallImpl<FLOOR_F64>;
904- defm floor : LibmLongDoubleLibCall;
906+ defm floorl : LibmLongDoubleLibCall;
905907
906908def copysignf : RuntimeLibcallImpl<COPYSIGN_F32>;
907909def copysign : RuntimeLibcallImpl<COPYSIGN_F64>;
908- defm copysign : LibmLongDoubleLibCall;
910+ defm copysignl : LibmLongDoubleLibCall;
909911
910912def fminf : RuntimeLibcallImpl<FMIN_F32>;
911913def fmin : RuntimeLibcallImpl<FMIN_F64>;
912- defm fmin : LibmLongDoubleLibCall;
914+ defm fminl : LibmLongDoubleLibCall;
913915
914916def fmaxf : RuntimeLibcallImpl<FMAX_F32>;
915917def fmax : RuntimeLibcallImpl<FMAX_F64>;
916- defm fmax : LibmLongDoubleLibCall;
918+ defm fmaxl : LibmLongDoubleLibCall;
917919
918920def fminimumf : RuntimeLibcallImpl<FMINIMUM_F32>;
919921def fminimum : RuntimeLibcallImpl<FMINIMUM_F64>;
920- defm fminimum : LibmLongDoubleLibCall;
922+ defm fminimuml : LibmLongDoubleLibCall;
921923
922924def fmaximumf : RuntimeLibcallImpl<FMAXIMUM_F32>;
923925def fmaximum : RuntimeLibcallImpl<FMAXIMUM_F64>;
924- defm fmaximum : LibmLongDoubleLibCall;
926+ defm fmaximuml : LibmLongDoubleLibCall;
925927
926928def fminimum_numf : RuntimeLibcallImpl<FMINIMUM_NUM_F32>;
927929def fminimum_num : RuntimeLibcallImpl<FMINIMUM_NUM_F64>;
928- defm fminimum_num : LibmLongDoubleLibCall;
930+ defm fminimum_numl : LibmLongDoubleLibCall;
929931
930932def fmaximum_numf : RuntimeLibcallImpl<FMAXIMUM_NUM_F32>;
931933def fmaximum_num : RuntimeLibcallImpl<FMAXIMUM_NUM_F64>;
932- defm fmaximum_num : LibmLongDoubleLibCall;
934+ defm fmaximum_numl : LibmLongDoubleLibCall;
933935
934936def lroundf : RuntimeLibcallImpl<LROUND_F32>;
935937def lround : RuntimeLibcallImpl<LROUND_F64>;
936- defm lround : LibmLongDoubleLibCall;
938+ defm lroundl : LibmLongDoubleLibCall;
937939
938940def llroundf : RuntimeLibcallImpl<LLROUND_F32>;
939941def llround : RuntimeLibcallImpl<LLROUND_F64>;
940- defm llround : LibmLongDoubleLibCall;
942+ defm llroundl : LibmLongDoubleLibCall;
941943
942944def lrintf : RuntimeLibcallImpl<LRINT_F32>;
943945def lrint : RuntimeLibcallImpl<LRINT_F64>;
944- defm lrint : LibmLongDoubleLibCall;
946+ defm lrintl : LibmLongDoubleLibCall;
945947
946948def llrintf : RuntimeLibcallImpl<LLRINT_F32>;
947949def llrint : RuntimeLibcallImpl<LLRINT_F64>;
948- defm llrint : LibmLongDoubleLibCall;
950+ defm llrintl : LibmLongDoubleLibCall;
949951
950952def ldexpf : RuntimeLibcallImpl<LDEXP_F32>;
951953def ldexp : RuntimeLibcallImpl<LDEXP_F64>;
952- defm ldexp : LibmLongDoubleLibCall;
954+ defm ldexpl : LibmLongDoubleLibCall;
953955
954956def frexpf : RuntimeLibcallImpl<FREXP_F32>;
955957def frexp : RuntimeLibcallImpl<FREXP_F64>;
956- defm frexp : LibmLongDoubleLibCall;
958+ defm frexpl : LibmLongDoubleLibCall;
957959
958960def sincospif : RuntimeLibcallImpl<SINCOSPI_F32>;
959961def sincospi : RuntimeLibcallImpl<SINCOSPI_F64>;
960- defm sincospi : LibmLongDoubleLibCall;
962+ defm sincospil : LibmLongDoubleLibCall;
961963
962964def modff : RuntimeLibcallImpl<MODF_F32>;
963965def modf : RuntimeLibcallImpl<MODF_F64>;
964- defm modf : LibmLongDoubleLibCall;
966+ defm modfl : LibmLongDoubleLibCall;
965967
966968// Floating point environment
967969def fegetenv : RuntimeLibcallImpl<FEGETENV>;
@@ -1033,7 +1035,7 @@ def __sincos_stret : RuntimeLibcallImpl<SINCOS_STRET_F64>;
10331035
10341036def sincosf : RuntimeLibcallImpl<SINCOS_F32>;
10351037def sincos : RuntimeLibcallImpl<SINCOS_F64>;
1036- defm sincos : LibmLongDoubleLibCall;
1038+ defm sincosl : LibmLongDoubleLibCall;
10371039
10381040def bzero : RuntimeLibcallImpl<BZERO>;
10391041def __bzero : RuntimeLibcallImpl<BZERO>;
@@ -1198,9 +1200,9 @@ defvar SecurityCheckCookieIfWinMSVC =
11981200
11991201defvar LibmHasSinCosF32 = LibcallImpls<(add sincosf), hasSinCos>;
12001202defvar LibmHasSinCosF64 = LibcallImpls<(add sincos), hasSinCos>;
1201- defvar LibmHasSinCosF80 = LibcallImpls<(add sincos_f80 ), hasSinCos>;
1202- defvar LibmHasSinCosF128 = LibcallImpls<(add sincos_f128 ), hasSinCos>;
1203- defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincos_ppcf128 ), hasSinCos>;
1203+ defvar LibmHasSinCosF80 = LibcallImpls<(add sincosl_f80 ), hasSinCos>;
1204+ defvar LibmHasSinCosF128 = LibcallImpls<(add sincosl_f128 ), hasSinCos>;
1205+ defvar LibmHasSinCosPPCF128 = LibcallImpls<(add sincosl_ppcf128 ), hasSinCos>;
12041206
12051207defvar LibmHasExp10F32 = LibcallImpls<(add exp10f), hasExp10>;
12061208defvar LibmHasExp10F64 = LibcallImpls<(add exp10), hasExp10>;
@@ -1214,8 +1216,8 @@ defvar DefaultLibmExp10 = [
12141216
12151217
12161218defvar WindowsMathRemovals = [
1217- ldexpf, ldexp_f80, ldexp_f128, ldexp_ppcf128 ,
1218- frexpf, frexp_f80, frexp_f128, frexp_ppcf128
1219+ ldexpf, ldexpl_f80, ldexpl_f128, ldexpl_ppcf128 ,
1220+ frexpf, frexpl_f80, frexpl_f128, frexpl_ppcf128
12191221];
12201222
12211223defvar MostPowI = !listremove(PowiLibcallImpls, [__powitf2_f128, __powitf2_ppc128]);
@@ -1233,11 +1235,11 @@ defvar WinDefaultLibcallImpls = (add WinDefaultLibcallImplsBaseList,
12331235defvar LibmHasFrexpF32 = LibcallImpls<(add frexpf), isNotOSWindowsOrIsCygwinMinGW>;
12341236defvar LibmHasLdexpF32 = LibcallImpls<(add ldexpf), isNotOSWindowsOrIsCygwinMinGW>;
12351237
1236- defvar LibmHasFrexpF80 = LibcallImpls<(add frexp_f80 ), isNotOSWindowsOrIsCygwinMinGW>;
1237- defvar LibmHasLdexpF80 = LibcallImpls<(add ldexp_f80 ), isNotOSWindowsOrIsCygwinMinGW>;
1238+ defvar LibmHasFrexpF80 = LibcallImpls<(add frexpl_f80 ), isNotOSWindowsOrIsCygwinMinGW>;
1239+ defvar LibmHasLdexpF80 = LibcallImpls<(add ldexpl_f80 ), isNotOSWindowsOrIsCygwinMinGW>;
12381240
1239- defvar LibmHasFrexpF128 = LibcallImpls<(add frexp_f128 ), isNotOSWindowsOrIsCygwinMinGW>;
1240- defvar LibmHasLdexpF128 = LibcallImpls<(add ldexp_f128 ), isNotOSWindowsOrIsCygwinMinGW>;
1241+ defvar LibmHasFrexpF128 = LibcallImpls<(add frexpl_f128 ), isNotOSWindowsOrIsCygwinMinGW>;
1242+ defvar LibmHasLdexpF128 = LibcallImpls<(add ldexpl_f128 ), isNotOSWindowsOrIsCygwinMinGW>;
12411243
12421244defvar has__stack_chk_fail = LibcallImpls<(add __stack_chk_fail), isNotOSOpenBSD>;
12431245defvar has__stack_chk_guard =
@@ -2459,7 +2461,7 @@ defvar X86CommonLibcalls =
24592461 LibcallImpls<(add __bzero), darwinHas__bzero>,
24602462 LibmHasFrexpF32, LibmHasLdexpF32,
24612463 LibmHasFrexpF80, LibmHasLdexpF80,
2462- LibcallImpls<(add frexp_f128, ldexp_f128 , exp10l_f128), hasExpFrexplLdexplF128>,
2464+ LibcallImpls<(add frexpl_f128, ldexpl_f128 , exp10l_f128), hasExpFrexplLdexplF128>,
24632465 DefaultRuntimeLibcallImpls_f80,
24642466 LibmHasExp10F32, LibmHasExp10F64, LibmHasExp10F80,
24652467 LibcallImpls<(add MostPowI), isNotOSMSVCRT>,
0 commit comments