diff mbox series

[05/19] target/ppc: Zero second doubleword for VSX madd instructions

Message ID 20220901131756.26060-6-victor.colombo@eldorado.org.br (mailing list archive)
State New, archived
Headers show
Series Multiple ppc instructions fixes | expand

Commit Message

Víctor Colombo Sept. 1, 2022, 1:17 p.m. UTC
In 205eb5a89e we updated most VSX instructions to zero the
second doubleword, as is requested by PowerISA since v3.1.
However, VSX_MADD helper was left behind unchanged, while it
is also affected and should be fixed as well.

This patch applies the fix for MADD instructions.

Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
---
 target/ppc/fpu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Henrique Barboza Sept. 5, 2022, 6:23 p.m. UTC | #1
On 9/1/22 10:17, Víctor Colombo wrote:
> In 205eb5a89e we updated most VSX instructions to zero the
> second doubleword, as is requested by PowerISA since v3.1.
> However, VSX_MADD helper was left behind unchanged, while it
> is also affected and should be fixed as well.
> 
> This patch applies the fix for MADD instructions.
> 
> Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
> ---

In this case it's good to add a Fixes tag:


Fixes: 205eb5a89e ("target/ppc: Change VSX instructions behavior to fill with zeros")



>   target/ppc/fpu_helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

> 
> diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
> index 7ab6beadad..da79c64eca 100644
> --- a/target/ppc/fpu_helper.c
> +++ b/target/ppc/fpu_helper.c
> @@ -2178,7 +2178,7 @@ VSX_TSQRT(xvtsqrtsp, 4, float32, VsrW(i), -126, 23)
>   void helper_##op(CPUPPCState *env, ppc_vsr_t *xt,                             \
>                    ppc_vsr_t *s1, ppc_vsr_t *s2, ppc_vsr_t *s3)                 \
>   {                                                                             \
> -    ppc_vsr_t t = *xt;                                                        \
> +    ppc_vsr_t t = { };                                                        \
>       int i;                                                                    \
>                                                                                 \
>       helper_reset_fpstatus(env);                                               \
diff mbox series

Patch

diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index 7ab6beadad..da79c64eca 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -2178,7 +2178,7 @@  VSX_TSQRT(xvtsqrtsp, 4, float32, VsrW(i), -126, 23)
 void helper_##op(CPUPPCState *env, ppc_vsr_t *xt,                             \
                  ppc_vsr_t *s1, ppc_vsr_t *s2, ppc_vsr_t *s3)                 \
 {                                                                             \
-    ppc_vsr_t t = *xt;                                                        \
+    ppc_vsr_t t = { };                                                        \
     int i;                                                                    \
                                                                               \
     helper_reset_fpstatus(env);                                               \