diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-13 00:30:32 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-13 00:30:32 +0100 |
commit | 8721087661ea607ea68d45b4e518e53607cadbd3 (patch) | |
tree | 721324e1334330e2c865c2928348f80e4372989f /py/emitnative.c | |
parent | 82c7b1b1d5c8ce0467bd580a86d20c645cec17df (diff) | |
download | micropython-8721087661ea607ea68d45b4e518e53607cadbd3.tar.gz micropython-8721087661ea607ea68d45b4e518e53607cadbd3.zip |
py: Big improvements to inline assembler.
Improved the Thumb assembler back end. Added many more Thumb
instructions to the inline assembler. Improved parsing of assembler
instructions and arguments. Assembler functions can now be passed the
address of any object that supports the buffer protocol (to get the
address of the buffer). Added an example of how to sum numbers from
an array in assembler.
Diffstat (limited to 'py/emitnative.c')
-rw-r--r-- | py/emitnative.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/emitnative.c b/py/emitnative.c index 29da5b8c99..b5a3acc231 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -1020,7 +1020,7 @@ STATIC void emit_native_for_iter(emit_t *emit, uint label) { asm_x64_cmp_r64_with_r64(emit->as, REG_RET, REG_TEMP1); asm_x64_jcc_label(emit->as, JCC_JE, label); #elif N_THUMB - asm_thumb_cmp_reg_reg(emit->as, REG_RET, REG_TEMP1); + asm_thumb_cmp_rlo_rlo(emit->as, REG_RET, REG_TEMP1); asm_thumb_bcc_label(emit->as, THUMB_CC_EQ, label); #endif emit_post_push_reg(emit, VTYPE_PYOBJ, REG_RET); @@ -1067,10 +1067,10 @@ STATIC void emit_native_binary_op(emit_t *emit, mp_binary_op_t op) { asm_x64_cmp_r64_with_r64(emit->as, REG_ARG_3, REG_ARG_2); asm_x64_setcc_r8(emit->as, JCC_JL, REG_RET); #elif N_THUMB - asm_thumb_cmp_reg_reg(emit->as, REG_ARG_2, REG_ARG_3); + asm_thumb_cmp_rlo_rlo(emit->as, REG_ARG_2, REG_ARG_3); asm_thumb_ite_ge(emit->as); - asm_thumb_movs_rlo_i8(emit->as, REG_RET, 0); // if r0 >= r1 - asm_thumb_movs_rlo_i8(emit->as, REG_RET, 1); // if r0 < r1 + asm_thumb_mov_rlo_i8(emit->as, REG_RET, 0); // if r0 >= r1 + asm_thumb_mov_rlo_i8(emit->as, REG_RET, 1); // if r0 < r1 #endif emit_post_push_reg(emit, VTYPE_BOOL, REG_RET); } else { |