mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-10-20 15:08:18 +02:00
tcg/aarch64: Add support for fence
Backports commit c7a59c2a92592e556b9361437c9c4229917bd1e3 from qemu
This commit is contained in:
parent
d49bd55f52
commit
907060b865
@ -376,6 +376,11 @@ typedef enum {
|
|||||||
I3510_EOR = 0x4a000000,
|
I3510_EOR = 0x4a000000,
|
||||||
I3510_EON = 0x4a200000,
|
I3510_EON = 0x4a200000,
|
||||||
I3510_ANDS = 0x6a000000,
|
I3510_ANDS = 0x6a000000,
|
||||||
|
|
||||||
|
/* System instructions. */
|
||||||
|
DMB_ISH = 0xd50338bf,
|
||||||
|
DMB_LD = 0x00000100,
|
||||||
|
DMB_ST = 0x00000200,
|
||||||
} AArch64Insn;
|
} AArch64Insn;
|
||||||
|
|
||||||
static inline uint32_t tcg_in32(TCGContext *s)
|
static inline uint32_t tcg_in32(TCGContext *s)
|
||||||
@ -985,6 +990,29 @@ static inline void tcg_out_addsub2(TCGContext *s, int ext, TCGReg rl,
|
|||||||
tcg_out_mov(s, ext, orig_rl, rl);
|
tcg_out_mov(s, ext, orig_rl, rl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void tcg_out_mb(TCGContext *s, TCGArg a0)
|
||||||
|
{
|
||||||
|
static const uint32_t sync[] = {
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD,
|
||||||
|
DMB_ISH | DMB_LD,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST,
|
||||||
|
DMB_ISH | DMB_LD | DMB_ST, // 0xF
|
||||||
|
};
|
||||||
|
tcg_out32(s, sync[a0 & TCG_MO_ALL]);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SOFTMMU
|
#ifdef CONFIG_SOFTMMU
|
||||||
/* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
|
/* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
|
||||||
* TCGMemOpIdx oi, uintptr_t ra)
|
* TCGMemOpIdx oi, uintptr_t ra)
|
||||||
@ -1653,6 +1681,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
|
|||||||
tcg_out_insn(s, 3508, SMULH, TCG_TYPE_I64, a0, a1, a2);
|
tcg_out_insn(s, 3508, SMULH, TCG_TYPE_I64, a0, a1, a2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case INDEX_op_mb:
|
||||||
|
tcg_out_mb(s, a0);
|
||||||
|
break;
|
||||||
|
|
||||||
case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */
|
case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */
|
||||||
case INDEX_op_mov_i64:
|
case INDEX_op_mov_i64:
|
||||||
case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */
|
case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */
|
||||||
@ -1777,6 +1809,7 @@ static const TCGTargetOpDef aarch64_op_defs[] = {
|
|||||||
{ INDEX_op_muluh_i64, { "r", "r", "r" } },
|
{ INDEX_op_muluh_i64, { "r", "r", "r" } },
|
||||||
{ INDEX_op_mulsh_i64, { "r", "r", "r" } },
|
{ INDEX_op_mulsh_i64, { "r", "r", "r" } },
|
||||||
|
|
||||||
|
{ INDEX_op_mb, { } },
|
||||||
{ -1 },
|
{ -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user