On Fri, 22 May 2026 09:13:57 GMT, Xueming Shen <[email protected]> wrote:
>> The Incubator Vector API (jdk.incubator.vector) currently uses SLEEF 3.6.1 >> for providing SIMD-accelerated transcendental and elementary math functions >> (e.g., sin, cos, exp, log, pow, hypot) on non-x86 platforms, (specifically >> aarch64 and riscv64). >> >> This PR upgrades the bundled SLEEF sources used by JDK from 3.6.1 to >> v3.9.0. >> >> Imported SLEEF upstream: >> - tag: 3.9.0 >> - commit hash: 906ca7512ee483296780a81a21b9ca715d40dfe1 >> >> The update work refreshes the upstream source snapshot and regenerates the >> SLEEF inline headers currently generated for the Vector API SLEEF platforms. >> >> Migration steps: >> >> 1. Imported the upstream SLEEF 3.9.0 source snapshot from the official SLEEF >> repository. >> 2. Copied the upstream files into the JDK SLEEF subtree, excluding >> repository/documentation-only files such as `.git`, `.github`, `docs`, and >> `.nojekyll`, as documented in the local SLEEF README. >> 3. Normalized the imported files according to the existing JDK import >> process, including whitespace/tab cleanup where needed. See >> [logs](https://cr.openjdk.org/~sherman/sleef-3.9.0-upstream-import-trace.pdf) >> for details >> 4. Updated the SLEEF metadata in the JDK README/legal files to record the >> 3.9.0 tag and exact upstream commit. >> 5. Updated `make/UpdateSleefSource.gmk` for the SLEEF 3.9.0 generation flow, >> including disabling SLEEF test/SSL/TLFloat pieces that are not needed for >> generating the JDK inline headers. >> 6. Ran `make update-sleef-source` for the Linux AArch64 and RISC-V cross >> configurations. >> 7. Verified and checked in the regenerated SLEEF inline headers for the >> Vector API SLEEF platforms. >> 8. Added a targeted HotSpot IR-framework test that verifies SLEEF-backed >> Vector API transcendental operations are lowered to the native vector math >> library call path on supported platforms. The test covers the SLEEF-provided >> `float` and `double` unary/binary operations. >> 9. Ran clean build and testing, including local Vector API jtreg testing and >> internal Mach5 tier1/tier2/tier3 validation ([mach5 >> results](https://mach5.us.oracle.com/mdash/jobs/xuemingshen-jdk-8376602-2-20260521-2059-45610732)). >> 10. Ran a local Vector API transcendental microbenchmark comparison using >> [VectorTranscendentalBenchmark2](https://cr.openjdk.org/~sherman/8376602/VectorTranscendentalBenchmark2.java); >> the sampled 128-bit macOS AArch64 >> [results](https://cr.openjdk.org/~sherman/vector-transcendental-benchmark2-results.pdf) >> were broadly performance-neutral to modestly positive for SLE... > > Xueming Shen has updated the pull request incrementally with one additional > commit since the last revision: > > Update sleef.md Nice work, very thorough. You have this comment in the tests: > // TANH is not included because VectorMathLibrary.SLEEF intentionally > rejects it. In `VectorMathLibrary.SLEEF`: if (op == TANH) { return false; // skip due to performance considerations } Are the performance considerations the same in the updated SLEEF version? test/hotspot/jtreg/compiler/vectorapi/TestVectorLibrarySleefUnaryOpAndBinaryOp.java line 56: > 54: * (os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*") > 55: * @summary VectorAPI: SLEEF unary and binary math library operations > should be intrinsified. > 56: * This test would be run on SVML/SLEEF supported platforms only. Suggestion: * This test is run on SVML/SLEEF supported platforms only. ------------- Marked as reviewed by psandoz (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/29703#pullrequestreview-4347219017 PR Review Comment: https://git.openjdk.org/jdk/pull/29703#discussion_r3289868596
