diff options
author | Damien George <damien@micropython.org> | 2024-03-18 12:29:11 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-03-19 10:31:36 +1100 |
commit | f52b0d0ff1788225fd61a748e0786aa90e953481 (patch) | |
tree | 61f99662e12760408831b85444477fe46212bbb9 /py/asmthumb.h | |
parent | d92dff881ca99281893b1d77eee4bf2eca25d0c8 (diff) |
py/asm: Add ASM_NOT_REG and ASM_NEG_REG macros for unary ops.
ASM_NOT_REG is optional, it can be synthesised by xor(reg, -1).
ASM_NEG_REG can also be synthesised with a subtraction, but most
architectures have a dedicated instruction for it.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/asmthumb.h')
-rw-r--r-- | py/asmthumb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/py/asmthumb.h b/py/asmthumb.h index 2829ac4c7..a9e68d7ad 100644 --- a/py/asmthumb.h +++ b/py/asmthumb.h @@ -406,6 +406,8 @@ void asm_thumb_b_rel12(asm_thumb_t *as, int rel); #define ASM_MOV_REG_LOCAL_ADDR(as, reg_dest, local_num) asm_thumb_mov_reg_local_addr((as), (reg_dest), (local_num)) #define ASM_MOV_REG_PCREL(as, rlo_dest, label) asm_thumb_mov_reg_pcrel((as), (rlo_dest), (label)) +#define ASM_NOT_REG(as, reg_dest) asm_thumb_mvn_rlo_rlo((as), (reg_dest), (reg_dest)) +#define ASM_NEG_REG(as, reg_dest) asm_thumb_neg_rlo_rlo((as), (reg_dest), (reg_dest)) #define ASM_LSL_REG_REG(as, reg_dest, reg_shift) asm_thumb_format_4((as), ASM_THUMB_FORMAT_4_LSL, (reg_dest), (reg_shift)) #define ASM_LSR_REG_REG(as, reg_dest, reg_shift) asm_thumb_format_4((as), ASM_THUMB_FORMAT_4_LSR, (reg_dest), (reg_shift)) #define ASM_ASR_REG_REG(as, reg_dest, reg_shift) asm_thumb_format_4((as), ASM_THUMB_FORMAT_4_ASR, (reg_dest), (reg_shift)) |