|
| From: | Richard Henderson |
| Subject: | Re: [PATCH v3 5/7] target/riscv: iterate over a table of decoders |
| Date: | Mon, 31 Jan 2022 07:56:03 +1100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 1/29/22 01:56, Philipp Tomsich wrote:
- if (!decode_insn16(ctx, opcode)) {
- gen_exception_illegal(ctx);
- }
+ if (decode_insn16(ctx, opcode))
+ return;
...
- if (!decode_insn32(ctx, opcode32)) {
- gen_exception_illegal(ctx);
+
+ for (size_t i = 0; i < ARRAY_SIZE(decoders); ++i) {
+ if (!decoders[i].guard_func(ctx))
+ continue;
+
+ if (decoders[i].decode_func(ctx, opcode32))
+ return;
Missing braces, per style. Otherwise, Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
| [Prev in Thread] | Current Thread | [Next in Thread] |