Skip to content

Commit 780b0e6

Browse files
authored
Merge pull request #22251 from pshipton/vectorcpu
Implement jdk25 VectorSupport_getCPUFeatures
2 parents 0c18207 + 4d4358e commit 780b0e6

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

runtime/jcl/common/vectornatives.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,19 @@ Java_jdk_internal_vm_vector_VectorSupport_getMaxLaneCount(JNIEnv *env, jclass cl
7070
return laneCount;
7171
}
7272

73+
#if JAVA_SPEC_VERSION >= 25
74+
jstring JNICALL
75+
Java_jdk_internal_vm_vector_VectorSupport_getCPUFeatures(JNIEnv *env, jclass clazz)
76+
{
77+
char buf[1024];
78+
OMRPORT_ACCESS_FROM_J9VMTHREAD((J9VMThread *)env);
79+
OMRProcessorDesc processorDesc;
80+
buf[0] = '\0';
81+
if (0 == omrsysinfo_get_processor_description(&processorDesc)) {
82+
omrsysinfo_get_processor_feature_string(&processorDesc, buf, sizeof(buf));
83+
}
84+
return env->NewStringUTF(buf);
7385
}
86+
#endif /* JAVA_SPEC_VERSION >= 25 */
87+
88+
} /* extern "C" */

runtime/jcl/exports.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,3 +863,10 @@ if(NOT JAVA_SPEC_VERSION LESS 24)
863863
Java_com_ibm_oti_vm_VM_isYieldBlockedVirtualThreadsEnabled
864864
)
865865
endif()
866+
867+
# Java 25+
868+
if(NOT JAVA_SPEC_VERSION LESS 25)
869+
omr_add_exports(jclse
870+
Java_jdk_internal_vm_vector_VectorSupport_getCPUFeatures
871+
)
872+
endif()

runtime/oti/jclprots.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,10 @@ jint JNICALL
706706
Java_jdk_internal_vm_vector_VectorSupport_registerNatives(JNIEnv *env, jclass clazz);
707707
jint JNICALL
708708
Java_jdk_internal_vm_vector_VectorSupport_getMaxLaneCount(JNIEnv *env, jclass clazz, jclass elementType);
709-
709+
#if JAVA_SPEC_VERSION >= 25
710+
jstring JNICALL
711+
Java_jdk_internal_vm_vector_VectorSupport_getCPUFeatures(JNIEnv *env, jclass clazz);
712+
#endif /* JAVA_SPEC_VERSION >= 25 */
710713

711714
/* BBjclNativesCommonVM*/
712715
jint JNICALL Java_com_ibm_oti_vm_VM_getBootClassPathCount (JNIEnv * env, jclass clazz);

0 commit comments

Comments
 (0)