RFR: 8312425: [vectorapi] AArch64: Optimize vector math operations with SLEEF [v11]

Hamlin Li mli at openjdk.org
Fri Jul 19 07:20:43 UTC 2024


On Thu, 18 Jul 2024 20:50:14 GMT, fitzsim <duke at openjdk.org> wrote:

> It is possible to regenerate `sleefinline_advsimd.h` and `sleefinline_sve.h` with some new OpenJDK build logic and only the following fifteen SLEEF source files:
> 
> ```
> 32K	./src/jdk.incubator.vector/linux/native/sleef/src/arch/helperadvsimd.h
> 40K	./src/jdk.incubator.vector/linux/native/sleef/src/arch/helpersve.h
> 8.0K	./src/jdk.incubator.vector/linux/native/sleef/src/common/addSuffix.c
> 20K	./src/jdk.incubator.vector/linux/native/sleef/src/common/commonfuncs.h
> 16K	./src/jdk.incubator.vector/linux/native/sleef/src/common/dd.h
> 20K	./src/jdk.incubator.vector/linux/native/sleef/src/common/df.h
> 4.0K	./src/jdk.incubator.vector/linux/native/sleef/src/common/estrin.h
> 12K	./src/jdk.incubator.vector/linux/native/sleef/src/common/keywords.txt
> 12K	./src/jdk.incubator.vector/linux/native/sleef/src/common/misc.h
> 4.0K	./src/jdk.incubator.vector/linux/native/sleef/src/common/quaddef.h
> 4.0K	./src/jdk.incubator.vector/linux/native/sleef/src/libm/funcproto.h
> 20K	./src/jdk.incubator.vector/linux/native/sleef/src/libm/mkrename.c
> 116K	./src/jdk.incubator.vector/linux/native/sleef/src/libm/sleefinline_header.h.org
> 164K	./src/jdk.incubator.vector/linux/native/sleef/src/libm/sleefsimddp.c
> 152K	./src/jdk.incubator.vector/linux/native/sleef/src/libm/sleefsimdsp.c
> 624K	total
> ```
> 
> I was able to extract the shell and C preprocessing steps from the upstream CMake-based build system (by adding `--verbose` to `cmake --build` in `createSleef.sh`) and convert them into an OpenJDK `.gmk` file.
> 
> [This branch](https://github.com/fitzsim/jdk/commits/regenerate-sleef-headers-1/) shows various approaches; ideas include:
> 
> * the fifteen source files are checked directly into the OpenJDK repository
> * a `--regenerate-sleef-headers` configure option that will cause the headers to be rebuilt as their dependencies change
> * a `make regenerate-sleef-headers` phony target that unconditionally rebuilds the headers
> * cross-compilation support when `--openjdk-target=aarch64-linux-gnu` is specified on an `x86-64` build machine
> * a README section with hints on how to maintain the OpenJDK build rules
> 

Really nice work, Thanks!

> Whenever the OpenJDK SLEEF source code copies were updated, one would also check for changes in the upstream CMake steps.

Compared to current implementation in https://github.com/openjdk/jdk/pull/19185, my bit concern about [This branch](https://github.com/fitzsim/jdk/commits/regenerate-sleef-headers-1/) is the future maintainence effort when we need to update the sleef source along with the cmake changes, also when new platforms support of sleef are added in jdk.

In another hand, I'm not sure if [This branch](https://github.com/fitzsim/jdk/commits/regenerate-sleef-headers-1/) qualify the traceability requirement discussed above.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18605#issuecomment-2238531577


More information about the build-dev mailing list