On 8/7/23 18:54, Jiajie Chen wrote:
--- a/target/loongarch/translate.c
+++ b/target/loongarch/translate.c
@@ -119,6 +119,9 @@ static void
loongarch_tr_init_disas_context(DisasContextBase *dcbase,
ctx->vl = LSX_LEN;
}
+ ctx->la32 = LOONGARCH_CPUCFG_ARCH(env, LA32);
+ ctx->va32 = (ctx->base.tb->flags & HW_FLAGS_VA32) != 0;
+
ctx->zero = tcg_constant_tl(0);
}
diff --git a/target/loongarch/translate.h b/target/loongarch/translate.h
index 7f60090580..828f1185d2 100644
--- a/target/loongarch/translate.h
+++ b/target/loongarch/translate.h
@@ -33,6 +33,8 @@ typedef struct DisasContext {
uint16_t plv;
int vl; /* Vector length */
TCGv zero;
+ bool la32; /* LoongArch32 mode */
Because if the LA32 Restricted (or simplified), let's make this la64.
Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
r~