Skip to content

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Sep 21, 2025

op_return implementation is expensive as it's returning to VM. Optimize it if we're staying in the same module.
This yields a 4% speed increase on the prng_test from the benchmark.

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 force-pushed the w39/optimize_op_return branch 5 times, most recently from e85b52b to a7d75a7 Compare September 28, 2025 22:07
@pguyot pguyot force-pushed the w39/optimize_op_return branch 3 times, most recently from a5d7ad3 to 04f4c63 Compare October 13, 2025 06:22
@pguyot pguyot force-pushed the w39/optimize_op_return branch 3 times, most recently from f3e67bc to 481c11c Compare October 14, 2025 19:50
@pguyot pguyot force-pushed the w39/optimize_op_return branch from 481c11c to 4e7c382 Compare October 19, 2025 10:51
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w39/optimize_op_return branch from 4e7c382 to 100d522 Compare October 22, 2025 21:10
@pguyot pguyot marked this pull request as ready for review October 22, 2025 21:10
@bettio bettio merged commit 8d6f071 into atomvm:main Oct 23, 2025
234 of 239 checks passed
@pguyot pguyot deleted the w39/optimize_op_return branch October 23, 2025 19:13
bettio added a commit that referenced this pull request Oct 25, 2025
…tforms-with-3-operands

JIT: optimize shift right for platforms with 3 operands

Continuation of #1838

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
bettio added a commit that referenced this pull request Dec 9, 2025
Just in time compilation for riscv32 architecture

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

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