Skip to content

Commit

Permalink
tcg/loongarch64: Set vector registers call clobbered
Browse files Browse the repository at this point in the history
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: 16288de ("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>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20240201233414.500588-1-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Feb 2, 2024
1 parent 86282b1 commit e45bc7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcg/loongarch64/tcg-target.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e45bc7e

Please sign in to comment.