Re: [PATCH v2] target/riscv: Implement dynamic establishment of custom decoder

2024-03-13 Thread Huang Tao
I'm sorry for making this mistake and thank you for your patience. In the next version, I will use GPtrArray you mentioned earlier to solve the problem. Thanks, Huang Tao On 2024/3/12 21:57, Richard Henderson wrote: On 3/11/24 19:45, Huang Tao wrote: +static void riscv_cpu_finalize_dynamic

Re: [PATCH v2] target/riscv: Implement dynamic establishment of custom decoder

2024-03-12 Thread Richard Henderson
On 3/11/24 19:45, Huang Tao wrote: +static void riscv_cpu_finalize_dynamic_decoder(RISCVCPU *cpu) +{ +decode_fn *dynamic_decoders; +dynamic_decoders = g_new0(decode_fn, decoder_table_size); Allocating ARRAY_SIZE(decoder_table)... +int j = 0; +for (size_t i = 0; i < decoder_tab

[PATCH v2] target/riscv: Implement dynamic establishment of custom decoder

2024-03-11 Thread Huang Tao
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