target/tricore: Fix wrong PSW for call insns
authorBastian Koppelmann <kbastian@mail.uni-paderborn.de>
Fri, 26 May 2023 06:19:45 +0000 (08:19 +0200)
committerBastian Koppelmann <kbastian@mail.uni-paderborn.de>
Wed, 7 Jun 2023 16:20:48 +0000 (18:20 +0200)
we were copying PSW into a local variable, updated PSW.CDE in the local
and never wrote it back. So when we called save_context_upper() we were
using the non-local version of PSW which did not contain the updated
PSW.CDE.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20230526061946.54514-6-kbastian@mail.uni-paderborn.de>

target/tricore/op_helper.c

index 6fd2cbe20fd7f84dd57289d0712b04d501fc2aba..54f54811d9bbf240c88a94bffb5bc866f5a5bec3 100644 (file)
@@ -2447,6 +2447,8 @@ void helper_call(CPUTriCoreState *env, uint32_t next_pc)
     }
     /* PSW.CDE = 1;*/
     psw |= MASK_PSW_CDE;
+    psw_write(env, psw);
+
     /* tmp_FCX = FCX; */
     tmp_FCX = env->FCX;
     /* EA = {FCX.FCXS, 6'b0, FCX.FCXO, 6'b0}; */