--- old/src/cpu/x86/vm/vm_version_x86.cpp Sat Jun 2 20:03:59 2012 +++ new/src/cpu/x86/vm/vm_version_x86.cpp Sat Jun 2 20:03:59 2012 @@ -467,6 +467,32 @@ if (!supports_avx ()) // Drop to 0 if no AVX support UseAVX = 0; +#ifdef COMPILER2 + if (UseFPUForSpilling) { + if (UseSSE < 2) { + // Only supported with SSE2+ + FLAG_SET_DEFAULT(UseFPUForSpilling, false); + } + } + if (MaxVectorSize > 0) { + if (!is_power_of_2(MaxVectorSize)) { + warning("MaxVectorSize must be a power of 2"); + FLAG_SET_DEFAULT(MaxVectorSize, 32); + } + if (MaxVectorSize > 32) { + FLAG_SET_DEFAULT(MaxVectorSize, 32); + } + if (MaxVectorSize > 16 && UseAVX == 0) { + // Only supported with AVX+ + FLAG_SET_DEFAULT(MaxVectorSize, 16); + } + if (UseSSE < 2) { + // Only supported with SSE2+ + FLAG_SET_DEFAULT(MaxVectorSize, 0); + } + } +#endif + // On new cpus instructions which update whole XMM register should be used // to prevent partial register stall due to dependencies on high half. // @@ -544,6 +570,12 @@ } } +#ifdef COMPILER2 + if (MaxVectorSize > 16) { + // Limit vectors size to 16 bytes on current AMD cpus. + FLAG_SET_DEFAULT(MaxVectorSize, 16); + } +#endif // COMPILER2 } if( is_intel() ) { // Intel cpus specific settings @@ -606,15 +638,6 @@ FLAG_SET_DEFAULT(UsePopCountInstruction, false); } -#ifdef COMPILER2 - if (UseFPUForSpilling) { - if (UseSSE < 2) { - // Only supported with SSE2+ - FLAG_SET_DEFAULT(UseFPUForSpilling, false); - } - } -#endif - assert(0 <= ReadPrefetchInstr && ReadPrefetchInstr <= 3, "invalid value"); assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 3, "invalid value");