diff options
author | Alessandro Gatti <a.gatti@frob.it> | 2025-02-04 00:05:44 +0100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-02-07 17:45:10 +1100 |
commit | 44a7731669f1c8429bb61b790a7e8bf8a86b045d (patch) | |
tree | 5c3b1709b6ed95d617e7b417a290148545a1af8e /py | |
parent | e37d498cc0891b67ea6b782fc1e9b1b7dab3c740 (diff) | |
download | micropython-44a7731669f1c8429bb61b790a7e8bf8a86b045d.tar.gz micropython-44a7731669f1c8429bb61b790a7e8bf8a86b045d.zip |
py/emitnative: Load and store words just once for Viper code.
This commit fixes two Xtensa sequences in order to terminate early when
loading and storing word values via an immediate index.
This was meant to be part of 55ca3fd67512555707304c6b68b836eb89f09d1c
but whilst it was part of the code being tested, it didn't end up in the
commit.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'py')
-rw-r--r-- | py/emitnative.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index dd06447932..1aab0a9eb7 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1609,6 +1609,7 @@ static void emit_native_load_subscr(emit_t *emit) { #elif N_XTENSA || N_XTENSAWIN if (index_value > 0 && index_value < 256) { asm_xtensa_l32i_optimised(emit->as, REG_RET, reg_base, index_value); + break; } #endif need_reg_single(emit, reg_index, 0); @@ -1887,6 +1888,7 @@ static void emit_native_store_subscr(emit_t *emit) { #elif N_XTENSA || N_XTENSAWIN if (index_value > 0 && index_value < 256) { asm_xtensa_s32i_optimised(emit->as, REG_RET, reg_base, index_value); + break; } #elif N_ARM ASM_MOV_REG_IMM(emit->as, reg_index, index_value); |