qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcg/loongarch64: Set vector registers call clobbered
@ 2024-02-01 23:34 Richard Henderson
  2024-02-02  1:20 ` gaosong
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2024-02-01 23:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: gaosong, qemu-stable

Because there are more call clobbered registers than
call saved registers, we begin with all registers as
call clobbered and then reset those that are saved.

This was missed when we introduced the LSX support.

Cc: qemu-stable@nongnu.org
Fixes: 16288ded944 ("tcg/loongarch64: Lower basic tcg vec ops to LSX")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2136
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/loongarch64/tcg-target.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index bab0a173a3..dcf0205458 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -2327,7 +2327,7 @@ static void tcg_target_init(TCGContext *s)
     tcg_target_available_regs[TCG_TYPE_I32] = ALL_GENERAL_REGS;
     tcg_target_available_regs[TCG_TYPE_I64] = ALL_GENERAL_REGS;
 
-    tcg_target_call_clobber_regs = ALL_GENERAL_REGS;
+    tcg_target_call_clobber_regs = ALL_GENERAL_REGS | ALL_VECTOR_REGS;
     tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S0);
     tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S1);
     tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S2);
-- 
2.34.1



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

* Re: [PATCH] tcg/loongarch64: Set vector registers call clobbered
  2024-02-01 23:34 [PATCH] tcg/loongarch64: Set vector registers call clobbered Richard Henderson
@ 2024-02-02  1:20 ` gaosong
  0 siblings, 0 replies; 2+ messages in thread
From: gaosong @ 2024-02-02  1:20 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: qemu-stable

在 2024/2/2 上午7:34, Richard Henderson 写道:
> Because there are more call clobbered registers than
> call saved registers, we begin with all registers as
> call clobbered and then reset those that are saved.
>
> This was missed when we introduced the LSX support.
>
> Cc: qemu-stable@nongnu.org
> Fixes: 16288ded944 ("tcg/loongarch64: Lower basic tcg vec ops to LSX")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2136
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/loongarch64/tcg-target.c.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
Thank you !

Reviewed-by: Song Gao <gaosong@loongson.cn>

Thanks.
Song Gao
> diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
> index bab0a173a3..dcf0205458 100644
> --- a/tcg/loongarch64/tcg-target.c.inc
> +++ b/tcg/loongarch64/tcg-target.c.inc
> @@ -2327,7 +2327,7 @@ static void tcg_target_init(TCGContext *s)
>       tcg_target_available_regs[TCG_TYPE_I32] = ALL_GENERAL_REGS;
>       tcg_target_available_regs[TCG_TYPE_I64] = ALL_GENERAL_REGS;
>   
> -    tcg_target_call_clobber_regs = ALL_GENERAL_REGS;
> +    tcg_target_call_clobber_regs = ALL_GENERAL_REGS | ALL_VECTOR_REGS;
>       tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S0);
>       tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S1);
>       tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S2);



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

end of thread, other threads:[~2024-02-02  1:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 23:34 [PATCH] tcg/loongarch64: Set vector registers call clobbered Richard Henderson
2024-02-02  1:20 ` gaosong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).