< prev index next >
src/cpu/x86/vm/vm_version_x86.cpp
Print this page
@@ -467,10 +467,11 @@
__ addptr(rsp, 64);
#endif // _LP64
__ evmovdqul(xmm7, Address(rsp, 0), Assembler::AVX_512bit);
__ addptr(rsp, 64);
#endif // _WINDOWS
+ __ vzeroupper();
VM_Version::clean_cpuFeatures();
UseAVX = saved_useavx;
UseSSE = saved_usesse;
__ jmp(wrapup);
}
@@ -496,10 +497,11 @@
__ addptr(rsp, 32);
#endif // _LP64
__ vmovdqu(xmm7, Address(rsp, 0));
__ addptr(rsp, 32);
#endif // _WINDOWS
+ __ vzeroupper();
VM_Version::clean_cpuFeatures();
UseAVX = saved_useavx;
UseSSE = saved_usesse;
__ bind(wrapup);
@@ -617,21 +619,31 @@
}
if (UseAVX < 2)
_features &= ~CPU_AVX2;
- if (UseAVX < 1)
+ if (UseAVX < 1) {
_features &= ~CPU_AVX;
+ _features &= ~CPU_VZEROUPPER;
+ }
if (!UseAES && !FLAG_IS_DEFAULT(UseAES))
_features &= ~CPU_AES;
if (logical_processors_per_package() == 1) {
// HT processor could be installed on a system which doesn't support HT.
_features &= ~CPU_HT;
}
+ if( is_intel() ) { // Intel cpus specific settings
+ if ((cpu_family() == 0x06) &&
+ ((extended_cpu_model() == 0x57) || // Xeon Phi 3200/5200/7200
+ (extended_cpu_model() == 0x85))) { // Future Xeon Phi
+ _features &= ~CPU_VZEROUPPER;
+ }
+ }
+
char buf[256];
jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
cores_per_cpu(), threads_per_core(),
cpu_family(), _model, _stepping,
(supports_cmov() ? ", cmov" : ""),
@@ -916,20 +928,40 @@
if (MaxVectorSize > 0) {
if (!is_power_of_2(MaxVectorSize)) {
warning("MaxVectorSize must be a power of 2");
FLAG_SET_DEFAULT(MaxVectorSize, 64);
}
- if (MaxVectorSize > 64) {
- FLAG_SET_DEFAULT(MaxVectorSize, 64);
+ if (UseSSE < 2) {
+ // Vectors (in XMM) are only supported with SSE2+
+ if (MaxVectorSize > 0) {
+ if (!FLAG_IS_DEFAULT(MaxVectorSize))
+ warning("MaxVectorSize must be 0");
+ FLAG_SET_DEFAULT(MaxVectorSize, 0);
}
- if (MaxVectorSize > 16 && (UseAVX == 0 || !os_supports_avx_vectors())) {
+ }
+ else if (UseAVX == 0 || !os_supports_avx_vectors()) {
// 32 bytes vectors (in YMM) are only supported with AVX+
+ if (MaxVectorSize > 16) {
+ if (!FLAG_IS_DEFAULT(MaxVectorSize))
+ warning("MaxVectorSize must be <= 16");
FLAG_SET_DEFAULT(MaxVectorSize, 16);
}
- if (UseSSE < 2) {
- // Vectors (in XMM) are only supported with SSE2+
- FLAG_SET_DEFAULT(MaxVectorSize, 0);
+ }
+ else if (UseAVX == 1 || UseAVX == 2) {
+ // 64 bytes vectors (in ZMM) are only supported with AVX 3
+ if (MaxVectorSize > 32) {
+ if (!FLAG_IS_DEFAULT(MaxVectorSize))
+ warning("MaxVectorSize must be <= 32");
+ FLAG_SET_DEFAULT(MaxVectorSize, 32);
+ }
+ }
+ else if (UseAVX > 2 ) {
+ if (MaxVectorSize > 64) {
+ if (!FLAG_IS_DEFAULT(MaxVectorSize))
+ warning("MaxVectorSize must be <= 64");
+ FLAG_SET_DEFAULT(MaxVectorSize, 64);
+ }
}
#if defined(COMPILER2) && defined(ASSERT)
if (supports_avx() && PrintMiscellaneous && Verbose && TraceNewVectors) {
tty->print_cr("State of YMM registers after signal handle:");
int nreg = 2 LP64_ONLY(+2);
< prev index next >