mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
This commit introduces a new generic ASM API function to clear a register (i.e. clearing all the registers' bits). The native emitter used to perform a XOR operation to clear a given register, but different platform have more optimised method to achieve the same result taking up less space - either for the generated code or for the code generator itself. Arm, RV32, X86, and X64 already had an already optimised generator and generated optimised code. The code generator when build for Thumb takes less space generating a constant immediate move rather than a XOR operation, even though both operations would distill down to a single narrow opcode. On Xtensa the situation is almost the same as Thumb, with the exception that a constant immediate move would take one byte less than a XOR operation. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
21 KiB
21 KiB