hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
changeset 37430 fd743dadef12
parent 36346 0a02e923ec29
child 38054 3a22f46fb514
equal deleted inserted replaced
37428:6e724f3d488b 37430:fd743dadef12
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "asm/macroAssembler.inline.hpp"
    26 #include "asm/macroAssembler.inline.hpp"
       
    27 #include "logging/log.hpp"
    27 #include "memory/resourceArea.hpp"
    28 #include "memory/resourceArea.hpp"
    28 #include "runtime/java.hpp"
    29 #include "runtime/java.hpp"
    29 #include "runtime/os.hpp"
    30 #include "runtime/os.hpp"
    30 #include "runtime/stubCodeGenerator.hpp"
    31 #include "runtime/stubCodeGenerator.hpp"
    31 #include "vm_version_sparc.hpp"
    32 #include "vm_version_sparc.hpp"
   366     if (!FLAG_IS_DEFAULT(UseUnalignedAccesses))
   367     if (!FLAG_IS_DEFAULT(UseUnalignedAccesses))
   367       warning("Unaligned memory access is not available on this CPU");
   368       warning("Unaligned memory access is not available on this CPU");
   368     FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
   369     FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
   369   }
   370   }
   370 
   371 
   371   if (PrintMiscellaneous && Verbose) {
   372   if (log_is_enabled(Info, os, cpu)) {
   372     tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size());
   373     ResourceMark rm;
   373     tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size());
   374     outputStream* log = Log(os, cpu)::info_stream();
   374     tty->print("Allocation");
   375     log->print_cr("L1 data cache line size: %u", L1_data_cache_line_size());
       
   376     log->print_cr("L2 data cache line size: %u", L2_data_cache_line_size());
       
   377     log->print("Allocation");
   375     if (AllocatePrefetchStyle <= 0) {
   378     if (AllocatePrefetchStyle <= 0) {
   376       tty->print_cr(": no prefetching");
   379       log->print(": no prefetching");
   377     } else {
   380     } else {
   378       tty->print(" prefetching: ");
   381       log->print(" prefetching: ");
   379       if (AllocatePrefetchInstr == 0) {
   382       if (AllocatePrefetchInstr == 0) {
   380           tty->print("PREFETCH");
   383           log->print("PREFETCH");
   381       } else if (AllocatePrefetchInstr == 1) {
   384       } else if (AllocatePrefetchInstr == 1) {
   382           tty->print("BIS");
   385           log->print("BIS");
   383       }
   386       }
   384       if (AllocatePrefetchLines > 1) {
   387       if (AllocatePrefetchLines > 1) {
   385         tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
   388         log->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
   386       } else {
   389       } else {
   387         tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
   390         log->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
   388       }
   391       }
   389     }
   392     }
   390     if (PrefetchCopyIntervalInBytes > 0) {
   393     if (PrefetchCopyIntervalInBytes > 0) {
   391       tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
   394       log->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
   392     }
   395     }
   393     if (PrefetchScanIntervalInBytes > 0) {
   396     if (PrefetchScanIntervalInBytes > 0) {
   394       tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
   397       log->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
   395     }
   398     }
   396     if (PrefetchFieldsAhead > 0) {
   399     if (PrefetchFieldsAhead > 0) {
   397       tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
   400       log->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
   398     }
   401     }
   399     if (ContendedPaddingWidth > 0) {
   402     if (ContendedPaddingWidth > 0) {
   400       tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
   403       log->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
   401     }
   404     }
   402   }
   405   }
   403 }
   406 }
   404 
   407 
   405 void VM_Version::print_features() {
   408 void VM_Version::print_features() {
   406   tty->print_cr("Version:%s", _features);
   409   tty->print_cr("Version:%s", _features);
   407 }
   410 }
   408 
   411 
   409 int VM_Version::determine_features() {
   412 int VM_Version::determine_features() {
   410   if (UseV8InstrsOnly) {
   413   if (UseV8InstrsOnly) {
   411     if (PrintMiscellaneous && Verbose) { tty->print_cr("Version is Forced-V8"); }
   414     log_info(os, cpu)("Version is Forced-V8");
   412     return generic_v8_m;
   415     return generic_v8_m;
   413   }
   416   }
   414 
   417 
   415   int features = platform_features(unknown_m); // platform_features() is os_arch specific
   418   int features = platform_features(unknown_m); // platform_features() is os_arch specific
   416 
   419 
   417   if (features == unknown_m) {
   420   if (features == unknown_m) {
   418     features = generic_v9_m;
   421     features = generic_v9_m;
   419     warning("Cannot recognize SPARC version. Default to V9");
   422     log_info(os)("Cannot recognize SPARC version. Default to V9");
   420   }
   423   }
   421 
   424 
   422   assert(is_T_family(features) == is_niagara(features), "Niagara should be T series");
   425   assert(is_T_family(features) == is_niagara(features), "Niagara should be T series");
   423   if (UseNiagaraInstrs) { // Force code generation for Niagara
   426   if (UseNiagaraInstrs) { // Force code generation for Niagara
   424     if (is_T_family(features)) {
   427     if (is_T_family(features)) {
   425       // Happy to accomodate...
   428       // Happy to accomodate...
   426     } else {
   429     } else {
   427       if (PrintMiscellaneous && Verbose) { tty->print_cr("Version is Forced-Niagara"); }
   430       log_info(os, cpu)("Version is Forced-Niagara");
   428       features |= T_family_m;
   431       features |= T_family_m;
   429     }
   432     }
   430   } else {
   433   } else {
   431     if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) {
   434     if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) {
   432       if (PrintMiscellaneous && Verbose) { tty->print_cr("Version is Forced-Not-Niagara"); }
   435       log_info(os, cpu)("Version is Forced-Not-Niagara");
   433       features &= ~(T_family_m | T1_model_m);
   436       features &= ~(T_family_m | T1_model_m);
   434     } else {
   437     } else {
   435       // Happy to accomodate...
   438       // Happy to accomodate...
   436     }
   439     }
   437   }
   440   }