Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Sep 17, 2025

Continuation of:

The target is suitable for Pico, Pico2 and STM32.
Benchmark test on a Pico with SMP disabled shows a speed increase from 14% to 62%.

  native (w34/jit-arm) emulated (main) -- d8ecc02 %
pingpong_speed_test 17437587 27590085 37 %
prime_speed_test 13257293 35212412 62 %
prng_test 1128949 1500967 25 %
pi_test 26759537 58693061 54 %
sudoku_solution_test 6420801 7471461 14 %
sudoku_puzzle_test 254335968 333834045 24 %

Remark: the current backend requires 64 bits floats. 32 bits floats would need a specific variant.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@pguyot pguyot changed the title JIT: armv6m backend Just in time compilation with armv6m target Sep 19, 2025
@pguyot pguyot force-pushed the w34/jit-arm branch 4 times, most recently from 296cfdf to 5495868 Compare September 25, 2025 20:18
@pguyot pguyot force-pushed the w34/jit-arm branch 2 times, most recently from 738116d to cadf388 Compare October 5, 2025 05:26
@pguyot pguyot force-pushed the w34/jit-arm branch 4 times, most recently from 4b19f78 to 4b3b536 Compare October 8, 2025 05:07
@pguyot pguyot force-pushed the w34/jit-arm branch 13 times, most recently from 05dd2fc to d4ea03a Compare October 13, 2025 05:30
pguyot added 24 commits October 22, 2025 20:11
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@bettio bettio merged commit 378fd60 into atomvm:main Oct 22, 2025
187 of 195 checks passed
@pguyot pguyot deleted the w34/jit-arm branch October 23, 2025 05:21
bettio added a commit that referenced this pull request Oct 23, 2025
…single-precision-floats

JIT: add float32 variant for single precision floats

Continuation of #1829

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
bettio added a commit that referenced this pull request Nov 6, 2025
Embedded JIT mode for Pico

Continuation of:
- #1829
- #1838
- #1881
- #1891
- #1893
- #1900
- #1901
- #1903
- #1907

Add the ability to perform just in time compilation directly on Raspberry Pi
Pico. Erlang bytecode is compiled to armv6m on the first run and directly
executed on subsequent runs. In this PR, the native code compilation does not
take advantage of being done on the device, it still generates position
independent code.

If Erlang modules include `Type` chunk, the same optimizations that happen on
the desktop with precompilation could be done on the Pico, however current
release (0.7.5) of [`packbeam`](https://github.com/atomvm/atomvm_packbeam)
prunes the `Type` chunk.

Just in time compilation on the Pico is achieved by:
- Adding a flush call after JIT is performed, which is noop on all platforms
except on armv6m where we flush the literal pool (normally a noop, though, as
the pool should have been flushed earlier).
- Updating avm API to fetch the last section named end.
- Adding a `jit_stream_flash` for RP2 platform and adding a cache native code
mechanism that rely on the avm end section on RP2 to find out where to flash
jit code (after the last end) and detect if avm were updated.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants