@@ -25,52 +25,53 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
25
25
for (int LC = 0 ; LC < RTLIB::UNKNOWN_LIBCALL; ++LC)
26
26
setLibcallCallingConv ((RTLIB::Libcall)LC, CallingConv::C);
27
27
28
- // Use the f128 variants of math functions on x86_64
29
- if (TT.getArch () == Triple::ArchType::x86_64 && TT.isGNUEnvironment ()) {
30
- setLibcallName (RTLIB::REM_F128, " fmodf128" );
31
- setLibcallName (RTLIB::FMA_F128, " fmaf128" );
32
- setLibcallName (RTLIB::SQRT_F128, " sqrtf128" );
33
- setLibcallName (RTLIB::CBRT_F128, " cbrtf128" );
34
- setLibcallName (RTLIB::LOG_F128, " logf128" );
35
- setLibcallName (RTLIB::LOG_FINITE_F128, " __logf128_finite" );
36
- setLibcallName (RTLIB::LOG2_F128, " log2f128" );
37
- setLibcallName (RTLIB::LOG2_FINITE_F128, " __log2f128_finite" );
38
- setLibcallName (RTLIB::LOG10_F128, " log10f128" );
39
- setLibcallName (RTLIB::LOG10_FINITE_F128, " __log10f128_finite" );
40
- setLibcallName (RTLIB::EXP_F128, " expf128" );
41
- setLibcallName (RTLIB::EXP_FINITE_F128, " __expf128_finite" );
42
- setLibcallName (RTLIB::EXP2_F128, " exp2f128" );
43
- setLibcallName (RTLIB::EXP2_FINITE_F128, " __exp2f128_finite" );
44
- setLibcallName (RTLIB::EXP10_F128, " exp10f128" );
45
- setLibcallName (RTLIB::SIN_F128, " sinf128" );
46
- setLibcallName (RTLIB::COS_F128, " cosf128" );
47
- setLibcallName (RTLIB::TAN_F128, " tanf128" );
48
- setLibcallName (RTLIB::SINCOS_F128, " sincosf128" );
49
- setLibcallName (RTLIB::ASIN_F128, " asinf128" );
50
- setLibcallName (RTLIB::ACOS_F128, " acosf128" );
51
- setLibcallName (RTLIB::ATAN_F128, " atanf128" );
52
- setLibcallName (RTLIB::ATAN2_F128, " atan2f128" );
53
- setLibcallName (RTLIB::SINH_F128, " sinhf128" );
54
- setLibcallName (RTLIB::COSH_F128, " coshf128" );
55
- setLibcallName (RTLIB::TANH_F128, " tanhf128" );
56
- setLibcallName (RTLIB::POW_F128, " powf128" );
57
- setLibcallName (RTLIB::POW_FINITE_F128, " __powf128_finite" );
58
- setLibcallName (RTLIB::CEIL_F128, " ceilf128" );
59
- setLibcallName (RTLIB::TRUNC_F128, " truncf128" );
60
- setLibcallName (RTLIB::RINT_F128, " rintf128" );
61
- setLibcallName (RTLIB::NEARBYINT_F128, " nearbyintf128" );
62
- setLibcallName (RTLIB::ROUND_F128, " roundf128" );
63
- setLibcallName (RTLIB::ROUNDEVEN_F128, " roundevenf128" );
64
- setLibcallName (RTLIB::FLOOR_F128, " floorf128" );
65
- setLibcallName (RTLIB::COPYSIGN_F128, " copysignf128" );
66
- setLibcallName (RTLIB::FMIN_F128, " fminf128" );
67
- setLibcallName (RTLIB::FMAX_F128, " fmaxf128" );
68
- setLibcallName (RTLIB::LROUND_F128, " lroundf128" );
69
- setLibcallName (RTLIB::LLROUND_F128, " llroundf128" );
70
- setLibcallName (RTLIB::LRINT_F128, " lrintf128" );
71
- setLibcallName (RTLIB::LLRINT_F128, " llrintf128" );
72
- setLibcallName (RTLIB::LDEXP_F128, " ldexpf128" );
73
- setLibcallName (RTLIB::FREXP_F128, " frexpf128" );
28
+ // The long double version of library functions is more common than the
29
+ // f128-specific version. Use these if that is the long double type on the
30
+ // platform, or if the frontend specifies.
31
+ if (TT.isLongDoubleF128 (" " )) {
32
+ setLibcallName (RTLIB::ACOS_F128, " acosl" );
33
+ setLibcallName (RTLIB::ASIN_F128, " asinl" );
34
+ setLibcallName (RTLIB::ATAN2_F128," atan2l" );
35
+ setLibcallName (RTLIB::ATAN_F128," atanl" );
36
+ setLibcallName (RTLIB::CBRT_F128, " cbrtl" );
37
+ setLibcallName (RTLIB::CEIL_F128, " ceill" );
38
+ setLibcallName (RTLIB::COPYSIGN_F128, " copysignl" );
39
+ setLibcallName (RTLIB::COSH_F128, " coshl" );
40
+ setLibcallName (RTLIB::COS_F128, " cosl" );
41
+ setLibcallName (RTLIB::EXP10_F128, " exp10l" );
42
+ setLibcallName (RTLIB::EXP2_F128, " exp2l" );
43
+ setLibcallName (RTLIB::EXP_F128, " expl" );
44
+ setLibcallName (RTLIB::FLOOR_F128, " floorl" );
45
+ setLibcallName (RTLIB::FMAXIMUMNUM_F128, " fmaximum_numl" );
46
+ setLibcallName (RTLIB::FMAXIMUM_F128, " fmaximuml" );
47
+ setLibcallName (RTLIB::FMAX_F128, " fmaxl" );
48
+ setLibcallName (RTLIB::FMA_F128, " fmal" );
49
+ setLibcallName (RTLIB::FMINIMUMNUM_F128, " fminimum_numl" );
50
+ setLibcallName (RTLIB::FMINIMUM_F128, " fminimuml" );
51
+ setLibcallName (RTLIB::FMIN_F128, " fminl" );
52
+ setLibcallName (RTLIB::FREXP_F128, " frexpl" );
53
+ setLibcallName (RTLIB::LDEXP_F128, " ldexpl" );
54
+ setLibcallName (RTLIB::LLRINT_F128, " llrintl" );
55
+ setLibcallName (RTLIB::LLROUND_F128, " llroundl" );
56
+ setLibcallName (RTLIB::LOG10_F128, " log10l" );
57
+ setLibcallName (RTLIB::LOG2_F128, " log2l" );
58
+ setLibcallName (RTLIB::LOG_F128, " logl" );
59
+ setLibcallName (RTLIB::LRINT_F128, " lrintl" );
60
+ setLibcallName (RTLIB::LROUND_F128, " lroundl" );
61
+ setLibcallName (RTLIB::MODF_F128, " modfl" );
62
+ setLibcallName (RTLIB::NEARBYINT_F128, " nearbyintl" );
63
+ setLibcallName (RTLIB::POW_F128, " powl" );
64
+ setLibcallName (RTLIB::REM_F128, " fmodl" );
65
+ setLibcallName (RTLIB::RINT_F128, " rintl" );
66
+ setLibcallName (RTLIB::ROUNDEVEN_F128, " roundevenl" );
67
+ setLibcallName (RTLIB::ROUND_F128, " roundl" );
68
+ setLibcallName (RTLIB::SINCOSPI_F128, " sincospil" );
69
+ setLibcallName (RTLIB::SINH_F128, " sinhl" );
70
+ setLibcallName (RTLIB::SIN_F128, " sinl" );
71
+ setLibcallName (RTLIB::SQRT_F128, " sqrtl" );
72
+ setLibcallName (RTLIB::TANH_F128," tanhl" );
73
+ setLibcallName (RTLIB::TAN_F128," tanl" );
74
+ setLibcallName (RTLIB::TRUNC_F128, " truncl" );
74
75
}
75
76
76
77
// For IEEE quad-precision libcall names, PPC uses "kf" instead of "tf".
@@ -177,7 +178,6 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
177
178
setLibcallName (RTLIB::SINCOS_F32, " sincosf" );
178
179
setLibcallName (RTLIB::SINCOS_F64, " sincos" );
179
180
setLibcallName (RTLIB::SINCOS_F80, " sincosl" );
180
- setLibcallName (RTLIB::SINCOS_F128, " sincosl" );
181
181
setLibcallName (RTLIB::SINCOS_PPCF128, " sincosl" );
182
182
}
183
183
0 commit comments