Skip to content

Commit

Permalink
New style FMA and fixed horner/reverse_horner/newton
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap authored Apr 7, 2024
1 parent 3994582 commit bfc4954
Show file tree
Hide file tree
Showing 69 changed files with 831 additions and 988 deletions.
4 changes: 2 additions & 2 deletions benchmarks/module/core/fma/pedantic/fma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(std__fma) , xp, std__fma, arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(pedantic(eve::fma)) , xp, eve::pedantic(eve::fma), arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::fma)) , xp, eve::pedantic(eve::fma), arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(eve::fma[eve::pedantic]) , xp, eve::fma[eve::pedantic], arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(eve::fma[eve::pedantic]) , xp, eve::fma[eve::pedantic], arg0, arg1, arg2);
}
7 changes: 5 additions & 2 deletions include/eve/module/core/decorator/regular.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ namespace eve
//================================================================================================
//================================================================================================
// Function decorators mark-up used in function overloads
struct regular_type : decorator_
struct regular_
{
template<typename Function> constexpr EVE_FORCEINLINE auto operator()(Function f) const noexcept
{
return [f](auto&&...args) { return f(EVE_FWD(args)...); };
return f;
}
};


using regular_type = decorated<regular_()>;

//================================================================================================
//! @addtogroup core_decorators
//! @{
Expand Down
1 change: 0 additions & 1 deletion include/eve/module/core/numeric/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <eve/module/core/numeric/fam.hpp>
#include <eve/module/core/numeric/fanm.hpp>
#include <eve/module/core/numeric/fma.hpp>
#include <eve/module/core/numeric/fms.hpp>
#include <eve/module/core/numeric/fnma.hpp>
#include <eve/module/core/numeric/fnms.hpp>
Expand Down
23 changes: 0 additions & 23 deletions include/eve/module/core/numeric/fma.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions include/eve/module/core/numeric/impl/fam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <eve/detail/implementation.hpp>
#include <eve/detail/skeleton_calls.hpp>
#include <eve/module/core/decorator/numeric.hpp>
#include <eve/module/core/numeric/fma.hpp>
#include <eve/module/core/regular/fma.hpp>
#include <eve/module/core/regular/all.hpp>

#include <type_traits>
Expand All @@ -33,6 +33,6 @@ EVE_FORCEINLINE T
fam_(EVE_SUPPORTS(cpu_), numeric_type const&, T const& a, T const& b, T const& c) noexcept requires
has_native_abi_v<T>
{
return numeric(fma)(b, c, a);
return fma[pedantic](b, c, a);
}
}
72 changes: 0 additions & 72 deletions include/eve/module/core/numeric/impl/fma.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions include/eve/module/core/numeric/impl/fms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <eve/detail/implementation.hpp>
#include <eve/detail/skeleton_calls.hpp>
#include <eve/module/core/decorator/numeric.hpp>
#include <eve/module/core/numeric/fma.hpp>
#include <eve/module/core/regular/fma.hpp>
#include <eve/module/core/regular/all.hpp>

namespace eve::detail
Expand All @@ -31,6 +31,6 @@ EVE_FORCEINLINE T
fms_(EVE_SUPPORTS(cpu_), numeric_type const&, T const& a, T const& b, T const& c) noexcept requires
has_native_abi_v<T>
{
return numeric(fma)(a, b, T(-c));
return fma[pedantic](a, b, T(-c));
}
}
4 changes: 2 additions & 2 deletions include/eve/module/core/numeric/impl/fnma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <eve/detail/implementation.hpp>
#include <eve/detail/skeleton_calls.hpp>
#include <eve/module/core/decorator/numeric.hpp>
#include <eve/module/core/numeric/fma.hpp>
#include <eve/module/core/regular/fma.hpp>
#include <eve/module/core/regular/all.hpp>

