qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v3] target/riscv: Implement dynamic establishment of custom d


From: Richard Henderson
Subject: Re: [PATCH v3] target/riscv: Implement dynamic establishment of custom decoder
Date: Wed, 13 Mar 2024 10:32:03 -1000
User-agent: Mozilla Thunderbird

On 3/12/24 23:57, Huang Tao wrote:
In this patch, we modify the decoder to be a freely composable data
structure instead of a hardcoded one. It can be dynamically builded up
according to the extensions.
This approach has several benefits:
1. Provides support for heterogeneous cpu architectures. As we add decoder in
    RISCVCPU, each cpu can have their own decoder, and the decoders can be
    different due to cpu's features.
2. Improve the decoding efficiency. We run the guard_func to see if the decoder
    can be added to the dynamic_decoder when building up the decoder. Therefore,
    there is no need to run the guard_func when decoding each instruction. It 
can
    improve the decoding efficiency
3. For vendor or dynamic cpus, it allows them to customize their own decoder
    functions to improve decoding efficiency, especially when vendor-defined
    instruction sets increase. Because of dynamic building up, it can skip the 
other
    decoder guard functions when decoding.
4. Pre patch for allowing adding a vendor decoder before decode_insn32() with 
minimal
    overhead for users that don't need this particular vendor deocder.

Signed-off-by: Huang Tao<eric.huang@linux.alibaba.com>
Suggested-by: Christoph Muellner<christoph.muellner@vrull.eu>
Co-authored-by: LIU Zhiwei<zhiwei_liu@linux.alibaba.com>
---

Changes in v3:
- use GPtrArray to save decode function poionter list.
---
  target/riscv/cpu.c         | 18 ++++++++++++++++++
  target/riscv/cpu.h         |  2 ++
  target/riscv/cpu_decoder.h | 34 ++++++++++++++++++++++++++++++++++
  target/riscv/translate.c   | 29 +++++++++++++----------------
  4 files changed, 67 insertions(+), 16 deletions(-)
  create mode 100644 target/riscv/cpu_decoder.h

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

r~



reply via email to

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