From c770746d709686ef2b8b652616d9232f9b028e78 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Tue, 24 Nov 2020 20:53:07 +0000 Subject: Fix Half NaN definition and test. The `half_float` test was failing with `-mcpu=cortex-a55` (native `__fp16`) due to a bad NaN bit-pattern comparison (in the case of casting a float to `__fp16`, the signaling `NaN` is quieted). There was also an inconsistency between `numeric_limits::quiet_NaN()` and `NumTraits::quiet_NaN()`. Here we correct the inconsistency and compare NaNs according to the IEEE 754 definition. Also modified the `bfloat16_float` test to match. Tested with `cortex-a53` and `cortex-a55`. --- Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h') diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h index 0e02a1b20..cc6fc5ac7 100644 --- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h @@ -70,8 +70,15 @@ EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet pcos_float(const Packet& x); +/** \internal \returns sqrt(x) for complex types */ +template +EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS +EIGEN_UNUSED +Packet psqrt_complex(const Packet& x); + template struct ppolevl; + } // end namespace internal } // end namespace Eigen -- cgit v1.2.3