qemu-devel
[Top][All Lists]
Advanced

[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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]