731 (supports_popcnt() ? ", popcnt" : ""),
732 (supports_avx() ? ", avx" : ""),
733 (supports_avx2() ? ", avx2" : ""),
734 (supports_aes() ? ", aes" : ""),
735 (supports_clmul() ? ", clmul" : ""),
736 (supports_erms() ? ", erms" : ""),
737 (supports_rtm() ? ", rtm" : ""),
738 (supports_mmx_ext() ? ", mmxext" : ""),
739 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
740 (supports_lzcnt() ? ", lzcnt": ""),
741 (supports_sse4a() ? ", sse4a": ""),
742 (supports_ht() ? ", ht": ""),
743 (supports_tsc() ? ", tsc": ""),
744 (supports_tscinv_bit() ? ", tscinvbit": ""),
745 (supports_tscinv() ? ", tscinv": ""),
746 (supports_bmi1() ? ", bmi1" : ""),
747 (supports_bmi2() ? ", bmi2" : ""),
748 (supports_adx() ? ", adx" : ""),
749 (supports_evex() ? ", evex" : ""),
750 (supports_sha() ? ", sha" : ""),
751 (supports_fma() ? ", fma" : ""));
752 _features_string = os::strdup(buf);
753
754 // UseSSE is set to the smaller of what hardware supports and what
755 // the command line requires. I.e., you cannot set UseSSE to 2 on
756 // older Pentiums which do not support it.
757 int use_sse_limit = 0;
758 if (UseSSE > 0) {
759 if (UseSSE > 3 && supports_sse4_1()) {
760 use_sse_limit = 4;
761 } else if (UseSSE > 2 && supports_sse3()) {
762 use_sse_limit = 3;
763 } else if (UseSSE > 1 && supports_sse2()) {
764 use_sse_limit = 2;
765 } else if (UseSSE > 0 && supports_sse()) {
766 use_sse_limit = 1;
767 } else {
768 use_sse_limit = 0;
769 }
770 }
771 if (FLAG_IS_DEFAULT(UseSSE)) {
1410 }
1411
1412 // BMI instructions (except tzcnt) use an encoding with VEX prefix.
1413 // VEX prefix is generated only when AVX > 0.
1414 if (supports_bmi1() && supports_avx()) {
1415 if (FLAG_IS_DEFAULT(UseBMI1Instructions)) {
1416 UseBMI1Instructions = true;
1417 }
1418 } else if (UseBMI1Instructions) {
1419 warning("BMI1 instructions are not available on this CPU (AVX is also required)");
1420 FLAG_SET_DEFAULT(UseBMI1Instructions, false);
1421 }
1422
1423 if (supports_bmi2() && supports_avx()) {
1424 if (FLAG_IS_DEFAULT(UseBMI2Instructions)) {
1425 UseBMI2Instructions = true;
1426 }
1427 } else if (UseBMI2Instructions) {
1428 warning("BMI2 instructions are not available on this CPU (AVX is also required)");
1429 FLAG_SET_DEFAULT(UseBMI2Instructions, false);
1430 }
1431
1432 // Use population count instruction if available.
1433 if (supports_popcnt()) {
1434 if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
1435 UsePopCountInstruction = true;
1436 }
1437 } else if (UsePopCountInstruction) {
1438 warning("POPCNT instruction is not available on this CPU");
1439 FLAG_SET_DEFAULT(UsePopCountInstruction, false);
1440 }
1441
1442 // Use fast-string operations if available.
1443 if (supports_erms()) {
1444 if (FLAG_IS_DEFAULT(UseFastStosb)) {
1445 UseFastStosb = true;
1446 }
1447 } else if (UseFastStosb) {
1448 warning("fast-string operations are not available on this CPU");
1449 FLAG_SET_DEFAULT(UseFastStosb, false);
|
731 (supports_popcnt() ? ", popcnt" : ""),
732 (supports_avx() ? ", avx" : ""),
733 (supports_avx2() ? ", avx2" : ""),
734 (supports_aes() ? ", aes" : ""),
735 (supports_clmul() ? ", clmul" : ""),
736 (supports_erms() ? ", erms" : ""),
737 (supports_rtm() ? ", rtm" : ""),
738 (supports_mmx_ext() ? ", mmxext" : ""),
739 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
740 (supports_lzcnt() ? ", lzcnt": ""),
741 (supports_sse4a() ? ", sse4a": ""),
742 (supports_ht() ? ", ht": ""),
743 (supports_tsc() ? ", tsc": ""),
744 (supports_tscinv_bit() ? ", tscinvbit": ""),
745 (supports_tscinv() ? ", tscinv": ""),
746 (supports_bmi1() ? ", bmi1" : ""),
747 (supports_bmi2() ? ", bmi2" : ""),
748 (supports_adx() ? ", adx" : ""),
749 (supports_evex() ? ", evex" : ""),
750 (supports_sha() ? ", sha" : ""),
751 (supports_fma() ? ", fma" : ""),
752 (supports_vbmi2() ? ", vbmi2" : ""),
753 (supports_vaes() ? ", vaes" : ""),
754 (supports_vnni() ? ", vnni" : ""));
755 _features_string = os::strdup(buf);
756
757 // UseSSE is set to the smaller of what hardware supports and what
758 // the command line requires. I.e., you cannot set UseSSE to 2 on
759 // older Pentiums which do not support it.
760 int use_sse_limit = 0;
761 if (UseSSE > 0) {
762 if (UseSSE > 3 && supports_sse4_1()) {
763 use_sse_limit = 4;
764 } else if (UseSSE > 2 && supports_sse3()) {
765 use_sse_limit = 3;
766 } else if (UseSSE > 1 && supports_sse2()) {
767 use_sse_limit = 2;
768 } else if (UseSSE > 0 && supports_sse()) {
769 use_sse_limit = 1;
770 } else {
771 use_sse_limit = 0;
772 }
773 }
774 if (FLAG_IS_DEFAULT(UseSSE)) {
1413 }
1414
1415 // BMI instructions (except tzcnt) use an encoding with VEX prefix.
1416 // VEX prefix is generated only when AVX > 0.
1417 if (supports_bmi1() && supports_avx()) {
1418 if (FLAG_IS_DEFAULT(UseBMI1Instructions)) {
1419 UseBMI1Instructions = true;
1420 }
1421 } else if (UseBMI1Instructions) {
1422 warning("BMI1 instructions are not available on this CPU (AVX is also required)");
1423 FLAG_SET_DEFAULT(UseBMI1Instructions, false);
1424 }
1425
1426 if (supports_bmi2() && supports_avx()) {
1427 if (FLAG_IS_DEFAULT(UseBMI2Instructions)) {
1428 UseBMI2Instructions = true;
1429 }
1430 } else if (UseBMI2Instructions) {
1431 warning("BMI2 instructions are not available on this CPU (AVX is also required)");
1432 FLAG_SET_DEFAULT(UseBMI2Instructions, false);
1433 }
1434
1435 // To enable VBMI2 we require that processor supports it and also that EVEX encoding is supported and enabled.
1436 if (supports_vbmi2() && UseAVX > 2) {
1437 if (FLAG_IS_DEFAULT(UseVBMI2)) {
1438 UseVBMI2 = true;
1439 }
1440 } else if (UseVBMI2) {
1441 warning("VBMI2 instructions are not available on this CPU");
1442 FLAG_SET_DEFAULT(UseVBMI2, false);
1443 }
1444
1445 // Use population count instruction if available.
1446 if (supports_popcnt()) {
1447 if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
1448 UsePopCountInstruction = true;
1449 }
1450 } else if (UsePopCountInstruction) {
1451 warning("POPCNT instruction is not available on this CPU");
1452 FLAG_SET_DEFAULT(UsePopCountInstruction, false);
1453 }
1454
1455 // Use fast-string operations if available.
1456 if (supports_erms()) {
1457 if (FLAG_IS_DEFAULT(UseFastStosb)) {
1458 UseFastStosb = true;
1459 }
1460 } else if (UseFastStosb) {
1461 warning("fast-string operations are not available on this CPU");
1462 FLAG_SET_DEFAULT(UseFastStosb, false);
|