diff options
author | Alessandro Gatti <a.gatti@frob.it> | 2025-08-17 07:28:35 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-08-19 12:40:29 +1000 |
commit | bd413d3d853e2c1fc0382b328176ff912d79da70 (patch) | |
tree | 330a870baedad7f8aebc138cddc0d97419ea9e50 /tests/micropython | |
parent | 22deeeb8db1305b292e9146b7b00a58207755693 (diff) |
py/asmthumb: Fix T3 encoding of conditional branches.
This commit fixes the encoding of conditional branch opcodes emitted for
ARMv7-M targets, when the emitter decides to use the T3 encoding for
said operation.
Fields J1 and J2 are now present in the generated opcode word, along
with correcting some minor issues in bitmasks and shifts computation.
This fixes #17940.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'tests/micropython')
-rw-r--r-- | tests/micropython/viper_large_jump.py | 20 | ||||
-rw-r--r-- | tests/micropython/viper_large_jump.py.exp | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/micropython/viper_large_jump.py b/tests/micropython/viper_large_jump.py new file mode 100644 index 000000000..1c5913dec --- /dev/null +++ b/tests/micropython/viper_large_jump.py @@ -0,0 +1,20 @@ +COUNT = 600 + + +try: + code = """ +@micropython.viper +def f() -> int: + x = 0 + while x < 10: +""" + for i in range(COUNT): + code += " x += 1\n" + code += " return x" + exec(code) +except MemoryError: + print("SKIP-TOO-LARGE") + raise SystemExit + + +print(f()) diff --git a/tests/micropython/viper_large_jump.py.exp b/tests/micropython/viper_large_jump.py.exp new file mode 100644 index 000000000..e9f960cf4 --- /dev/null +++ b/tests/micropython/viper_large_jump.py.exp @@ -0,0 +1 @@ +600 |