OSDN Git Service

target/riscv: riscv_tr_init_disas_context: copy pointer-to-cfg into cfg_ptr
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>
Wed, 2 Feb 2022 00:52:44 +0000 (01:52 +0100)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 16 Feb 2022 02:24:18 +0000 (12:24 +1000)
commit3b91323e33d85150eb482458b1f1e2b08a59d8a2
tree071e2fa7920693a8e4b6a379ada21cdfe75d41df
parent466292bd4aa0908794116d96dad816e4155e8b69
target/riscv: riscv_tr_init_disas_context: copy pointer-to-cfg into cfg_ptr

As the number of extensions is growing, copying them individiually
into the DisasContext will scale less and less... instead we populate
a pointer to the RISCVCPUConfig structure in the DisasContext.

This adds an extra indirection when checking for the availability of
an extension (compared to copying the fields into DisasContext).
While not a performance problem today, we can always (shallow) copy
the entire structure into the DisasContext (instead of putting a
pointer to it) if this is ever deemed necessary.

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220202005249.3566542-3-philipp.tomsich@vrull.eu>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/translate.c