From 4d91519a9be061da5d300079fca17dd0b9328050 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Thu, 3 Dec 2020 22:31:44 +0000 Subject: Add log2() operator to Eigen --- Eigen/src/Core/arch/AVX/MathFunctions.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Eigen/src/Core/arch/AVX') diff --git a/Eigen/src/Core/arch/AVX/MathFunctions.h b/Eigen/src/Core/arch/AVX/MathFunctions.h index e2e704d82..5fe2cff32 100644 --- a/Eigen/src/Core/arch/AVX/MathFunctions.h +++ b/Eigen/src/Core/arch/AVX/MathFunctions.h @@ -42,6 +42,18 @@ plog(const Packet4d& _x) { return plog_double(_x); } +template <> +EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet8f +plog2(const Packet8f& _x) { + return plog2_float(_x); +} + +template <> +EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4d +plog2(const Packet4d& _x) { + return plog2_double(_x); +} + template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet8f plog1p(const Packet8f& _x) { return generic_plog1p(_x); @@ -161,6 +173,7 @@ Packet4d prsqrt(const Packet4d& _x) { F16_PACKET_FUNCTION(Packet8f, Packet8h, psin) F16_PACKET_FUNCTION(Packet8f, Packet8h, pcos) F16_PACKET_FUNCTION(Packet8f, Packet8h, plog) +F16_PACKET_FUNCTION(Packet8f, Packet8h, plog2) F16_PACKET_FUNCTION(Packet8f, Packet8h, plog1p) F16_PACKET_FUNCTION(Packet8f, Packet8h, pexpm1) F16_PACKET_FUNCTION(Packet8f, Packet8h, pexp) @@ -171,6 +184,7 @@ F16_PACKET_FUNCTION(Packet8f, Packet8h, prsqrt) BF16_PACKET_FUNCTION(Packet8f, Packet8bf, psin) BF16_PACKET_FUNCTION(Packet8f, Packet8bf, pcos) BF16_PACKET_FUNCTION(Packet8f, Packet8bf, plog) +BF16_PACKET_FUNCTION(Packet8f, Packet8bf, plog2) BF16_PACKET_FUNCTION(Packet8f, Packet8bf, plog1p) BF16_PACKET_FUNCTION(Packet8f, Packet8bf, pexpm1) BF16_PACKET_FUNCTION(Packet8f, Packet8bf, pexp) -- cgit v1.2.3