Repository navigation
jit: accelerate libm, SHA-256 and compiler hot paths - #9
Merged
Merged
Conversation
Lower FP control/status access and the remaining hot integer/SIMD helpers in glibc and GCC. Preserve atomic FP register writes during signal recovery. Add optional SHA-NI lowering with AVX2 fallback and clear upper YMM state before legacy SHA instructions. Batch shared-cache dependency reads and let code chunks grow on demand to 128 MiB to avoid GCC cache flushes. Add differential coverage and reproducible libm/SHA benchmarks, and fix errno translation in the userspace profiling harness.
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.
glibc's
sin,cosandatanstill entered helpers for FPCR reads and NEON bit selection. GCC also hit hundreds of thousands of integer/SIMD helpers and flushed its code cache during a small compilation. SHA-256 used an AVX2 expansion even on hosts with SHA-NI.This adds the missing hot instruction paths, optional SHA-NI lowering, and cheaper shared-cache validation.
syscall()errno conversion inkemu-user, needed to profile GCC's include search. Add a libm benchmark, SHA-256 to the crypto benchmark, a 195-form differential catalog, and CI coverage.Measurements against merged main
b4d3b1e, using identical AArch64 binaries in a local 2-vCPU l4h guest on an i7-13700H host. Libm and OpenSSL numbers are medians of three trials; the compiler rows separate the first compilation from the two subsequent runs. The host is shared, so timings vary.sincosatanThe libm repro uses GCC 14.2,
-O2 -static, without fast-math. SHA uses OpenSSL 3.5.7 withspeed -elapsed -seconds 2 -bytes 8192 -evp sha256. GCC 14.2 compiles and links the report'scbench.cwith-O2 -static -pthread -lm; its guest gets 1 GiB RAM. Native reference binaries run in the same guests.SHA now beats the ARM software path (117 MB/s); the native SHA reference is 897 MB/s. Trig remains about 4–5× native. GCC's
cc1helpers fall from 409,558 to 1,804 and its cache flushes from one to zero, but cold translation and code installation remain substantial: warm GCC is still roughly 9× native here.Validation completed: