keep the result symmetric

This commit is contained in:
Ahmet Inan 2024-02-11 09:48:40 +01:00
commit ca2e77b282

View file

@ -146,9 +146,9 @@ struct PolarHelper<SIMD<int8_t, WIDTH>>
static TYPE madd(TYPE a, TYPE b, TYPE c)
{
#ifdef __ARM_NEON
return vqadd(vmul(a, vmax(b, vdup<TYPE>(-127))), c);
return vmax(vqadd(vmul(a, vmax(b, vdup<TYPE>(-127))), c), vdup<TYPE>(-127));
#else
return vqadd(vsign(vmax(b, vdup<TYPE>(-127)), a), c);
return vmax(vqadd(vsign(vmax(b, vdup<TYPE>(-127)), a), c), vdup<TYPE>(-127));
#endif
}
};