[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 5/8] target/ppc: Implemented xvf16ger*
From: |
Richard Henderson |
Subject: |
Re: [PATCH v3 5/8] target/ppc: Implemented xvf16ger* |
Date: |
Tue, 17 May 2022 12:40:27 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 |
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~
- [PATCH v3 0/8] VSX MMA Implementation, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 1/8] target/ppc: Implement xxm[tf]acc and xxsetaccz, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 2/8] target/ppc: Implemented xvi*ger* instructions, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 3/8] target/ppc: Implemented pmxvi*ger* instructions, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 4/8] target/ppc: Implemented xvf*ger*, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 5/8] target/ppc: Implemented xvf16ger*, Lucas Mateus Castro(alqotel), 2022/05/17
- Re: [PATCH v3 5/8] target/ppc: Implemented xvf16ger*,
Richard Henderson <=
- [PATCH v3 6/8] target/ppc: Implemented pmxvf*ger*, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 7/8] target/ppc: Implemented [pm]xvbf16ger2*, Lucas Mateus Castro(alqotel), 2022/05/17
- [PATCH v3 8/8] linux-user: Add PowerPC ISA 3.1 and MMA to hwcap, Lucas Mateus Castro(alqotel), 2022/05/17