mirror of
				https://github.com/yuzu-emu/unicorn.git
				synced 2025-11-04 12:15:06 +00:00 
			
		
		
		
	target/arm: Reset btype for direct branches
This is all of the non-exception cases of DISAS_NORETURN. Backports commit 358622703583d2e2967e0a93da990e747dcc3ac6 from qemu
This commit is contained in:
		
							parent
							
								
									88193cf7c3
								
							
						
					
					
						commit
						11736a659b
					
				| 
						 | 
				
			
			@ -1434,6 +1434,7 @@ static void disas_uncond_b_imm(DisasContext *s, uint32_t insn)
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    /* B Branch / BL Branch with link */
 | 
			
		||||
    reset_btype(s);
 | 
			
		||||
    gen_goto_tb(s, 0, addr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1459,6 +1460,7 @@ static void disas_comp_b_imm(DisasContext *s, uint32_t insn)
 | 
			
		|||
    tcg_cmp = read_cpu_reg(s, rt, sf);
 | 
			
		||||
    label_match = gen_new_label(tcg_ctx);
 | 
			
		||||
 | 
			
		||||
    reset_btype(s);
 | 
			
		||||
    tcg_gen_brcondi_i64(tcg_ctx, op ? TCG_COND_NE : TCG_COND_EQ,
 | 
			
		||||
                        tcg_cmp, 0, label_match);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1489,6 +1491,8 @@ static void disas_test_b_imm(DisasContext *s, uint32_t insn)
 | 
			
		|||
    tcg_cmp = tcg_temp_new_i64(tcg_ctx);
 | 
			
		||||
    tcg_gen_andi_i64(tcg_ctx, tcg_cmp, cpu_reg(s, rt), (1ULL << bit_pos));
 | 
			
		||||
    label_match = gen_new_label(tcg_ctx);
 | 
			
		||||
 | 
			
		||||
    reset_btype(s);
 | 
			
		||||
    tcg_gen_brcondi_i64(tcg_ctx, op ? TCG_COND_NE : TCG_COND_EQ,
 | 
			
		||||
                        tcg_cmp, 0, label_match);
 | 
			
		||||
    tcg_temp_free_i64(tcg_ctx, tcg_cmp);
 | 
			
		||||
| 
						 | 
				
			
			@ -1516,6 +1520,7 @@ static void disas_cond_b_imm(DisasContext *s, uint32_t insn)
 | 
			
		|||
    addr = s->pc + sextract32(insn, 5, 19) * 4 - 4;
 | 
			
		||||
    cond = extract32(insn, 0, 4);
 | 
			
		||||
 | 
			
		||||
    reset_btype(s);
 | 
			
		||||
    if (cond < 0x0e) {
 | 
			
		||||
        /* genuinely conditional branches */
 | 
			
		||||
        TCGLabel *label_match = gen_new_label(tcg_ctx);
 | 
			
		||||
| 
						 | 
				
			
			@ -1678,6 +1683,7 @@ static void handle_sync(DisasContext *s, uint32_t insn,
 | 
			
		|||
         * a self-modified code correctly and also to take
 | 
			
		||||
         * any pending interrupts immediately.
 | 
			
		||||
         */
 | 
			
		||||
        reset_btype(s);
 | 
			
		||||
        gen_goto_tb(s, 0, s->pc);
 | 
			
		||||
        return;
 | 
			
		||||
    default:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue