starting from ISA version 1.6.1 (previously known as 1.6P/E), some
bitfields in PCXI and ICR have changed. We also refactor these
registers using the register fields API.
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1453
---
target/tricore/cpu.h | 39 ++++++++++++-----
target/tricore/helper.c | 45 ++++++++++++++++++++
target/tricore/op_helper.c | 85 +++++++++++++++++++-------------------
target/tricore/translate.c | 12 +++++-
4 files changed, 125 insertions(+), 56 deletions(-)
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index 2646cb3eb5..db62604102 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -7847,12 +7847,20 @@ static void decode_sys_interrupts(DisasContext *ctx)
/* raise EXCP_DEBUG */
break;
case OPC2_32_SYS_DISABLE:
- tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~MASK_ICR_IE_1_3);
+ if (has_feature(ctx, TRICORE_FEATURE_161)) {
+ tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~R_ICR_IE_161_MASK);
+ } else {
+ tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~R_ICR_IE_13_MASK);
+ }
break;
case OPC2_32_SYS_DSYNC:
break;
case OPC2_32_SYS_ENABLE:
- tcg_gen_ori_tl(cpu_ICR, cpu_ICR, MASK_ICR_IE_1_3);
+ if (has_feature(ctx, TRICORE_FEATURE_161)) {
+ tcg_gen_ori_tl(cpu_ICR, cpu_ICR, R_ICR_IE_161_MASK);
+ } else {
+ tcg_gen_ori_tl(cpu_ICR, cpu_ICR, R_ICR_IE_13_MASK);
+ }
break;
case OPC2_32_SYS_ISYNC:
break;