summaryrefslogtreecommitdiff
path: root/py/asmxtensa.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-03-18 12:30:09 +1100
committerDamien George <damien@micropython.org>2024-03-19 10:31:36 +1100
commitb50efbd0e319764dab3f49b64519cfea5f2c2bab (patch)
tree38ae2eb32880c40b616628e633a879def62b65db /py/asmxtensa.h
parentf52b0d0ff1788225fd61a748e0786aa90e953481 (diff)
py/asmxtensa: Optimise asm_xtensa_mov_reg_i32_optimised() for tiny ints.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/asmxtensa.h')
-rw-r--r--py/asmxtensa.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/asmxtensa.h b/py/asmxtensa.h
index aef9e7462..f226624a8 100644
--- a/py/asmxtensa.h
+++ b/py/asmxtensa.h
@@ -203,8 +203,9 @@ static inline void asm_xtensa_op_movi(asm_xtensa_t *as, uint reg_dest, int32_t i
asm_xtensa_op24(as, ASM_XTENSA_ENCODE_RRI8(2, 10, (imm12 >> 8) & 0xf, reg_dest, imm12 & 0xff));
}
-static inline void asm_xtensa_op_movi_n(asm_xtensa_t *as, uint reg_dest, int imm4) {
- asm_xtensa_op16(as, ASM_XTENSA_ENCODE_RI7(12, reg_dest, imm4));
+// Argument must be in the range (-32 .. 95) inclusive.
+static inline void asm_xtensa_op_movi_n(asm_xtensa_t *as, uint reg_dest, int imm7) {
+ asm_xtensa_op16(as, ASM_XTENSA_ENCODE_RI7(12, reg_dest, imm7));
}
static inline void asm_xtensa_op_mull(asm_xtensa_t *as, uint reg_dest, uint reg_src_a, uint reg_src_b) {