@@ -439,7 +439,8 @@ struct CPUSPARCState {
target_ulong cond; /* conditional branch result (XXX: save it in a
temporary register when possible) */
-
+ target_ulong bcc_delayed; /* if 1, indicates the current instruction is
+ executing in a delay slot of a conditional branch
*/
uint32_t psr; /* processor state register */
target_ulong fsr; /* FPU state register */
CPU_DoubleU fpr[TARGET_DPREGS]; /* floating point registers */
@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/error-report.h"
#include "cpu.h"
#include "disas/disas.h"
@@ -45,6 +46,7 @@ static TCGv_ptr cpu_regwptr;
static TCGv cpu_cc_src, cpu_cc_src2, cpu_cc_dst;
static TCGv_i32 cpu_cc_op;
static TCGv_i32 cpu_psr;
+static TCGv_i32 bcc_delayed;
static TCGv cpu_fsr, cpu_pc, cpu_npc;
static TCGv cpu_regs[32];
static TCGv cpu_y;
@@ -69,6 +71,7 @@ typedef struct DisasContext {
target_ulong pc; /* current Program Counter: integer or DYNAMIC_PC */
target_ulong npc; /* next PC: integer or DYNAMIC_PC or JUMP_PC */
target_ulong jump_pc[2]; /* used when JUMP_PC pc value is used */
+ target_ulong bcc_delayed;
int is_br;
int mem_idx;
bool fpu_enabled;
@@ -1007,6 +1010,8 @@ static void gen_branch_n(DisasContext *dc, target_ulong
pc1)
dc->jump_pc[0] = pc1;
dc->jump_pc[1] = npc + 4;
dc->npc = JUMP_PC;
+ tcg_gen_movi_tl(bcc_delayed, 1);
+ dc->bcc_delayed = 1;
} else {
TCGv t, z;