target-mips: save cpu state before calling MSA load and store helpers
authorLeon Alrae <leon.alrae@imgtec.com>
Mon, 16 Mar 2015 16:29:34 +0000 (16:29 +0000)
committerLeon Alrae <leon.alrae@imgtec.com>
Wed, 18 Mar 2015 09:58:15 +0000 (09:58 +0000)
PC needs to be saved if an exception can be generated by an helper.
This fixes a problem related to resuming the execution at unexpected address
after an exception (caused by MSA load/store instruction) has been serviced.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
target-mips/translate.c

index a91e5037f5c0e96fa6ad05e211793199ed0aa1f5..fd063a2aae55ec978430d3f647d1c187ddafe27a 100644 (file)
@@ -18414,12 +18414,14 @@ static void gen_msa(CPUMIPSState *env, DisasContext *ctx)
             case OPC_LD_H:
             case OPC_LD_W:
             case OPC_LD_D:
+                save_cpu_state(ctx, 1);
                 gen_helper_msa_ld_df(cpu_env, tdf, twd, trs, ts10);
                 break;
             case OPC_ST_B:
             case OPC_ST_H:
             case OPC_ST_W:
             case OPC_ST_D:
+                save_cpu_state(ctx, 1);
                 gen_helper_msa_st_df(cpu_env, tdf, twd, trs, ts10);
                 break;
             }