Releases: libriscv/libloong
v0.7: Go bindings and macOS support
The new Go bindings try to match the Rust bindings for parity. A macOS CI action has been added to verify the CLI builds and runs there as well. More optimizations have gone into bytecodes, however the needle has not moved.
Recent Changes
v0.6: Rust bindings
There are now Rust bindings with crate package support and .deb package support.
- Rust bindings and crate support
- .deb package support
- LASX support is now a CMake build option
Full Changelog: v0.5...v0.6
v0.5: Fixes and performance
This release improves the performance of memory operations, especially for JIT.
- New shared arena mode where both Machine and memory arena reside on the same larger arena, allowing memory operations to access memory relative to the CPU
- Merge memory accesses to the same register and nearby offset in binary translation, avoiding many checks
- Add some missing instructions in binary translation
- Add Fuzzer CI job
Full Changelog: v0.4...v0.5
v0.4: Embeddable binary translations
In this release embeddable binary translations have been implemented. They are C source files that can be generated by the emulator library based on an ELF file and the current configuration of the Machine. It can then be compiled by a system compiler, and included in a regular system binary. It will self-register to the libloong emulator and accelerate the program it was generated from. In this case, we accelerate CoreMark, and reach ~75% of native performance:
$ ./laemu --fast -O coremark.c ../tests/programs/coremark.elf
$ bash build.sh --native --lto --embed coremark.c
$ ./laemu --fast ../tests/programs/coremark.elf
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 13101131
Total time (secs): 13.101131
Iterations/Sec : 30531.715163
Iterations : 400000
Compiler version : GCC14.2.0
Compiler flags : -O3 -DPERFORMANCE_RUN=1
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x65c5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 30531.715163 / GCC14.2.0 -O3 -DPERFORMANCE_RUN=1 / Static
Program exited with code 0 (16.746 seconds)
Full Changelog: v0.3...v0.4
Windows MinGW support
This release adds initial Windows support with working JIT. libloong now also has shared execute segments, which makes it able to scalable in the engine architecture with many copies of the same program. Finally, the binary translator now has a background compilation mode where the most expensive compilation can happen in another thread while the emulator is running. The result gets live-patched into the execute segment.
Also reached a new CoreMark score with some improvements to binary translator:
$ ./laemu --fast ../tests/programs/coremark.elf
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 12798197
Total time (secs): 12.798197
Iterations/Sec : 15627.201238
Iterations : 200000
Compiler version : GCC14.2.0
Compiler flags : -O3 -DPERFORMANCE_RUN=1
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x4983
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 15627.201238 / GCC14.2.0 -O3 -DPERFORMANCE_RUN=1 / Static
Program exited with code 0It's now at ~38% of native, and gets compiled and applied in the background allowing emulator to start immediately.
Full Changelog: v0.2...v0.3
Binary translation
Initial binary translation using embedded TinyCC as just-in-time compiler
$ ./laemu ../tests/programs/coremark.elf
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 16665649
Total time (secs): 16.665649
Iterations/Sec : 12000.732765
Iterations : 200000
Compiler version : GCC14.2.0
Compiler flags : -O3 -DPERFORMANCE_RUN=1
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x4983
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 12000.732765 / GCC14.2.0 -O3 -DPERFORMANCE_RUN=1 / Static
Program exited with code 0
Note: Binary translation currently uses and-masking for memory ops, which means that permissions aren't enforced. It's all writable, but still sandboxed.
v0.1: Initial release
In this release a 3000+ CoreMark score was reached. Some programs are running smoothly, others are not.
$ ./laemu ../tests/programs/coremark.elf
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 13009150
Total time (secs): 13.009150
Iterations/Sec : 3074.758920
Iterations : 40000
Compiler version : GCC14.2.0
Compiler flags : -O3 -DPERFORMANCE_RUN=1
Memory location : Please put data memory location here
(e.g. code in flash, data on heap etc)
seedcrc : 0xe9f5
[0]crclist : 0xe714
[0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a
[0]crcfinal : 0x25b5
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 3074.758920 / GCC14.2.0 -O3 -DPERFORMANCE_RUN=1 / Static
Program exited with code 0