From ca2e77b2826bcb60cbb6d2ba7a10669986c1d1e3 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Sun, 11 Feb 2024 09:48:40 +0100 Subject: [PATCH] keep the result symmetric --- polar_helper.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polar_helper.hh b/polar_helper.hh index 060eea2..e05c599 100644 --- a/polar_helper.hh +++ b/polar_helper.hh @@ -146,9 +146,9 @@ struct PolarHelper> static TYPE madd(TYPE a, TYPE b, TYPE c) { #ifdef __ARM_NEON - return vqadd(vmul(a, vmax(b, vdup(-127))), c); + return vmax(vqadd(vmul(a, vmax(b, vdup(-127))), c), vdup(-127)); #else - return vqadd(vsign(vmax(b, vdup(-127)), a), c); + return vmax(vqadd(vsign(vmax(b, vdup(-127)), a), c), vdup(-127)); #endif } };