qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/3] target/ppc: Fixed call to deferred exception


From: Lucas Mateus Martins Araujo e Castro
Subject: Re: [PATCH v2 1/3] target/ppc: Fixed call to deferred exception
Date: Fri, 19 Nov 2021 14:06:27 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0


On 19/11/2021 06:18, Richard Henderson wrote:
On 11/18/21 2:25 PM, Lucas Mateus Castro (alqotel) wrote:
+    if ((fpscr & FP_VXSOFT) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXSOFT;
+    } else if ((fpscr & FP_OX) && (fpscr & FP_OE)) {
+        error = POWERPC_EXCP_FP_OX;
+    } else if ((fpscr & FP_UX) && (fpscr & FP_UE)) {
+        error = POWERPC_EXCP_FP_UX;
+    } else if ((fpscr & FP_XX) && (fpscr & FP_XE)) {
+        error = POWERPC_EXCP_FP_XX;
+    } else if ((fpscr & FP_ZX) && (fpscr & FP_ZE)) {
+        error = POWERPC_EXCP_FP_ZX;
+    } else if ((fpscr & FP_VXSNAN) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXSNAN;
+    } else if ((fpscr & FP_VXISI) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXISI;
+    } else if ((fpscr & FP_VXIDI) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXIDI;
+    } else if ((fpscr & FP_VXZDZ) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXZDZ;
+    } else if ((fpscr & FP_VXIMZ) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXIMZ;
+    } else if ((fpscr & FP_VXVC) && (fpscr_ve != 0)) {
+        error = POWERPC_EXCP_FP_VXVC;
+    }

Is there a defined order for these in the manual?  I couldn't find it quickly if so.  If
there is no defined order, I think you should test VE only once.
I also couldn't find a defined order, so I chose to prioritize VXSOFT then go by ascending order of the bit number. In the v3 I'll move VXSOFT with the others invalid operation bits to check VE once then.

Drop the use of fpscr_ve and use fpscr & FP_VE instead. (I think these hidden uses of *env
are evil and should be banished, but that's a bit of a job.)

You could say

    } else {
        return;
    }

+
+    if (error) {

and then remove this test.
Ok, I'll do these in v3.

The rest of it looks good.


r~
--
Lucas Mateus M. Araujo e Castro
Instituto de Pesquisas ELDORADO
Departamento Computação Embarcada
Estagiario
Aviso Legal - Disclaimer

reply via email to

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