< prev index next >

src/hotspot/cpu/x86/vm_version_x86.cpp

Print this page




 677       FLAG_SET_DEFAULT(UseAVX, 2);  //Set UseAVX=2 for Skylake
 678     }
 679   } else if (UseAVX > use_avx_limit) {
 680     warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", (int) UseAVX, use_avx_limit);
 681     FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
 682   } else if (UseAVX < 0) {
 683     warning("UseAVX=%d is not valid, setting it to UseAVX=0", (int) UseAVX);
 684     FLAG_SET_DEFAULT(UseAVX, 0);
 685   }
 686 
 687   if (UseAVX < 3) {
 688     _features &= ~CPU_AVX512F;
 689     _features &= ~CPU_AVX512DQ;
 690     _features &= ~CPU_AVX512CD;
 691     _features &= ~CPU_AVX512BW;
 692     _features &= ~CPU_AVX512VL;
 693     _features &= ~CPU_AVX512_VPOPCNTDQ;
 694     _features &= ~CPU_AVX512_VPCLMULQDQ;
 695     _features &= ~CPU_VAES;
 696     _features &= ~CPU_VNNI;

 697   }
 698 
 699   if (UseAVX < 2)
 700     _features &= ~CPU_AVX2;
 701 
 702   if (UseAVX < 1) {
 703     _features &= ~CPU_AVX;
 704     _features &= ~CPU_VZEROUPPER;
 705   }
 706 
 707   if (logical_processors_per_package() == 1) {
 708     // HT processor could be installed on a system which doesn't support HT.
 709     _features &= ~CPU_HT;
 710   }
 711 
 712   if (is_intel()) { // Intel cpus specific settings
 713     if (is_knights_family()) {
 714       _features &= ~CPU_VZEROUPPER;
 715     }
 716   }
 717 
 718   char buf[256];
 719   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",
 720                cores_per_cpu(), threads_per_core(),
 721                cpu_family(), _model, _stepping,
 722                (supports_cmov() ? ", cmov" : ""),
 723                (supports_cmpxchg8() ? ", cx8" : ""),
 724                (supports_fxsr() ? ", fxsr" : ""),
 725                (supports_mmx()  ? ", mmx"  : ""),
 726                (supports_sse()  ? ", sse"  : ""),
 727                (supports_sse2() ? ", sse2" : ""),
 728                (supports_sse3() ? ", sse3" : ""),
 729                (supports_ssse3()? ", ssse3": ""),
 730                (supports_sse4_1() ? ", sse4.1" : ""),
 731                (supports_sse4_2() ? ", sse4.2" : ""),
 732                (supports_popcnt() ? ", popcnt" : ""),
 733                (supports_avx()    ? ", avx" : ""),
 734                (supports_avx2()   ? ", avx2" : ""),
 735                (supports_aes()    ? ", aes" : ""),
 736                (supports_clmul()  ? ", clmul" : ""),
 737                (supports_erms()   ? ", erms" : ""),
 738                (supports_rtm()    ? ", rtm" : ""),
 739                (supports_mmx_ext() ? ", mmxext" : ""),
 740                (supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
 741                (supports_lzcnt()   ? ", lzcnt": ""),
 742                (supports_sse4a()   ? ", sse4a": ""),
 743                (supports_ht() ? ", ht": ""),
 744                (supports_tsc() ? ", tsc": ""),
 745                (supports_tscinv_bit() ? ", tscinvbit": ""),
 746                (supports_tscinv() ? ", tscinv": ""),
 747                (supports_bmi1() ? ", bmi1" : ""),
 748                (supports_bmi2() ? ", bmi2" : ""),
 749                (supports_adx() ? ", adx" : ""),
 750                (supports_evex() ? ", evex" : ""),
 751                (supports_sha() ? ", sha" : ""),
 752                (supports_fma() ? ", fma" : ""));



 753   _features_string = os::strdup(buf);
 754 
 755   // UseSSE is set to the smaller of what hardware supports and what
 756   // the command line requires.  I.e., you cannot set UseSSE to 2 on
 757   // older Pentiums which do not support it.
 758   int use_sse_limit = 0;
 759   if (UseSSE > 0) {
 760     if (UseSSE > 3 && supports_sse4_1()) {
 761       use_sse_limit = 4;
 762     } else if (UseSSE > 2 && supports_sse3()) {
 763       use_sse_limit = 3;
 764     } else if (UseSSE > 1 && supports_sse2()) {
 765       use_sse_limit = 2;
 766     } else if (UseSSE > 0 && supports_sse()) {
 767       use_sse_limit = 1;
 768     } else {
 769       use_sse_limit = 0;
 770     }
 771   }
 772   if (FLAG_IS_DEFAULT(UseSSE)) {




 677       FLAG_SET_DEFAULT(UseAVX, 2);  //Set UseAVX=2 for Skylake
 678     }
 679   } else if (UseAVX > use_avx_limit) {
 680     warning("UseAVX=%d is not supported on this CPU, setting it to UseAVX=%d", (int) UseAVX, use_avx_limit);
 681     FLAG_SET_DEFAULT(UseAVX, use_avx_limit);
 682   } else if (UseAVX < 0) {
 683     warning("UseAVX=%d is not valid, setting it to UseAVX=0", (int) UseAVX);
 684     FLAG_SET_DEFAULT(UseAVX, 0);
 685   }
 686 
 687   if (UseAVX < 3) {
 688     _features &= ~CPU_AVX512F;
 689     _features &= ~CPU_AVX512DQ;
 690     _features &= ~CPU_AVX512CD;
 691     _features &= ~CPU_AVX512BW;
 692     _features &= ~CPU_AVX512VL;
 693     _features &= ~CPU_AVX512_VPOPCNTDQ;
 694     _features &= ~CPU_AVX512_VPCLMULQDQ;
 695     _features &= ~CPU_VAES;
 696     _features &= ~CPU_VNNI;
 697     _features &= ~CPU_VBMI2;
 698   }
 699 
 700   if (UseAVX < 2)
 701     _features &= ~CPU_AVX2;
 702 
 703   if (UseAVX < 1) {
 704     _features &= ~CPU_AVX;
 705     _features &= ~CPU_VZEROUPPER;
 706   }
 707 
 708   if (logical_processors_per_package() == 1) {
 709     // HT processor could be installed on a system which doesn't support HT.
 710     _features &= ~CPU_HT;
 711   }
 712 
 713   if (is_intel()) { // Intel cpus specific settings
 714     if (is_knights_family()) {
 715       _features &= ~CPU_VZEROUPPER;
 716     }
 717   }
 718 
 719   char buf[256];
 720   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%s%s%s",
 721                cores_per_cpu(), threads_per_core(),
 722                cpu_family(), _model, _stepping,
 723                (supports_cmov() ? ", cmov" : ""),
 724                (supports_cmpxchg8() ? ", cx8" : ""),
 725                (supports_fxsr() ? ", fxsr" : ""),
 726                (supports_mmx()  ? ", mmx"  : ""),
 727                (supports_sse()  ? ", sse"  : ""),
 728                (supports_sse2() ? ", sse2" : ""),
 729                (supports_sse3() ? ", sse3" : ""),
 730                (supports_ssse3()? ", ssse3": ""),
 731                (supports_sse4_1() ? ", sse4.1" : ""),
 732                (supports_sse4_2() ? ", sse4.2" : ""),
 733                (supports_popcnt() ? ", popcnt" : ""),
 734                (supports_avx()    ? ", avx" : ""),
 735                (supports_avx2()   ? ", avx2" : ""),
 736                (supports_aes()    ? ", aes" : ""),
 737                (supports_clmul()  ? ", clmul" : ""),
 738                (supports_erms()   ? ", erms" : ""),
 739                (supports_rtm()    ? ", rtm" : ""),
 740                (supports_mmx_ext() ? ", mmxext" : ""),
 741                (supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
 742                (supports_lzcnt()   ? ", lzcnt": ""),
 743                (supports_sse4a()   ? ", sse4a": ""),
 744                (supports_ht() ? ", ht": ""),
 745                (supports_tsc() ? ", tsc": ""),
 746                (supports_tscinv_bit() ? ", tscinvbit": ""),
 747                (supports_tscinv() ? ", tscinv": ""),
 748                (supports_bmi1() ? ", bmi1" : ""),
 749                (supports_bmi2() ? ", bmi2" : ""),
 750                (supports_adx() ? ", adx" : ""),
 751                (supports_evex() ? ", evex" : ""),
 752                (supports_sha() ? ", sha" : ""),
 753                (supports_fma() ? ", fma" : ""),
 754                (supports_vbmi2() ? ", vbmi2" : ""),
 755                (supports_vaes() ? ", vaes" : ""),
 756                (supports_vnni() ? ", vnni" : ""));
 757   _features_string = os::strdup(buf);
 758 
 759   // UseSSE is set to the smaller of what hardware supports and what
 760   // the command line requires.  I.e., you cannot set UseSSE to 2 on
 761   // older Pentiums which do not support it.
 762   int use_sse_limit = 0;
 763   if (UseSSE > 0) {
 764     if (UseSSE > 3 && supports_sse4_1()) {
 765       use_sse_limit = 4;
 766     } else if (UseSSE > 2 && supports_sse3()) {
 767       use_sse_limit = 3;
 768     } else if (UseSSE > 1 && supports_sse2()) {
 769       use_sse_limit = 2;
 770     } else if (UseSSE > 0 && supports_sse()) {
 771       use_sse_limit = 1;
 772     } else {
 773       use_sse_limit = 0;
 774     }
 775   }
 776   if (FLAG_IS_DEFAULT(UseSSE)) {


< prev index next >