6378821: bitCount() should use POPC on SPARC processors and AMD+10h

BitCount() should use POPC on SPARC processors where POPC is implemented directly in hardware.

Reviewed-by: kvn, never
This commit is contained in:
Christian Thalinger 2009-03-13 11:35:17 -07:00
parent 69f9ddee90
commit de67e52949
16 changed files with 370 additions and 20 deletions

View file

@ -92,10 +92,18 @@ void VM_Version::initialize() {
#endif
}
// Use hardware population count instruction if available.
if (has_hardware_popc()) {
if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
UsePopCountInstruction = true;
}
}
char buf[512];
jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s",
jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s%s",
(has_v8() ? ", has_v8" : ""),
(has_v9() ? ", has_v9" : ""),
(has_hardware_popc() ? ", popc" : ""),
(has_vis1() ? ", has_vis1" : ""),
(has_vis2() ? ", has_vis2" : ""),
(is_ultra3() ? ", is_ultra3" : ""),