Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/vm_version_x86.cpp @ 17729:8a8ff6b577ed
8031321: Support Intel bit manipulation instructions
Summary: Add support for BMI1 instructions
Reviewed-by: kvn, roland
author | iveresov |
---|---|
date | Wed, 12 Mar 2014 11:24:26 -0700 |
parents | b800986664f4 |
children | b51e29501f30 98af1e198e73 |
comparison
equal
deleted
inserted
replaced
17727:cfd4aac53239 | 17729:8a8ff6b577ed |
---|---|
427 // HT processor could be installed on a system which doesn't support HT. | 427 // HT processor could be installed on a system which doesn't support HT. |
428 _cpuFeatures &= ~CPU_HT; | 428 _cpuFeatures &= ~CPU_HT; |
429 } | 429 } |
430 | 430 |
431 char buf[256]; | 431 char buf[256]; |
432 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", | 432 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", |
433 cores_per_cpu(), threads_per_core(), | 433 cores_per_cpu(), threads_per_core(), |
434 cpu_family(), _model, _stepping, | 434 cpu_family(), _model, _stepping, |
435 (supports_cmov() ? ", cmov" : ""), | 435 (supports_cmov() ? ", cmov" : ""), |
436 (supports_cmpxchg8() ? ", cx8" : ""), | 436 (supports_cmpxchg8() ? ", cx8" : ""), |
437 (supports_fxsr() ? ", fxsr" : ""), | 437 (supports_fxsr() ? ", fxsr" : ""), |
453 (supports_lzcnt() ? ", lzcnt": ""), | 453 (supports_lzcnt() ? ", lzcnt": ""), |
454 (supports_sse4a() ? ", sse4a": ""), | 454 (supports_sse4a() ? ", sse4a": ""), |
455 (supports_ht() ? ", ht": ""), | 455 (supports_ht() ? ", ht": ""), |
456 (supports_tsc() ? ", tsc": ""), | 456 (supports_tsc() ? ", tsc": ""), |
457 (supports_tscinv_bit() ? ", tscinvbit": ""), | 457 (supports_tscinv_bit() ? ", tscinvbit": ""), |
458 (supports_tscinv() ? ", tscinv": "")); | 458 (supports_tscinv() ? ", tscinv": ""), |
459 (supports_bmi1() ? ", bmi1" : ""), | |
460 (supports_bmi2() ? ", bmi2" : "")); | |
459 _features_str = strdup(buf); | 461 _features_str = strdup(buf); |
460 | 462 |
461 // UseSSE is set to the smaller of what hardware supports and what | 463 // UseSSE is set to the smaller of what hardware supports and what |
462 // the command line requires. I.e., you cannot set UseSSE to 2 on | 464 // the command line requires. I.e., you cannot set UseSSE to 2 on |
463 // older Pentiums which do not support it. | 465 // older Pentiums which do not support it. |
598 if( supports_sse4_2() && UseSSE >= 4 ) { | 600 if( supports_sse4_2() && UseSSE >= 4 ) { |
599 UseSSE42Intrinsics = true; | 601 UseSSE42Intrinsics = true; |
600 } | 602 } |
601 } | 603 } |
602 | 604 |
603 // Use count leading zeros count instruction if available. | |
604 if (supports_lzcnt()) { | |
605 if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { | |
606 UseCountLeadingZerosInstruction = true; | |
607 } | |
608 } | |
609 | |
610 // some defaults for AMD family 15h | 605 // some defaults for AMD family 15h |
611 if ( cpu_family() == 0x15 ) { | 606 if ( cpu_family() == 0x15 ) { |
612 // On family 15h processors default is no sw prefetch | 607 // On family 15h processors default is no sw prefetch |
613 if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { | 608 if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { |
614 AllocatePrefetchStyle = 0; | 609 AllocatePrefetchStyle = 0; |
689 // restoring upper 128bit of YMM registers on return | 684 // restoring upper 128bit of YMM registers on return |
690 // from signal handler. | 685 // from signal handler. |
691 FLAG_SET_DEFAULT(MaxVectorSize, 16); | 686 FLAG_SET_DEFAULT(MaxVectorSize, 16); |
692 } | 687 } |
693 #endif // COMPILER2 | 688 #endif // COMPILER2 |
689 | |
690 // Use count leading zeros count instruction if available. | |
691 if (supports_lzcnt()) { | |
692 if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { | |
693 UseCountLeadingZerosInstruction = true; | |
694 } | |
695 } else if (UseCountLeadingZerosInstruction) { | |
696 warning("lzcnt instruction is not available on this CPU"); | |
697 FLAG_SET_DEFAULT(UseCountLeadingZerosInstruction, false); | |
698 } | |
699 | |
700 if (supports_bmi1()) { | |
701 if (FLAG_IS_DEFAULT(UseBMI1Instructions)) { | |
702 UseBMI1Instructions = true; | |
703 } | |
704 } else if (UseBMI1Instructions) { | |
705 warning("BMI1 instructions are not available on this CPU"); | |
706 FLAG_SET_DEFAULT(UseBMI1Instructions, false); | |
707 } | |
708 | |
709 // Use count trailing zeros instruction if available | |
710 if (supports_bmi1()) { | |
711 if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) { | |
712 UseCountTrailingZerosInstruction = UseBMI1Instructions; | |
713 } | |
714 } else if (UseCountTrailingZerosInstruction) { | |
715 warning("tzcnt instruction is not available on this CPU"); | |
716 FLAG_SET_DEFAULT(UseCountTrailingZerosInstruction, false); | |
717 } | |
694 | 718 |
695 // Use population count instruction if available. | 719 // Use population count instruction if available. |
696 if (supports_popcnt()) { | 720 if (supports_popcnt()) { |
697 if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { | 721 if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { |
698 UsePopCountInstruction = true; | 722 UsePopCountInstruction = true; |