All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/ppc: Fix xvcmp* clearing FI bit
@ 2022-10-05 12:15 Víctor Colombo
  2022-10-05 13:51 ` Richard Henderson
  2022-10-14 10:25 ` Daniel Henrique Barboza
  0 siblings, 2 replies; 3+ messages in thread
From: Víctor Colombo @ 2022-10-05 12:15 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: clg, danielhb413, david, groug, richard.henderson,
	victor.colombo, matheus.ferst, lucas.araujo, leandro.lupori,
	lucas.coutinho

Vector instructions in general are not supposed to change the FI bit.
However, xvcmp* instructions are calling gen_helper_float_check_status,
which is leading to a cleared FI flag where it should be kept
unchanged.
As helper_float_check_status only affects inexact, overflow and
underflow, and the xvcmp* instructions don't change these flags, this
issue can be fixed by removing the call to helper_float_check_status.
By doing this, the FI bit in FPSCR will be preserved as expected.

Fixes: 00084a25adf ("target/ppc: introduce separate VSX_CMP macro for xvcmp* instructions")
Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
---
 target/ppc/translate/vsx-impl.c.inc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
index 7acdbceec4..e6e5c45ffd 100644
--- a/target/ppc/translate/vsx-impl.c.inc
+++ b/target/ppc/translate/vsx-impl.c.inc
@@ -810,7 +810,6 @@ static void gen_##name(DisasContext *ctx)                                     \
         gen_helper_##name(ignored, cpu_env, xt, xa, xb);                      \
         tcg_temp_free_i32(ignored);                                           \
     }                                                                         \
-    gen_helper_float_check_status(cpu_env);                                   \
     tcg_temp_free_ptr(xt);                                                    \
     tcg_temp_free_ptr(xa);                                                    \
     tcg_temp_free_ptr(xb);                                                    \
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/ppc: Fix xvcmp* clearing FI bit
  2022-10-05 12:15 [PATCH] target/ppc: Fix xvcmp* clearing FI bit Víctor Colombo
@ 2022-10-05 13:51 ` Richard Henderson
  2022-10-14 10:25 ` Daniel Henrique Barboza
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2022-10-05 13:51 UTC (permalink / raw)
  To: Víctor Colombo, qemu-devel, qemu-ppc
  Cc: clg, danielhb413, david, groug, matheus.ferst, lucas.araujo,
	leandro.lupori, lucas.coutinho

On 10/5/22 05:15, Víctor Colombo wrote:
> Vector instructions in general are not supposed to change the FI bit.
> However, xvcmp* instructions are calling gen_helper_float_check_status,
> which is leading to a cleared FI flag where it should be kept
> unchanged.
> As helper_float_check_status only affects inexact, overflow and
> underflow, and the xvcmp* instructions don't change these flags, this
> issue can be fixed by removing the call to helper_float_check_status.
> By doing this, the FI bit in FPSCR will be preserved as expected.
> 
> Fixes: 00084a25adf ("target/ppc: introduce separate VSX_CMP macro for xvcmp* instructions")
> Signed-off-by: Víctor Colombo<victor.colombo@eldorado.org.br>
> ---
>   target/ppc/translate/vsx-impl.c.inc | 1 -
>   1 file changed, 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/ppc: Fix xvcmp* clearing FI bit
  2022-10-05 12:15 [PATCH] target/ppc: Fix xvcmp* clearing FI bit Víctor Colombo
  2022-10-05 13:51 ` Richard Henderson
@ 2022-10-14 10:25 ` Daniel Henrique Barboza
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Henrique Barboza @ 2022-10-14 10:25 UTC (permalink / raw)
  To: Víctor Colombo, qemu-devel, qemu-ppc
  Cc: clg, david, groug, richard.henderson, matheus.ferst,
	lucas.araujo, leandro.lupori, lucas.coutinho

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

On 10/5/22 09:15, Víctor Colombo wrote:
> Vector instructions in general are not supposed to change the FI bit.
> However, xvcmp* instructions are calling gen_helper_float_check_status,
> which is leading to a cleared FI flag where it should be kept
> unchanged.
> As helper_float_check_status only affects inexact, overflow and
> underflow, and the xvcmp* instructions don't change these flags, this
> issue can be fixed by removing the call to helper_float_check_status.
> By doing this, the FI bit in FPSCR will be preserved as expected.
> 
> Fixes: 00084a25adf ("target/ppc: introduce separate VSX_CMP macro for xvcmp* instructions")
> Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
> ---
>   target/ppc/translate/vsx-impl.c.inc | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
> index 7acdbceec4..e6e5c45ffd 100644
> --- a/target/ppc/translate/vsx-impl.c.inc
> +++ b/target/ppc/translate/vsx-impl.c.inc
> @@ -810,7 +810,6 @@ static void gen_##name(DisasContext *ctx)                                     \
>           gen_helper_##name(ignored, cpu_env, xt, xa, xb);                      \
>           tcg_temp_free_i32(ignored);                                           \
>       }                                                                         \
> -    gen_helper_float_check_status(cpu_env);                                   \
>       tcg_temp_free_ptr(xt);                                                    \
>       tcg_temp_free_ptr(xa);                                                    \
>       tcg_temp_free_ptr(xb);                                                    \


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-14 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 12:15 [PATCH] target/ppc: Fix xvcmp* clearing FI bit Víctor Colombo
2022-10-05 13:51 ` Richard Henderson
2022-10-14 10:25 ` Daniel Henrique Barboza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.