diff options
author | 2016-04-04 16:42:40 -0400 | |
---|---|---|
committer | 2016-04-04 16:42:40 -0400 | |
commit | 158fea0f5e15e4611c36ce73f582c484deeace1a (patch) | |
tree | 1b53a93dac9e37eedf13f09da650daf3a4453f1b /Eigen | |
parent | 03f2997a119578b894ee717aff23e2641ab78f37 (diff) |
bug #1190 - Don't trust __ARM_FEATURE_FMA on Clang/ARM
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/arch/NEON/PacketMath.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h index 10ef1d2b3..63a2d9f52 100644 --- a/Eigen/src/Core/arch/NEON/PacketMath.h +++ b/Eigen/src/Core/arch/NEON/PacketMath.h @@ -177,7 +177,9 @@ template<> EIGEN_STRONG_INLINE Packet4i pdiv<Packet4i>(const Packet4i& /*a*/, co return pset1<Packet4i>(0); } -#ifdef __ARM_FEATURE_FMA +// Clang/ARM wrongly advertises __ARM_FEATURE_FMA even when it's not available, +// then implements a slow software scalar fallback calling fmaf()! +#if (defined __ARM_FEATURE_FMA) && !(EIGEN_COMP_CLANG && EIGEN_ARCH_ARM) // See bug 936. // FMA is available on VFPv4 i.e. when compiling with -mfpu=neon-vfpv4. // FMA is a true fused multiply-add i.e. only 1 rounding at the end, no intermediate rounding. |