mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
This commit adds support for Zba opcodes to the RV32 inline assembler. Three new opcodes were added, SH1ADD, SH2ADD, and SH3ADD, which performs a scaled addition (by 1, 2, or 3 bits respectively). At the moment only qemu's VIRT_RV32 and rp2's RPI_PICO2/RPI_PICO2_W ports support these opcodes (the latter only when using the RISCV variant). Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
11 lines
134 B
Python
11 lines
134 B
Python
# check if RISC-V 32 inline asm supported Zba opcodes
|
|
|
|
|
|
@micropython.asm_rv32
|
|
def f():
|
|
sh1add(a0, a0, a0)
|
|
|
|
|
|
f()
|
|
print("rv32_zba")
|