diff options
author | David Tellenbach <david.tellenbach@me.com> | 2020-11-17 20:19:44 +0100 |
---|---|---|
committer | David Tellenbach <david.tellenbach@me.com> | 2020-11-17 20:19:44 +0100 |
commit | e9b55c4db80f292aa0a6dbe28ac84c0bcf604078 (patch) | |
tree | 147d18c15e788c734e1d0e6fdeb9371eba793c23 /Eigen/src/Core/arch/NEON/PacketMath.h | |
parent | 117a4c061726cf2100416ce38d6b58b64c663985 (diff) |
Avoid promotion of Arm __fp16 to float in Neon PacketMath
Using overloaded arithmetic operators for Arm __fp16 always
causes a promotion to float. We replace operator* by vmulh_f16
to avoid this.
Diffstat (limited to 'Eigen/src/Core/arch/NEON/PacketMath.h')
-rw-r--r-- | Eigen/src/Core/arch/NEON/PacketMath.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h index a51fc88c6..30edd7097 100644 --- a/Eigen/src/Core/arch/NEON/PacketMath.h +++ b/Eigen/src/Core/arch/NEON/PacketMath.h @@ -4355,7 +4355,7 @@ EIGEN_STRONG_INLINE Eigen::half predux_mul<Packet8hf>(const Packet8hf& a) { prod = vmul_f16(prod, vrev64_f16(prod)); Eigen::half h; - h.x = vget_lane_f16(prod, 0) * vget_lane_f16(prod, 1); + h.x = vmulh_f16(vget_lane_f16(prod, 0), vget_lane_f16(prod, 1)); return h; } @@ -4364,7 +4364,7 @@ EIGEN_STRONG_INLINE Eigen::half predux_mul<Packet4hf>(const Packet4hf& a) { float16x4_t prod; prod = vmul_f16(a, vrev64_f16(a)); Eigen::half h; - h.x = vget_lane_f16(prod, 0) * vget_lane_f16(prod, 1); + h.x = vmulh_f16(vget_lane_f16(prod, 0), vget_lane_f16(prod, 1)); return h; } |