qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] target/hppa: Speed up hppa_is_pa20()


From: Richard Henderson
Subject: Re: [PATCH 2/2] target/hppa: Speed up hppa_is_pa20()
Date: Sun, 29 Dec 2024 16:07:38 -0800
User-agent: Mozilla Thunderbird

On 12/29/24 15:41, deller@kernel.org wrote:
From: Helge Deller<deller@gmx.de>

Although the hppa_is_pa20() helper is costly due to string comparisons
in object_dynamic_cast(), it is called quite often during memory lookups
and at each start of a block of instruction translations.
Speed hppa_is_pa20() up by calling object_dynamic_cast() only once at
CPU creation and store the result in the is_pa20 of struct CPUArchState.

Signed-off-by: Helge Deller<deller@gmx.de>
Reviewed-by: Philippe Mathieu-Daudé<philmd@linaro.org>

v3:
- use !!object_dynamic_cast()
- typo fix in commit message
   (feedback by Philippe Mathieu-Daudé)

v2:
- moved init to hppa_cpu_initfn() and is_pa20 to end of CPUArchState struct
   (feedback by Richard Henderson)
---
  target/hppa/cpu.c | 1 +
  target/hppa/cpu.h | 4 +++-
  2 files changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]