mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target/openrisc: Optimize for r0 being zero
The HW does not special-case r0, but the ABI specifies that r0 should contain 0. If we expose this fact to the optimizer, we can simplify a lot of the generated code. We must of course verify that r0==0, but that is trivial to do with a TB flag. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
a01deb36a6
commit
6597c28d61
3 changed files with 66 additions and 23 deletions
|
@ -389,6 +389,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu,
|
|||
#include "exec/cpu-all.h"
|
||||
|
||||
#define TB_FLAGS_DFLAG 1
|
||||
#define TB_FLAGS_R0_0 2
|
||||
#define TB_FLAGS_OVE SR_OVE
|
||||
|
||||
static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env,
|
||||
|
@ -397,7 +398,9 @@ static inline void cpu_get_tb_cpu_state(CPUOpenRISCState *env,
|
|||
{
|
||||
*pc = env->pc;
|
||||
*cs_base = 0;
|
||||
*flags = env->dflag | (env->sr & SR_OVE);
|
||||
*flags = (env->dflag
|
||||
| (env->gpr[0] == 0 ? TB_FLAGS_R0_0 : 0)
|
||||
| (env->sr & SR_OVE));
|
||||
}
|
||||
|
||||
static inline int cpu_mmu_index(CPUOpenRISCState *env, bool ifetch)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue