hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp

Print this page
rev 611 : Merge
   1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)vm_version_sparc.hpp 1.33 07/10/04 10:49:21 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  


  50     sun4v_m               = 1 << sun4v_instructions,
  51 
  52     generic_v8_m          = v8_instructions_m | hardware_int_muldiv_m | hardware_fsmuld_m,
  53     generic_v9_m          = generic_v8_m | v9_instructions_m | vis1_instructions_m,
  54     ultra3_m              = generic_v9_m | vis2_instructions_m,
  55 
  56     // Temporary until we have something more accurate
  57     niagara1_unique_m     = sun4v_m,
  58     niagara1_m            = generic_v9_m | niagara1_unique_m
  59   };
  60 
  61   static int  _features;
  62   static const char* _features_str;
  63 
  64   static void print_features();
  65   static int  determine_features();
  66   static int  platform_features(int features);
  67 
  68   static bool is_niagara1(int features) { return (features & niagara1_m) == niagara1_m; }
  69 





  70 public:
  71   // Initialization
  72   static void initialize();
  73 
  74   // Instruction support
  75   static bool has_v8()                  { return (_features & v8_instructions_m) != 0; }
  76   static bool has_v9()                  { return (_features & v9_instructions_m) != 0; }
  77   static bool has_hardware_int_muldiv() { return (_features & hardware_int_muldiv_m) != 0; }
  78   static bool has_hardware_fsmuld()     { return (_features & hardware_fsmuld_m) != 0; }
  79   static bool has_vis1()                { return (_features & vis1_instructions_m) != 0; }
  80   static bool has_vis2()                { return (_features & vis2_instructions_m) != 0; }
  81 
  82   static bool supports_compare_and_exchange() 
  83                                         { return has_v9(); }
  84 
  85   static bool is_ultra3()               { return (_features & ultra3_m) == ultra3_m; }
  86   static bool is_sun4v()                { return (_features & sun4v_m) != 0; }
  87   static bool is_niagara1()             { return is_niagara1(_features); }
  88 
  89   static bool has_fast_fxtof()          { return has_v9() && !is_ultra3(); }


 115       count = 512;
 116     }
 117     return count;
 118   }
 119   static intx allocate_prefetch_style() {
 120     assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive");
 121     // Return 0 if AllocatePrefetchDistance was not defined.
 122     return AllocatePrefetchDistance > 0 ? AllocatePrefetchStyle : 0;
 123   }
 124 
 125   // Legacy
 126   static bool v8_instructions_work() { return has_v8() && !has_v9(); }
 127   static bool v9_instructions_work() { return has_v9(); }
 128 
 129   // Assembler testing
 130   static void allow_all();
 131   static void revert();
 132 
 133   // Override the Abstract_VM_Version implementation.
 134   static uint page_size_count() { return is_sun4v() ? 4 : 2; }



 135 };
   1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)vm_version_sparc.hpp 1.33 07/10/04 10:49:21 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  


  50     sun4v_m               = 1 << sun4v_instructions,
  51 
  52     generic_v8_m          = v8_instructions_m | hardware_int_muldiv_m | hardware_fsmuld_m,
  53     generic_v9_m          = generic_v8_m | v9_instructions_m | vis1_instructions_m,
  54     ultra3_m              = generic_v9_m | vis2_instructions_m,
  55 
  56     // Temporary until we have something more accurate
  57     niagara1_unique_m     = sun4v_m,
  58     niagara1_m            = generic_v9_m | niagara1_unique_m
  59   };
  60 
  61   static int  _features;
  62   static const char* _features_str;
  63 
  64   static void print_features();
  65   static int  determine_features();
  66   static int  platform_features(int features);
  67 
  68   static bool is_niagara1(int features) { return (features & niagara1_m) == niagara1_m; }
  69 
  70   static int maximum_niagara1_processor_count() { return 32; }
  71   // Returns true if the platform is in the niagara line and
  72   // newer than the niagara1.
  73   static bool is_niagara1_plus();
  74 
  75 public:
  76   // Initialization
  77   static void initialize();
  78 
  79   // Instruction support
  80   static bool has_v8()                  { return (_features & v8_instructions_m) != 0; }
  81   static bool has_v9()                  { return (_features & v9_instructions_m) != 0; }
  82   static bool has_hardware_int_muldiv() { return (_features & hardware_int_muldiv_m) != 0; }
  83   static bool has_hardware_fsmuld()     { return (_features & hardware_fsmuld_m) != 0; }
  84   static bool has_vis1()                { return (_features & vis1_instructions_m) != 0; }
  85   static bool has_vis2()                { return (_features & vis2_instructions_m) != 0; }
  86 
  87   static bool supports_compare_and_exchange() 
  88                                         { return has_v9(); }
  89 
  90   static bool is_ultra3()               { return (_features & ultra3_m) == ultra3_m; }
  91   static bool is_sun4v()                { return (_features & sun4v_m) != 0; }
  92   static bool is_niagara1()             { return is_niagara1(_features); }
  93 
  94   static bool has_fast_fxtof()          { return has_v9() && !is_ultra3(); }


 120       count = 512;
 121     }
 122     return count;
 123   }
 124   static intx allocate_prefetch_style() {
 125     assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive");
 126     // Return 0 if AllocatePrefetchDistance was not defined.
 127     return AllocatePrefetchDistance > 0 ? AllocatePrefetchStyle : 0;
 128   }
 129 
 130   // Legacy
 131   static bool v8_instructions_work() { return has_v8() && !has_v9(); }
 132   static bool v9_instructions_work() { return has_v9(); }
 133 
 134   // Assembler testing
 135   static void allow_all();
 136   static void revert();
 137 
 138   // Override the Abstract_VM_Version implementation.
 139   static uint page_size_count() { return is_sun4v() ? 4 : 2; }
 140 
 141   // Calculates the number of parallel threads
 142   static unsigned int calc_parallel_worker_threads();
 143 };