# HG changeset patch # User Tom Rodriguez # Date 1429638463 25200 # Node ID 2e35a4ea22acfaa3d1e0df1ce70cc788d1d7d839 # Parent 8189de5b6a2f9d134889a34281a40088a4a2e273 Add MaxVectorSize to Graal globals diff -r 8189de5b6a2f -r 2e35a4ea22ac src/cpu/x86/vm/sharedRuntime_x86_64.cpp --- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Tue Apr 21 14:57:13 2015 +0200 +++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Tue Apr 21 10:47:43 2015 -0700 @@ -186,9 +186,7 @@ __ subptr(rsp, 256); // Save upper half of YMM registers if (save_vectors) { assert(UseAVX > 0, "256bit vectors are supported only with AVX"); -#ifdef COMPILER2 assert(MaxVectorSize == 32, "only 256bit vectors are supported now"); -#endif // Save upper half of YMM registers __ vextractf128h(Address(rsp, ymm_hi0_off * BytesPerInt), xmm0); __ vextractf128h(Address(rsp, ymm_hi1_off * BytesPerInt), xmm1); @@ -327,9 +325,7 @@ if (restore_vectors) { // Restore upper half of YMM registes. assert(UseAVX > 0, "256bit vectors are supported only with AVX"); -#if defined(COMPILER2) assert(MaxVectorSize == 32, "only 256bit vectors are supported now"); -#endif __ vinsertf128h(xmm0, Address(rsp, ymm_hi0_off * BytesPerInt)); __ vinsertf128h(xmm1, Address(rsp, ymm_hi1_off * BytesPerInt)); __ vinsertf128h(xmm2, Address(rsp, ymm_hi2_off * BytesPerInt)); diff -r 8189de5b6a2f -r 2e35a4ea22ac src/cpu/x86/vm/vm_version_x86.cpp --- a/src/cpu/x86/vm/vm_version_x86.cpp Tue Apr 21 14:57:13 2015 +0200 +++ b/src/cpu/x86/vm/vm_version_x86.cpp Tue Apr 21 10:47:43 2015 -0700 @@ -667,6 +667,8 @@ FLAG_SET_DEFAULT(UseFPUForSpilling, false); } } +#endif +#if defined(COMPILER2) || defined(GRAAL) if (MaxVectorSize > 0) { if (!is_power_of_2(MaxVectorSize)) { warning("MaxVectorSize must be a power of 2"); @@ -684,7 +686,7 @@ FLAG_SET_DEFAULT(MaxVectorSize, 0); } #ifdef ASSERT - if (supports_avx() && PrintMiscellaneous && Verbose && TraceNewVectors) { + if (supports_avx() && PrintMiscellaneous && Verbose) { tty->print_cr("State of YMM registers after signal handle:"); int nreg = 2 LP64_ONLY(+2); const char* ymm_name[4] = {"0", "7", "8", "15"}; @@ -698,7 +700,9 @@ } #endif } +#endif +#ifdef COMPILER2 #ifdef _LP64 if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { UseMultiplyToLenIntrinsic = true; diff -r 8189de5b6a2f -r 2e35a4ea22ac src/share/vm/graal/graalEnv.cpp --- a/src/share/vm/graal/graalEnv.cpp Tue Apr 21 14:57:13 2015 +0200 +++ b/src/share/vm/graal/graalEnv.cpp Tue Apr 21 10:47:43 2015 -0700 @@ -550,7 +550,7 @@ // It might be preferable to set this only for methods which // use vector instructions but we currently don't track this // and it probably wouldn't make much difference. - nm->set_has_wide_vectors(UseAVX >= 2); + nm->set_has_wide_vectors(MaxVectorSize > 16); #endif // Record successful registration. diff -r 8189de5b6a2f -r 2e35a4ea22ac src/share/vm/graal/graalGlobals.hpp --- a/src/share/vm/graal/graalGlobals.hpp Tue Apr 21 14:57:13 2015 +0200 +++ b/src/share/vm/graal/graalGlobals.hpp Tue Apr 21 10:47:43 2015 -0700 @@ -67,6 +67,10 @@ GRAAL_ONLY(product(bool, CodeInstallSafepointChecks, true, \ "Perform explicit safepoint checks while installing code")) \ \ + NOT_COMPILER2(product(intx, MaxVectorSize, 32, \ + "Max vector size in bytes, " \ + "actual size could be less depending on elements type")) \ + \ product(intx, TraceGraal, 0, \ "Trace level for Graal") \ \ diff -r 8189de5b6a2f -r 2e35a4ea22ac src/share/vm/runtime/sharedRuntime.cpp --- a/src/share/vm/runtime/sharedRuntime.cpp Tue Apr 21 14:57:13 2015 +0200 +++ b/src/share/vm/runtime/sharedRuntime.cpp Tue Apr 21 10:47:43 2015 -0700 @@ -113,11 +113,7 @@ #if defined(COMPILER2) || defined(GRAAL) // Vectors are generated only by C2 and Graal. -#ifdef COMPILER2 - bool support_wide = is_wide_vector(MaxVectorSize) || IS_GRAAL_DEFINED; -#else - bool support_wide = true; -#endif + bool support_wide = is_wide_vector(MaxVectorSize); if (support_wide) { _polling_page_vectors_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_VECTOR_LOOP); }