From bcc04e0c5be8e376e26f3f37fb275d624efcdaef Mon Sep 17 00:00:00 2001 From: Denis Drakhnya Date: Fri, 16 Apr 2021 15:16:35 +0300 Subject: [PATCH] e2k: Increase the number of NR to 224. Signed-off-by: Denis Drakhnya --- target/e2k/cpu.h | 2 +- target/e2k/translate.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/target/e2k/cpu.h b/target/e2k/cpu.h index d5ab23a24b..ff66b53aa0 100644 --- a/target/e2k/cpu.h +++ b/target/e2k/cpu.h @@ -47,7 +47,7 @@ void e2k_tcg_initialize(void); #define E2K_WR_COUNT 64 /* %rN [0, 64) */ #define E2K_BR_COUNT 128 /* %b[N] [0, 128) */ -#define E2K_NR_COUNT (E2K_WR_COUNT + E2K_BR_COUNT) +#define E2K_NR_COUNT 224 #define E2K_GR_COUNT 32 /* %gN [0, 32) */ #define E2K_BGR_COUNT 8 /* %gN [24, 32) */ #define E2K_REG_COUNT (E2K_NR_COUNT + E2K_GR_COUNT) diff --git a/target/e2k/translate.c b/target/e2k/translate.c index 953cf7e63a..f74c60b912 100644 --- a/target/e2k/translate.c +++ b/target/e2k/translate.c @@ -24,10 +24,8 @@ #define IS_GLOBAL(i) (((i) & 0xe0) == 0xe0) #define IS_REG(i) ((i) < 192 || (i) >= 224) #if 0 -/* these registers are safe not to keep the old value - * %r[0..8], %b[56..128], %g[0..32] */ -# define IS_REG_SAVE_SAFE(i) \ - (((i) >= 56 && (i) < 136) || (i) >= 224) +/* these registers are safe not to keep the old value %g[0..32] */ +# define IS_REG_SAVE_SAFE(i) ((i) >= 224) #else /* this could potentially create an RAW conflict for next ops in a bundle */ #define IS_REG_SAVE_SAFE(i) (true) @@ -926,6 +924,9 @@ static inline void decode_cs1(DisasContext *ctx, const UnpackedBundle *raw) if (ctx->version >= 3) { setr->dbl = extract32(lts0, 3, 1); } + if (setr->wsz > 112) { + gen_tr_excp_illopc(ctx); + } } if (extract32(cs1, 26, 1)) { setr->type |= SETR_BN;