]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/tricore: Correctly fix saving PSW.CDE to CSA on call
authorBastian Koppelmann <kbastian@mail.uni-paderborn.de>
Mon, 12 Jun 2023 11:32:43 +0000 (13:32 +0200)
committerBastian Koppelmann <kbastian@mail.uni-paderborn.de>
Wed, 21 Jun 2023 16:09:54 +0000 (18:09 +0200)
we don't want to save PSW.CDC to the CSA, but PSW.CDE must be saved.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1699
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20230612113245.56667-3-kbastian@mail.uni-paderborn.de>

target/tricore/op_helper.c

index 026e15f3e0886ce991c8f9d1be09888bc0a2e85b..9a7a26b171c2dba157b881a3d8c8c395eb7489f1 100644 (file)
@@ -2499,7 +2499,12 @@ void helper_call(CPUTriCoreState *env, uint32_t next_pc)
     }
     /* PSW.CDE = 1;*/
     psw |= MASK_PSW_CDE;
-    psw_write(env, psw);
+    /*
+     * we need to save PSW.CDE and not PSW.CDC into the CSAs. psw already
+     * contains the CDC from cdc_increment(), so we cannot call psw_write()
+     * here.
+     */
+    env->PSW |= MASK_PSW_CDE;
 
     /* tmp_FCX = FCX; */
     tmp_FCX = env->FCX;