diff options
| author | Alessandro Gatti <a.gatti@frob.it> | 2025-10-25 18:39:08 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-11-03 12:39:01 +1100 |
| commit | 3da529554d013cce2eec7736dea3f2c561563a52 (patch) | |
| tree | 3fbb068863062e51a107927d1bc6f761499e9ae0 /docs/esp32 | |
| parent | 27b7bf36a33f7c51a976c41b8682d7acfb4201cb (diff) | |
py/emitinlinerv32: Refactor opcode arguments validation.
This commit simplifies the way arguments are validated when processing
RV32 inline assembler opcodes.
Opcode arguments were handled in two separate passes, one that performed
a pure validation (with an early rejection in case of errors), and
another that converted the parse node into a serialised value but
without any error checking.
Considering that the validation pass effectively performed the parse
node conversion and then discarded its result once validated, it is
preferable to hold onto the serialised result to reuse it later at
opcode generation time.
With these changes, those two passes are merged into one single
operation when applicable (basically any opcode that doesn't use an
integer offset), removing a fair amount of duplicate code. The size
savings should be around half a kilobyte, with no other changes in the
assembler's behaviour.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'docs/esp32')
0 files changed, 0 insertions, 0 deletions
