On 5/17/22 11:37, Lucas Mateus Castro(alqotel) wrote:
+static inline float32 bfp32_negate(float32 a) +{ + if (unlikely(((a & 0x7f800000) == 0x7f800000) && (a & 0x007fffff))) {
float32_is_any_nan.
+ if (neg_mul) { + msum = bfp32_negate(msum); + } + if (neg_acc) { + at[i].VsrSF(j) = float32_sub(msum, aux_acc, excp_ptr); + } else { + at[i].VsrSF(j) = float32_add(msum, aux_acc, excp_ptr); + }
Hmm. Since we're using negate once, perhaps just go ahead and use it twice. Or go all the way with if (!neg_mul && !neg_acc) { r = float32_add(msum, aux_acc, excp_ptr); } else if (!neg_mul) { r = float32_sub(msum, aux_acc, excp_ptr); } else if (!neg_acc) { r = float32_sub(aux_acc, msum, excp_ptr); } else { r = float32_add(bfp32_neg(msum), bfp32_neg(aux_acc), excp_ptr); } Otherwise, the logic seems sane. r~