Skip to content

Commit 3e349b4

Browse files
Sandhya ViswanathanVladimir Kozlov
authored andcommitted
8276025: Hotspot's libsvml.so may conflict with user dependency
Reviewed-by: kvn Backport-of: 9ad4d3d06bb356436d69af07726ef6727c500f59
1 parent 58a6dae commit 3e349b4

File tree

78 files changed

+17882
-17882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+17882
-17882
lines changed

make/modules/jdk.incubator.vector/Lib.gmk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ include LibCommon.gmk
2828
################################################################################
2929

3030
ifeq ($(call isTargetOs, linux windows)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2), true+true+true)
31-
$(eval $(call SetupJdkLibrary, BUILD_LIBSVML, \
32-
NAME := svml, \
31+
$(eval $(call SetupJdkLibrary, BUILD_LIBJSVML, \
32+
NAME := jsvml, \
3333
CFLAGS := $(CFLAGS_JDKLIB), \
3434
LDFLAGS := $(LDFLAGS_JDKLIB) \
3535
$(call SET_SHARED_LIBRARY_ORIGIN), \
3636
LDFLAGS_windows := -defaultlib:msvcrt, \
3737
))
3838

39-
TARGETS += $(BUILD_LIBSVML)
39+
TARGETS += $(BUILD_LIBJSVML)
4040
endif
4141

4242
################################################################################

src/hotspot/cpu/x86/stubGenerator_x86_64.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6999,15 +6999,15 @@ address generate_avx_ghash_processBlocks() {
69996999
}
70007000

70017001
// Get svml stub routine addresses
7002-
void *libsvml = NULL;
7002+
void *libjsvml = NULL;
70037003
char ebuf[1024];
70047004
char dll_name[JVM_MAXPATHLEN];
7005-
if (os::dll_locate_lib(dll_name, sizeof(dll_name), Arguments::get_dll_dir(), "svml")) {
7006-
libsvml = os::dll_load(dll_name, ebuf, sizeof ebuf);
7005+
if (os::dll_locate_lib(dll_name, sizeof(dll_name), Arguments::get_dll_dir(), "jsvml")) {
7006+
libjsvml = os::dll_load(dll_name, ebuf, sizeof ebuf);
70077007
}
7008-
if (libsvml != NULL) {
7008+
if (libjsvml != NULL) {
70097009
// SVML method naming convention
7010-
// All the methods are named as __svml_op<T><N>_ha_<VV>
7010+
// All the methods are named as __jsvml_op<T><N>_ha_<VV>
70117011
// Where:
70127012
// ha stands for high accuracy
70137013
// <T> is optional to indicate float/double
@@ -7018,22 +7018,22 @@ address generate_avx_ghash_processBlocks() {
70187018
// e.g. 128 bit float vector has 4 float elements
70197019
// <VV> indicates the avx/sse level:
70207020
// z0 is AVX512, l9 is AVX2, e9 is AVX1 and ex is for SSE2
7021-
// e.g. __svml_expf16_ha_z0 is the method for computing 16 element vector float exp using AVX 512 insns
7022-
// __svml_exp8_ha_z0 is the method for computing 8 element vector double exp using AVX 512 insns
7021+
// e.g. __jsvml_expf16_ha_z0 is the method for computing 16 element vector float exp using AVX 512 insns
7022+
// __jsvml_exp8_ha_z0 is the method for computing 8 element vector double exp using AVX 512 insns
70237023

7024-
log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, JNI_LIB_PREFIX "svml" JNI_LIB_SUFFIX, p2i(libsvml));
7024+
log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, JNI_LIB_PREFIX "jsvml" JNI_LIB_SUFFIX, p2i(libjsvml));
70257025
if (UseAVX > 2) {
70267026
for (int op = 0; op < VectorSupport::NUM_SVML_OP; op++) {
70277027
int vop = VectorSupport::VECTOR_OP_SVML_START + op;
70287028
if ((!VM_Version::supports_avx512dq()) &&
70297029
(vop == VectorSupport::VECTOR_OP_LOG || vop == VectorSupport::VECTOR_OP_LOG10 || vop == VectorSupport::VECTOR_OP_POW)) {
70307030
continue;
70317031
}
7032-
snprintf(ebuf, sizeof(ebuf), "__svml_%sf16_ha_z0", VectorSupport::svmlname[op]);
7033-
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libsvml, ebuf);
7032+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf16_ha_z0", VectorSupport::svmlname[op]);
7033+
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libjsvml, ebuf);
70347034

7035-
snprintf(ebuf, sizeof(ebuf), "__svml_%s8_ha_z0", VectorSupport::svmlname[op]);
7036-
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libsvml, ebuf);
7035+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%s8_ha_z0", VectorSupport::svmlname[op]);
7036+
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_512][op] = (address)os::dll_lookup(libjsvml, ebuf);
70377037
}
70387038
}
70397039
const char* avx_sse_str = (UseAVX >= 2) ? "l9" : ((UseAVX == 1) ? "e9" : "ex");
@@ -7042,23 +7042,23 @@ address generate_avx_ghash_processBlocks() {
70427042
if (vop == VectorSupport::VECTOR_OP_POW) {
70437043
continue;
70447044
}
7045-
snprintf(ebuf, sizeof(ebuf), "__svml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7046-
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libsvml, ebuf);
7045+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7046+
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libjsvml, ebuf);
70477047

7048-
snprintf(ebuf, sizeof(ebuf), "__svml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7049-
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libsvml, ebuf);
7048+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf4_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7049+
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libjsvml, ebuf);
70507050

7051-
snprintf(ebuf, sizeof(ebuf), "__svml_%sf8_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7052-
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libsvml, ebuf);
7051+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%sf8_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7052+
StubRoutines::_vector_f_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libjsvml, ebuf);
70537053

7054-
snprintf(ebuf, sizeof(ebuf), "__svml_%s1_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7055-
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libsvml, ebuf);
7054+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%s1_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7055+
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_64][op] = (address)os::dll_lookup(libjsvml, ebuf);
70567056

7057-
snprintf(ebuf, sizeof(ebuf), "__svml_%s2_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7058-
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libsvml, ebuf);
7057+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%s2_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7058+
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_128][op] = (address)os::dll_lookup(libjsvml, ebuf);
70597059

7060-
snprintf(ebuf, sizeof(ebuf), "__svml_%s4_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7061-
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libsvml, ebuf);
7060+
snprintf(ebuf, sizeof(ebuf), "__jsvml_%s4_ha_%s", VectorSupport::svmlname[op], avx_sse_str);
7061+
StubRoutines::_vector_d_math[VectorSupport::VEC_SIZE_256][op] = (address)os::dll_lookup(libjsvml, ebuf);
70627062
}
70637063
}
70647064
#endif // COMPILER2

0 commit comments

Comments
 (0)