Skip to content

Commit

Permalink
Force mul inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Feb 18, 2025
1 parent f059d6c commit c9e4f55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/boost/decimal/decimal64_fast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ BOOST_DECIMAL_EXPORT class decimal64_fast final
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_decimal_floating_point_v, DecimalType, std::uint64_t);

template <typename ReturnType, typename T>
friend constexpr auto detail::d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_if_t<!std::is_same<ReturnType, decimal64>::value, ReturnType>;
BOOST_DECIMAL_FORCE_INLINE friend constexpr auto detail::d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_if_t<!std::is_same<ReturnType, decimal64>::value, ReturnType>;

public:
constexpr decimal64_fast() noexcept = default;
Expand Down
6 changes: 3 additions & 3 deletions include/boost/decimal/detail/mul_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace detail {
// 2) Returns a struct of the constituent components (used with FMAs)

template <typename ReturnType, typename T>
constexpr auto mul_impl(const T& lhs, const T& rhs) noexcept -> ReturnType
BOOST_DECIMAL_FORCE_INLINE constexpr auto mul_impl(const T& lhs, const T& rhs) noexcept -> ReturnType
{
using mul_type = std::uint_fast64_t;

Expand Down Expand Up @@ -62,7 +62,7 @@ BOOST_DECIMAL_FORCE_INLINE constexpr auto mul_impl(T lhs_sig, U lhs_exp, bool lh
}

template <typename ReturnType, typename T>
constexpr auto d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_if_t<std::is_same<ReturnType, decimal64>::value, ReturnType>
BOOST_DECIMAL_FORCE_INLINE constexpr auto d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_if_t<std::is_same<ReturnType, decimal64>::value, ReturnType>
{
// Clang 6-12 yields incorrect results with builtin u128, so we force usage of our version
#if defined(BOOST_DECIMAL_HAS_INT128) && (!defined(__clang_major__) || (__clang_major__) > 12)
Expand All @@ -79,7 +79,7 @@ constexpr auto d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_

// In the fast case we are better served doing our 128-bit division here since we are at a know starting point
template <typename ReturnType, typename T>
constexpr auto d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_if_t<!std::is_same<ReturnType, decimal64>::value, ReturnType>
BOOST_DECIMAL_FORCE_INLINE constexpr auto d64_mul_impl(const T& lhs, const T& rhs) noexcept -> std::enable_if_t<!std::is_same<ReturnType, decimal64>::value, ReturnType>
{
// Clang 6-12 yields incorrect results with builtin u128, so we force usage of our version
#if defined(BOOST_DECIMAL_HAS_INT128) && (!defined(__clang_major__) || (__clang_major__) > 12)
Expand Down

0 comments on commit c9e4f55

Please sign in to comment.