Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
2079:cccd1b172b85 | 2080:c04052fd6ae1 |
---|---|
39 v9_instructions = 5, | 39 v9_instructions = 5, |
40 vis1_instructions = 6, | 40 vis1_instructions = 6, |
41 vis2_instructions = 7, | 41 vis2_instructions = 7, |
42 sun4v_instructions = 8, | 42 sun4v_instructions = 8, |
43 blk_init_instructions = 9, | 43 blk_init_instructions = 9, |
44 fmaf_instructions = 10 | 44 fmaf_instructions = 10, |
45 fmau_instructions = 11, | |
46 vis3_instructions = 12, | |
47 sparc64_family = 13, | |
48 T_family = 14, | |
49 T1_model = 15 | |
45 }; | 50 }; |
46 | 51 |
47 enum Feature_Flag_Set { | 52 enum Feature_Flag_Set { |
48 unknown_m = 0, | 53 unknown_m = 0, |
49 all_features_m = -1, | 54 all_features_m = -1, |
57 vis1_instructions_m = 1 << vis1_instructions, | 62 vis1_instructions_m = 1 << vis1_instructions, |
58 vis2_instructions_m = 1 << vis2_instructions, | 63 vis2_instructions_m = 1 << vis2_instructions, |
59 sun4v_m = 1 << sun4v_instructions, | 64 sun4v_m = 1 << sun4v_instructions, |
60 blk_init_instructions_m = 1 << blk_init_instructions, | 65 blk_init_instructions_m = 1 << blk_init_instructions, |
61 fmaf_instructions_m = 1 << fmaf_instructions, | 66 fmaf_instructions_m = 1 << fmaf_instructions, |
67 fmau_instructions_m = 1 << fmau_instructions, | |
68 vis3_instructions_m = 1 << vis3_instructions, | |
69 sparc64_family_m = 1 << sparc64_family, | |
70 T_family_m = 1 << T_family, | |
71 T1_model_m = 1 << T1_model, | |
62 | 72 |
63 generic_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m, | 73 generic_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m, |
64 generic_v9_m = generic_v8_m | v9_instructions_m, | 74 generic_v9_m = generic_v8_m | v9_instructions_m, |
65 ultra3_m = generic_v9_m | vis1_instructions_m | vis2_instructions_m, | 75 ultra3_m = generic_v9_m | vis1_instructions_m | vis2_instructions_m, |
66 | 76 |
74 | 84 |
75 static void print_features(); | 85 static void print_features(); |
76 static int determine_features(); | 86 static int determine_features(); |
77 static int platform_features(int features); | 87 static int platform_features(int features); |
78 | 88 |
79 static bool is_niagara1(int features) { return (features & sun4v_m) != 0; } | 89 // Returns true if the platform is in the niagara line (T series) |
80 static bool is_sparc64(int features) { return (features & fmaf_instructions_m) != 0; } | 90 static bool is_T_family(int features) { return (features & T_family_m) != 0; } |
91 static bool is_niagara() { return is_T_family(_features); } | |
92 DEBUG_ONLY( static bool is_niagara(int features) { return (features & sun4v_m) != 0; } ) | |
93 | |
94 // Returns true if it is niagara1 (T1). | |
95 static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); } | |
81 | 96 |
82 static int maximum_niagara1_processor_count() { return 32; } | 97 static int maximum_niagara1_processor_count() { return 32; } |
83 | 98 |
84 public: | 99 public: |
85 // Initialization | 100 // Initialization |
92 static bool has_hardware_div32() { return (_features & hardware_div32_m) != 0; } | 107 static bool has_hardware_div32() { return (_features & hardware_div32_m) != 0; } |
93 static bool has_hardware_fsmuld() { return (_features & hardware_fsmuld_m) != 0; } | 108 static bool has_hardware_fsmuld() { return (_features & hardware_fsmuld_m) != 0; } |
94 static bool has_hardware_popc() { return (_features & hardware_popc_m) != 0; } | 109 static bool has_hardware_popc() { return (_features & hardware_popc_m) != 0; } |
95 static bool has_vis1() { return (_features & vis1_instructions_m) != 0; } | 110 static bool has_vis1() { return (_features & vis1_instructions_m) != 0; } |
96 static bool has_vis2() { return (_features & vis2_instructions_m) != 0; } | 111 static bool has_vis2() { return (_features & vis2_instructions_m) != 0; } |
112 static bool has_vis3() { return (_features & vis3_instructions_m) != 0; } | |
97 static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } | 113 static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } |
98 | 114 |
99 static bool supports_compare_and_exchange() | 115 static bool supports_compare_and_exchange() |
100 { return has_v9(); } | 116 { return has_v9(); } |
101 | 117 |
102 static bool is_ultra3() { return (_features & ultra3_m) == ultra3_m; } | 118 static bool is_ultra3() { return (_features & ultra3_m) == ultra3_m; } |
103 static bool is_sun4v() { return (_features & sun4v_m) != 0; } | 119 static bool is_sun4v() { return (_features & sun4v_m) != 0; } |
104 static bool is_niagara1() { return is_niagara1(_features); } | 120 // Returns true if the platform is in the niagara line (T series) |
105 // Returns true if the platform is in the niagara line and | 121 // and newer than the niagara1. |
106 // newer than the niagara1. | 122 static bool is_niagara_plus() { return is_T_family(_features) && !is_T1_model(_features); } |
107 static bool is_niagara1_plus(); | 123 // Fujitsu SPARC64 |
108 static bool is_sparc64() { return is_sparc64(_features); } | 124 static bool is_sparc64() { return (_features & sparc64_family_m) != 0; } |
109 | 125 |
110 static bool has_fast_fxtof() { return has_v9() && !is_ultra3(); } | 126 static bool has_fast_fxtof() { return is_niagara() || is_sparc64() || has_v9() && !is_ultra3(); } |
111 static bool has_fast_idiv() { return is_niagara1_plus() || is_sparc64(); } | 127 static bool has_fast_idiv() { return is_niagara_plus() || is_sparc64(); } |
112 | 128 |
113 static const char* cpu_features() { return _features_str; } | 129 static const char* cpu_features() { return _features_str; } |
114 | 130 |
115 static intx L1_data_cache_line_size() { | 131 static intx L1_data_cache_line_size() { |
116 return 64; // default prefetch block size on sparc | 132 return 64; // default prefetch block size on sparc |