mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-25 21:41:11 +00:00
tcg: Remove CF_IGNORE_ICOUNT
Now that we have curr_cflags, we can include CF_USE_ICOUNT early and then remove it as necessary. Backports commit 416986d3f97329655e30da7271a2d11c6d707b06 from qemu
This commit is contained in:
parent
f04beeea78
commit
35e551dc45
|
@ -93,17 +93,18 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
|
||||||
{
|
{
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
CPUArchState *env = (CPUArchState *)cpu->env_ptr;
|
CPUArchState *env = (CPUArchState *)cpu->env_ptr;
|
||||||
|
uint32_t cflags = curr_cflags(cpu->uc) | CF_NOCACHE;
|
||||||
|
|
||||||
|
if (ignore_icount) {
|
||||||
|
cflags &= ~CF_USE_ICOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
/* Should never happen.
|
/* Should never happen.
|
||||||
We only end up here when an existing TB is too long. */
|
We only end up here when an existing TB is too long. */
|
||||||
if (max_cycles > CF_COUNT_MASK) {
|
cflags |= MIN(max_cycles, CF_COUNT_MASK);
|
||||||
max_cycles = CF_COUNT_MASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base, orig_tb->flags,
|
tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base,
|
||||||
max_cycles | CF_NOCACHE
|
orig_tb->flags, cflags);
|
||||||
| 0
|
|
||||||
| curr_cflags(cpu->uc));
|
|
||||||
tb->orig_tb = orig_tb;
|
tb->orig_tb = orig_tb;
|
||||||
/* execute the generated code */
|
/* execute the generated code */
|
||||||
// Unicorn: commented out
|
// Unicorn: commented out
|
||||||
|
@ -479,7 +480,7 @@ void cpu_exec_step_atomic(struct uc_struct *uc, CPUState *cpu)
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
target_ulong cs_base, pc;
|
target_ulong cs_base, pc;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
uint32_t cflags = 1 | CF_IGNORE_ICOUNT;
|
uint32_t cflags = 1;
|
||||||
uint32_t cf_mask = cflags & CF_HASH_MASK;
|
uint32_t cf_mask = cflags & CF_HASH_MASK;
|
||||||
|
|
||||||
if (sigsetjmp(cpu->jmp_env, 0) == 0) {
|
if (sigsetjmp(cpu->jmp_env, 0) == 0) {
|
||||||
|
|
|
@ -1316,10 +1316,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
phys_pc = get_page_addr_code(env, pc);
|
phys_pc = get_page_addr_code(env, pc);
|
||||||
/* UNICORN: Commented out
|
|
||||||
if (use_icount) {
|
|
||||||
cflags |= CF_USE_ICOUNT;
|
|
||||||
}*/
|
|
||||||
tb = tb_alloc(env->uc, pc);
|
tb = tb_alloc(env->uc, pc);
|
||||||
if (unlikely(!tb)) {
|
if (unlikely(!tb)) {
|
||||||
buffer_overflow:
|
buffer_overflow:
|
||||||
|
|
|
@ -224,13 +224,12 @@ struct TranslationBlock {
|
||||||
size <= TARGET_PAGE_SIZE) */
|
size <= TARGET_PAGE_SIZE) */
|
||||||
uint16_t icount;
|
uint16_t icount;
|
||||||
uint32_t cflags; /* compile flags */
|
uint32_t cflags; /* compile flags */
|
||||||
#define CF_COUNT_MASK 0x7fff
|
#define CF_COUNT_MASK 0x00007fff
|
||||||
#define CF_LAST_IO 0x8000 /* Last insn may be an IO access. */
|
#define CF_LAST_IO 0x00008000 /* Last insn may be an IO access. */
|
||||||
#define CF_NOCACHE 0x10000 /* To be freed after execution */
|
#define CF_NOCACHE 0x00010000 /* To be freed after execution */
|
||||||
#define CF_USE_ICOUNT 0x20000
|
#define CF_USE_ICOUNT 0x00020000
|
||||||
#define CF_IGNORE_ICOUNT 0x40000 /* Do not generate icount code */
|
#define CF_INVALID 0x00040000 /* TB is stale. Setters need tb_lock */
|
||||||
#define CF_INVALID 0x80000 /* TB is stale. Setters must acquire tb_lock */
|
#define CF_PARALLEL 0x00080000 /* Generate code for a parallel context */
|
||||||
#define CF_PARALLEL 0x100000 /* Generate code for a parallel context */
|
|
||||||
/* cflags' mask for hashing/comparison */
|
/* cflags' mask for hashing/comparison */
|
||||||
#define CF_HASH_MASK \
|
#define CF_HASH_MASK \
|
||||||
(CF_COUNT_MASK | CF_LAST_IO | CF_USE_ICOUNT | CF_PARALLEL)
|
(CF_COUNT_MASK | CF_LAST_IO | CF_USE_ICOUNT | CF_PARALLEL)
|
||||||
|
@ -283,7 +282,9 @@ static inline uint32_t tb_cflags(const TranslationBlock *tb)
|
||||||
/* current cflags for hashing/comparison */
|
/* current cflags for hashing/comparison */
|
||||||
static inline uint32_t curr_cflags(struct uc_struct *uc)
|
static inline uint32_t curr_cflags(struct uc_struct *uc)
|
||||||
{
|
{
|
||||||
return uc->parallel_cpus ? CF_PARALLEL : 0;
|
return (uc->parallel_cpus ? CF_PARALLEL : 0);
|
||||||
|
// Unicorn: commented out
|
||||||
|
// | (use_icount ? CF_USE_ICOUNT : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tb_free(struct uc_struct *uc, TranslationBlock *tb);
|
void tb_free(struct uc_struct *uc, TranslationBlock *tb);
|
||||||
|
|
Loading…
Reference in a new issue