RFR: 8320500: [vectorapi] RISC-V: Optimize vector math operations with SLEEF

Hamlin Li mli at openjdk.org
Thu Sep 19 16:37:40 UTC 2024


On Thu, 19 Sep 2024 16:02:36 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Thanks, do you mean something like below? I'll fix it.
>> 
>> CFLAGS := $(CFLAGS_JDKLIB) $(C_O_FLAG_HI) -march=rv64gcv, \
>
> Sorry, I had to remind myself of how this works. We actually set this as a separate parameter on the Setup macro: `OPTIMIZATION := HIGH`

Thanks. I'm sorry too, I'm not familiar with the build system.
What you expected could be something like below?

diff --git a/make/modules/jdk.incubator.vector/Lib.gmk b/make/modules/jdk.incubator.vector/Lib.gmk
index 5e52277919a..c6c6103a301 100644
--- a/make/modules/jdk.incubator.vector/Lib.gmk
+++ b/make/modules/jdk.incubator.vector/Lib.gmk
@@ -41,11 +41,12 @@ endif
 ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, riscv64)+$(INCLUDE_COMPILER2), true+true+true)
   $(eval $(call SetupJdkLibrary, BUILD_LIBSLEEF, \
       NAME := sleef, \
+      OPTIMIZATION := HIGH, \
       SRC := libsleef/lib, \
       EXTRA_SRC := libsleef/generated, \
       DISABLED_WARNINGS_gcc := unused-function sign-compare tautological-compare ignored-qualifiers, \
       DISABLED_WARNINGS_clang := unused-function sign-compare tautological-compare ignored-qualifiers, \
-      CFLAGS := $(CFLAGS_JDKLIB) -O3 -march=rv64gcv, \
+      CFLAGS := $(CFLAGS_JDKLIB) -march=rv64gcv, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
       LIBS := $(JDKLIB_LIBS) \

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21083#discussion_r1767158779


More information about the build-dev mailing list