Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/vm_version_x86.cpp @ 7474:00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
Summary: use 'rep stosb' instead of 'rep stosq' when fast-string operations are available.
Reviewed-by: twisti, roland
author | kvn |
---|---|
date | Thu, 03 Jan 2013 15:09:55 -0800 |
parents | 2c7f594145dc |
children | 989155e2d07a 92d4b5d8dde4 |
comparison
equal
deleted
inserted
replaced
7473:d092d1b31229 | 7474:00af3a3a8df4 |
---|---|
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", | 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", |
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" : ""), |
444 (supports_sse4_2() ? ", sse4.2" : ""), | 444 (supports_sse4_2() ? ", sse4.2" : ""), |
445 (supports_popcnt() ? ", popcnt" : ""), | 445 (supports_popcnt() ? ", popcnt" : ""), |
446 (supports_avx() ? ", avx" : ""), | 446 (supports_avx() ? ", avx" : ""), |
447 (supports_avx2() ? ", avx2" : ""), | 447 (supports_avx2() ? ", avx2" : ""), |
448 (supports_aes() ? ", aes" : ""), | 448 (supports_aes() ? ", aes" : ""), |
449 (supports_erms() ? ", erms" : ""), | |
449 (supports_mmx_ext() ? ", mmxext" : ""), | 450 (supports_mmx_ext() ? ", mmxext" : ""), |
450 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""), | 451 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""), |
451 (supports_lzcnt() ? ", lzcnt": ""), | 452 (supports_lzcnt() ? ", lzcnt": ""), |
452 (supports_sse4a() ? ", sse4a": ""), | 453 (supports_sse4a() ? ", sse4a": ""), |
453 (supports_ht() ? ", ht": ""), | 454 (supports_ht() ? ", ht": ""), |
667 UsePopCountInstruction = true; | 668 UsePopCountInstruction = true; |
668 } | 669 } |
669 } else if (UsePopCountInstruction) { | 670 } else if (UsePopCountInstruction) { |
670 warning("POPCNT instruction is not available on this CPU"); | 671 warning("POPCNT instruction is not available on this CPU"); |
671 FLAG_SET_DEFAULT(UsePopCountInstruction, false); | 672 FLAG_SET_DEFAULT(UsePopCountInstruction, false); |
673 } | |
674 | |
675 // Use fast-string operations if available. | |
676 if (supports_erms()) { | |
677 if (FLAG_IS_DEFAULT(UseFastStosb)) { | |
678 UseFastStosb = true; | |
679 } | |
680 } else if (UseFastStosb) { | |
681 warning("fast-string operations are not available on this CPU"); | |
682 FLAG_SET_DEFAULT(UseFastStosb, false); | |
672 } | 683 } |
673 | 684 |
674 #ifdef COMPILER2 | 685 #ifdef COMPILER2 |
675 if (FLAG_IS_DEFAULT(AlignVector)) { | 686 if (FLAG_IS_DEFAULT(AlignVector)) { |
676 // Modern processors allow misaligned memory operations for vectors. | 687 // Modern processors allow misaligned memory operations for vectors. |