#include <type_traits>
Expand All @@ -33,6 +33,6 @@ EVE_FORCEINLINE T
fnma_(EVE_SUPPORTS(cpu_), numeric_type const&, T const& a, T const& b, T const& c) noexcept requires
has_native_abi_v<T>
{
return numeric(fma)(T(-a), b, c);
return fma[pedantic](T(-a), b, c);
}
}
4 changes: 2 additions & 2 deletions include/eve/module/core/numeric/impl/fnms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <eve/detail/implementation.hpp>
#include <eve/detail/skeleton_calls.hpp>
#include <eve/module/core/decorator/numeric.hpp>
#include <eve/module/core/numeric/fma.hpp>
#include <eve/module/core/regular/fma.hpp>
#include <eve/module/core/regular/all.hpp>

#include <type_traits>
Expand All @@ -33,6 +33,6 @@ EVE_FORCEINLINE T
fnms_(EVE_SUPPORTS(cpu_), numeric_type const&, T const& a, T const& b, T const& c) noexcept requires
has_native_abi_v<T>
{
return -numeric(fma)(a, b, c);
return -fma[pedantic](a, b, c);
}
}
4 changes: 2 additions & 2 deletions include/eve/module/core/numeric/impl/lerp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <eve/detail/implementation.hpp>
#include <eve/detail/skeleton_calls.hpp>
#include <eve/module/core/decorator/numeric.hpp>
#include <eve/module/core/numeric/fma.hpp>
#include <eve/module/core/regular/fma.hpp>
#include <eve/module/core/numeric/fnma.hpp>
#include <eve/module/core/regular/all.hpp>

Expand All @@ -33,6 +33,6 @@ template<floating_ordered_value T>
EVE_FORCEINLINE T
lerp_(EVE_SUPPORTS(cpu_), numeric_type const&, T const& a, T const& b, T const& t) noexcept
{
return numeric(fma)(t, b, numeric(fnma)(t, a, a));
return fma[pedantic](t, b, numeric(fnma)(t, a, a));
}
}
26 changes: 0 additions & 26 deletions include/eve/module/core/numeric/impl/simd/arm/neon/fma.hpp

This file was deleted.

32 changes: 0 additions & 32 deletions include/eve/module/core/numeric/impl/simd/ppc/fma.hpp

This file was deleted.

32 changes: 0 additions & 32 deletions include/eve/module/core/numeric/impl/simd/x86/fma.hpp

This file was deleted.

1 change: 0 additions & 1 deletion include/eve/module/core/pedantic/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <eve/module/core/pedantic/diff_of_prod.hpp>
#include <eve/module/core/pedantic/fam.hpp>
#include <eve/module/core/pedantic/fanm.hpp>
#include <eve/module/core/pedantic/fma.hpp>
#include <eve/module/core/pedantic/fms.hpp>
#include <eve/module/core/pedantic/fnma.hpp>
#include <eve/module/core/pedantic/fnms.hpp>
Expand Down
23 changes: 0 additions & 23 deletions include/eve/module/core/pedantic/fma.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/eve/module/core/pedantic/impl/diff_of_prod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace eve::detail
else
{
T mcd = c * d;
T err = pedantic(fma)(-c, d, mcd);
T err = fma[pedantic](-c, d, mcd);
T dop = pedantic(fms)(a, b, mcd);
return if_else(is_finite(err), dop + err, dop);
}
Expand Down
4 changes: 2 additions & 2 deletions include/eve/module/core/pedantic/impl/fam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <eve/detail/implementation.hpp>
#include <eve/detail/skeleton_calls.hpp>
#include <eve/module/core/decorator/pedantic.hpp>
#include <eve/module/core/pedantic/fma.hpp>
#include <eve/module/core/regular/fma.hpp>
#include <eve/module/core/regular/all.hpp>

#include <type_traits>
Expand All @@ -32,6 +32,6 @@ EVE_FORCEINLINE T
fam_(EVE_SUPPORTS(cpu_), pedantic_type const&, T const& a, T const& b, T const& c) noexcept requires
has_native_abi_v<T>
{
return pedantic(fma)(b, c, a);
return fma[pedantic](b, c, a);
}
}
Loading

0 comments on commit bfc4954

Please sign in to comment.