In #6413 we added implementations of lgamma() and tgamma() to special_math.cpp, powered by Boost.Math, as workarounds for their unavailability as compiler builtins, due to LLVM libc math not yet implementing them.
|
[[nodiscard]] _CRT_SATELLITE_2 double __stdcall __std_smf_lgamma(const double _Px) noexcept { |
|
if (_STD isnan(_Px)) { |
|
return _Px; |
|
} |
|
|
|
// TRANSITION, investigate handling C23 7.12.1 "Treatment of error conditions" and 7.12.8.3 "The lgamma functions". |
|
return _Boost_call([=] { return ::boost::math::lgamma(_Px); }); |
|
} |
|
|
|
[[nodiscard]] _CRT_SATELLITE_2 float __stdcall __std_smf_lgammaf(const float _Px) noexcept { |
|
if (_STD isnan(_Px)) { |
|
return _Px; |
|
} |
|
|
|
// TRANSITION, investigate handling C23 7.12.1 "Treatment of error conditions" and 7.12.8.3 "The lgamma functions". |
|
return _Boost_call([=] { return ::boost::math::lgamma(_Px); }); |
|
} |
|
[[nodiscard]] _CRT_SATELLITE_2 double __stdcall __std_smf_tgamma(const double _Px) noexcept { |
|
if (_STD isnan(_Px)) { |
|
return _Px; |
|
} |
|
|
|
// TRANSITION, investigate handling C23 7.12.1 "Treatment of error conditions" and 7.12.8.4 "The tgamma functions". |
|
return _Boost_call([=] { return ::boost::math::tgamma(_Px); }); |
|
} |
|
|
|
[[nodiscard]] _CRT_SATELLITE_2 float __stdcall __std_smf_tgammaf(const float _Px) noexcept { |
|
if (_STD isnan(_Px)) { |
|
return _Px; |
|
} |
|
|
|
// TRANSITION, investigate handling C23 7.12.1 "Treatment of error conditions" and 7.12.8.4 "The tgamma functions". |
|
return _Boost_call([=] { return ::boost::math::tgamma(_Px); }); |
|
} |
C23 7.12.1 "Treatment of error conditions", 7.12.8.3 "The lgamma functions", and 7.12.8.4 "The tgamma functions" appear to specify different behavior than what we're currently doing, which we should investigate.
This will become moot if LLVM libc implements lgamma() and tgamma() so MSVC can pick up these builtins.
In #6413 we added implementations of
lgamma()andtgamma()tospecial_math.cpp, powered by Boost.Math, as workarounds for their unavailability as compiler builtins, due to LLVM libc math not yet implementing them.STL/stl/src/special_math.cpp
Lines 412 to 428 in fbb868b
STL/stl/src/special_math.cpp
Lines 499 to 515 in fbb868b
C23 7.12.1 "Treatment of error conditions", 7.12.8.3 "The lgamma functions", and 7.12.8.4 "The tgamma functions" appear to specify different behavior than what we're currently doing, which we should investigate.
This will become moot if LLVM libc implements
lgamma()andtgamma()so MSVC can pick up these builtins.