Mercurial > hg > truffle
comparison src/cpu/x86/vm/vm_version_x86.cpp @ 2479:15c9a0e16269
7035713: 3DNow Prefetch Instruction Support
Summary: The upcoming processors from AMD are the first that support 3dnow prefetch without supporting the 3dnow instruction set.
Reviewed-by: kvn
Contributed-by: tom.deneau@amd.com
author | kvn |
---|---|
date | Mon, 11 Apr 2011 15:30:31 -0700 |
parents | 1d1603768966 |
children | 2a34a4fbc52c |
comparison
equal
deleted
inserted
replaced
2478:328926869b15 | 2479:15c9a0e16269 |
---|---|
346 // HT processor could be installed on a system which doesn't support HT. | 346 // HT processor could be installed on a system which doesn't support HT. |
347 _cpuFeatures &= ~CPU_HT; | 347 _cpuFeatures &= ~CPU_HT; |
348 } | 348 } |
349 | 349 |
350 char buf[256]; | 350 char buf[256]; |
351 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", | 351 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", |
352 cores_per_cpu(), threads_per_core(), | 352 cores_per_cpu(), threads_per_core(), |
353 cpu_family(), _model, _stepping, | 353 cpu_family(), _model, _stepping, |
354 (supports_cmov() ? ", cmov" : ""), | 354 (supports_cmov() ? ", cmov" : ""), |
355 (supports_cmpxchg8() ? ", cx8" : ""), | 355 (supports_cmpxchg8() ? ", cx8" : ""), |
356 (supports_fxsr() ? ", fxsr" : ""), | 356 (supports_fxsr() ? ", fxsr" : ""), |
361 (supports_ssse3()? ", ssse3": ""), | 361 (supports_ssse3()? ", ssse3": ""), |
362 (supports_sse4_1() ? ", sse4.1" : ""), | 362 (supports_sse4_1() ? ", sse4.1" : ""), |
363 (supports_sse4_2() ? ", sse4.2" : ""), | 363 (supports_sse4_2() ? ", sse4.2" : ""), |
364 (supports_popcnt() ? ", popcnt" : ""), | 364 (supports_popcnt() ? ", popcnt" : ""), |
365 (supports_mmx_ext() ? ", mmxext" : ""), | 365 (supports_mmx_ext() ? ", mmxext" : ""), |
366 (supports_3dnow() ? ", 3dnow" : ""), | 366 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""), |
367 (supports_3dnow2() ? ", 3dnowext" : ""), | |
368 (supports_lzcnt() ? ", lzcnt": ""), | 367 (supports_lzcnt() ? ", lzcnt": ""), |
369 (supports_sse4a() ? ", sse4a": ""), | 368 (supports_sse4a() ? ", sse4a": ""), |
370 (supports_ht() ? ", ht": "")); | 369 (supports_ht() ? ", ht": "")); |
371 _features_str = strdup(buf); | 370 _features_str = strdup(buf); |
372 | 371 |
520 assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 3, "invalid value"); | 519 assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 3, "invalid value"); |
521 | 520 |
522 // set valid Prefetch instruction | 521 // set valid Prefetch instruction |
523 if( ReadPrefetchInstr < 0 ) ReadPrefetchInstr = 0; | 522 if( ReadPrefetchInstr < 0 ) ReadPrefetchInstr = 0; |
524 if( ReadPrefetchInstr > 3 ) ReadPrefetchInstr = 3; | 523 if( ReadPrefetchInstr > 3 ) ReadPrefetchInstr = 3; |
525 if( ReadPrefetchInstr == 3 && !supports_3dnow() ) ReadPrefetchInstr = 0; | 524 if( ReadPrefetchInstr == 3 && !supports_3dnow_prefetch() ) ReadPrefetchInstr = 0; |
526 if( !supports_sse() && supports_3dnow() ) ReadPrefetchInstr = 3; | 525 if( !supports_sse() && supports_3dnow_prefetch() ) ReadPrefetchInstr = 3; |
527 | 526 |
528 if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0; | 527 if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0; |
529 if( AllocatePrefetchInstr > 3 ) AllocatePrefetchInstr = 3; | 528 if( AllocatePrefetchInstr > 3 ) AllocatePrefetchInstr = 3; |
530 if( AllocatePrefetchInstr == 3 && !supports_3dnow() ) AllocatePrefetchInstr=0; | 529 if( AllocatePrefetchInstr == 3 && !supports_3dnow_prefetch() ) AllocatePrefetchInstr=0; |
531 if( !supports_sse() && supports_3dnow() ) AllocatePrefetchInstr = 3; | 530 if( !supports_sse() && supports_3dnow_prefetch() ) AllocatePrefetchInstr = 3; |
532 | 531 |
533 // Allocation prefetch settings | 532 // Allocation prefetch settings |
534 intx cache_line_size = L1_data_cache_line_size(); | 533 intx cache_line_size = L1_data_cache_line_size(); |
535 if( cache_line_size > AllocatePrefetchStepSize ) | 534 if( cache_line_size > AllocatePrefetchStepSize ) |
536 AllocatePrefetchStepSize = cache_line_size; | 535 AllocatePrefetchStepSize = cache_line_size; |
574 if (PrintMiscellaneous && Verbose) { | 573 if (PrintMiscellaneous && Verbose) { |
575 tty->print_cr("Logical CPUs per core: %u", | 574 tty->print_cr("Logical CPUs per core: %u", |
576 logical_processors_per_package()); | 575 logical_processors_per_package()); |
577 tty->print_cr("UseSSE=%d",UseSSE); | 576 tty->print_cr("UseSSE=%d",UseSSE); |
578 tty->print("Allocation: "); | 577 tty->print("Allocation: "); |
579 if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow()) { | 578 if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow_prefetch()) { |
580 tty->print_cr("no prefetching"); | 579 tty->print_cr("no prefetching"); |
581 } else { | 580 } else { |
582 if (UseSSE == 0 && supports_3dnow()) { | 581 if (UseSSE == 0 && supports_3dnow_prefetch()) { |
583 tty->print("PREFETCHW"); | 582 tty->print("PREFETCHW"); |
584 } else if (UseSSE >= 1) { | 583 } else if (UseSSE >= 1) { |
585 if (AllocatePrefetchInstr == 0) { | 584 if (AllocatePrefetchInstr == 0) { |
586 tty->print("PREFETCHNTA"); | 585 tty->print("PREFETCHNTA"); |
587 } else if (AllocatePrefetchInstr == 1) { | 586 } else if (AllocatePrefetchInstr == 1) { |