On 27/5/24 23:19, Richard Henderson wrote:
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
tcg/loongarch64/tcg-target.h | 2 +-
tcg/loongarch64/tcg-target.c.inc | 11 ++++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index e2b5aad5e3..0b41b807e3 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -2484,9 +2484,14 @@ static void tcg_target_init(TCGContext *s)
tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S8);
tcg_regset_reset_reg(tcg_target_call_clobber_regs, TCG_REG_S9);
- if (cpuinfo & CPUINFO_LSX) {
- tcg_target_available_regs[TCG_TYPE_V64] = ALL_VECTOR_REGS;
- tcg_target_available_regs[TCG_TYPE_V128] = ALL_VECTOR_REGS;
+ if (cpuinfo & (CPUINFO_LSX | CPUINFO_LASX)) {
+ if (cpuinfo & CPUINFO_LSX) {
+ tcg_target_available_regs[TCG_TYPE_V64] = ALL_VECTOR_REGS;
+ tcg_target_available_regs[TCG_TYPE_V128] = ALL_VECTOR_REGS;
+ }
+ if (cpuinfo & CPUINFO_LASX) {
+ tcg_target_available_regs[TCG_TYPE_V256] = ALL_VECTOR_REGS;
+ }
Out of curiosity, could we have LASX without LSX?