diff src/cpu/sparc/vm/vm_version_sparc.hpp @ 2080:c04052fd6ae1

7006505: Use kstat info to identify SPARC processor Summary: read Solaris kstat data to get more precise CPU information Reviewed-by: iveresov, never, twisti, dholmes
author kvn
date Thu, 16 Dec 2010 14:15:12 -0800
parents 2f644f85485d
children 3d42f82cd811
line wrap: on
line diff
--- a/src/cpu/sparc/vm/vm_version_sparc.hpp	Thu Dec 16 12:47:52 2010 -0800
+++ b/src/cpu/sparc/vm/vm_version_sparc.hpp	Thu Dec 16 14:15:12 2010 -0800
@@ -41,7 +41,12 @@
     vis2_instructions  = 7,
     sun4v_instructions = 8,
     blk_init_instructions = 9,
-    fmaf_instructions  = 10
+    fmaf_instructions  = 10,
+    fmau_instructions  = 11,
+    vis3_instructions  = 12,
+    sparc64_family     = 13,
+    T_family           = 14,
+    T1_model           = 15
   };
 
   enum Feature_Flag_Set {
@@ -59,6 +64,11 @@
     sun4v_m             = 1 << sun4v_instructions,
     blk_init_instructions_m = 1 << blk_init_instructions,
     fmaf_instructions_m = 1 << fmaf_instructions,
+    fmau_instructions_m = 1 << fmau_instructions,
+    vis3_instructions_m = 1 << vis3_instructions,
+    sparc64_family_m    = 1 << sparc64_family,
+    T_family_m          = 1 << T_family,
+    T1_model_m          = 1 << T1_model,
 
     generic_v8_m        = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m,
     generic_v9_m        = generic_v8_m | v9_instructions_m,
@@ -76,8 +86,13 @@
   static int  determine_features();
   static int  platform_features(int features);
 
-  static bool is_niagara1(int features) { return (features & sun4v_m) != 0; }
-  static bool  is_sparc64(int features) { return (features & fmaf_instructions_m) != 0; }
+  // Returns true if the platform is in the niagara line (T series)
+  static bool is_T_family(int features) { return (features & T_family_m) != 0; }
+  static bool is_niagara() { return is_T_family(_features); }
+  DEBUG_ONLY( static bool is_niagara(int features)  { return (features & sun4v_m) != 0; } )
+
+  // Returns true if it is niagara1 (T1).
+  static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); }
 
   static int maximum_niagara1_processor_count() { return 32; }
 
@@ -94,6 +109,7 @@
   static bool has_hardware_popc()       { return (_features & hardware_popc_m) != 0; }
   static bool has_vis1()                { return (_features & vis1_instructions_m) != 0; }
   static bool has_vis2()                { return (_features & vis2_instructions_m) != 0; }
+  static bool has_vis3()                { return (_features & vis3_instructions_m) != 0; }
   static bool has_blk_init()            { return (_features & blk_init_instructions_m) != 0; }
 
   static bool supports_compare_and_exchange()
@@ -101,14 +117,14 @@
 
   static bool is_ultra3()               { return (_features & ultra3_m) == ultra3_m; }
   static bool is_sun4v()                { return (_features & sun4v_m) != 0; }
-  static bool is_niagara1()             { return is_niagara1(_features); }
-  // Returns true if the platform is in the niagara line and
-  // newer than the niagara1.
-  static bool is_niagara1_plus();
-  static bool is_sparc64()              { return is_sparc64(_features); }
+  // Returns true if the platform is in the niagara line (T series)
+  // and newer than the niagara1.
+  static bool is_niagara_plus()         { return is_T_family(_features) && !is_T1_model(_features); }
+  // Fujitsu SPARC64
+  static bool is_sparc64()              { return (_features & sparc64_family_m) != 0; }
 
-  static bool has_fast_fxtof()          { return has_v9() && !is_ultra3(); }
-  static bool has_fast_idiv()           { return is_niagara1_plus() || is_sparc64(); }
+  static bool has_fast_fxtof()          { return is_niagara() || is_sparc64() || has_v9() && !is_ultra3(); }
+  static bool has_fast_idiv()           { return is_niagara_plus() || is_sparc64(); }
 
   static const char* cpu_features()     { return _features_str; }