Skip to content

Commit

Permalink
target/xtensa: Use env_archcpu() in update_c[compare|count]()
Browse files Browse the repository at this point in the history
When CPUArchState* is available (here CPUXtensaState*), we
can use the fast env_archcpu() macro to get ArchCPU* (here
XtensaCPU*). The QOM cast XTENSA_CPU() macro will be slower
when building with --enable-qom-cast-debug.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20231009110239.66778-5-philmd@linaro.org>
  • Loading branch information
philmd committed Nov 7, 2023
1 parent 2c6822c commit bcb9d2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/xtensa/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

void HELPER(update_ccount)(CPUXtensaState *env)
{
XtensaCPU *cpu = XTENSA_CPU(env_cpu(env));
XtensaCPU *cpu = env_archcpu(env);
uint64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);

env->ccount_time = now;
Expand All @@ -58,7 +58,7 @@ void HELPER(wsr_ccount)(CPUXtensaState *env, uint32_t v)

void HELPER(update_ccompare)(CPUXtensaState *env, uint32_t i)
{
XtensaCPU *cpu = XTENSA_CPU(env_cpu(env));
XtensaCPU *cpu = env_archcpu(env);
uint64_t dcc;

qatomic_and(&env->sregs[INTSET],
Expand Down

0 comments on commit bcb9d2e

Please sign in to comment.