feat: add 32-bit assembly checksum backends (ARM, x86, RV32, MIPS32, PowerPC)#27
Merged
Merged
Conversation
…PowerPC) Scalar CRC-32/MD5/SHA-256 assembly for arm, x86 (i386), riscv32, mips and powerpc, selected via host_machine.cpu_family(). Endian-independent (byte-wise message loading; verified on big-endian MIPS and PowerPC) and position-independent so they link into the shared library. Adds cross files and an arch-asm + armhf CI job. Closes NurOS-Linux#21 Closes NurOS-Linux#22 Closes NurOS-Linux#23 Closes NurOS-Linux#24 Closes NurOS-Linux#25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optimized scalar assembly implementations of the checksum backend
(CRC-32, MD5, SHA-256) for five 32-bit architectures, extending the existing
64-bit backends (x86-64, aarch64, riscv64, mips64) to 32-bit targets:
arch/arm/— ARM (AArch32 / ARMv7)arch/x86/— x86 (i386 / IA-32)arch/riscv32/— RISC-V (RV32)arch/mips/— MIPS32 (MIPS32r2)arch/powerpc/— PowerPC (32-bit)Each backend implements the ABI the C drivers already dispatch to
(
apg_<algo>_hw_supported/apg_<algo>_transform_hw/apg_crc32_update_hw)and is selected at build time in
meson.buildviahost_machine.cpu_family().Message words are assembled byte-wise (endian-independent) and symbol addressing
is position-independent, so the backends link cleanly into the shared library.
Type of Change
Related Issues
Checklist
Testing
For every target the library's own C checksum drivers were built against the new
assembly and the full CRC-32, MD5 and SHA-256 were computed over test vectors
(empty input, sub-block, exact block, multi-block, odd tails, all-byte-value
data), with digests compared byte-for-byte against independent reference values.
Verified under QEMU user-mode on
arm,i386,riscv32,mipsel, big-endianmips, andpowerpc(big-endian MIPS and PowerPC confirm endian independence).PIC-safety was checked by assembling each backend with
-fPICand linking ashared object with
-Wl,-z,text. Nativex86_64build and the existing testsuite continue to pass unchanged.
New
cross-*.txtfiles and CI coverage were added: anarch-asmjob thatassembles and PIC-links every 32-bit backend, plus a full
armhfcross job.Additional Notes
Base integer instructions only (no crypto extensions), matching the existing
mips64 backend;
-marchis raised only where encodings require it (armv7-afor
movw/movt,mips32r2forrotr).