107 static bool is_M_family(int features) { return (features & M_family_m) != 0; } 108 static bool is_T_family(int features) { return (features & T_family_m) != 0; } 109 static bool is_niagara() { return is_T_family(_features); } 110 #ifdef ASSERT 111 static bool is_niagara(int features) { 112 // 'sun4v_m' may be defined on both Sun/Oracle Sparc CPUs as well as 113 // on Fujitsu Sparc64 CPUs, but only Sun/Oracle Sparcs can be 'niagaras'. 114 return (features & sun4v_m) != 0 && (features & sparc64_family_m) == 0; 115 } 116 #endif 117 118 // Returns true if it is niagara1 (T1). 119 static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); } 120 121 static int maximum_niagara1_processor_count() { return 32; } 122 123 public: 124 // Initialization 125 static void initialize(); 126 127 // Instruction support 128 static bool has_v8() { return (_features & v8_instructions_m) != 0; } 129 static bool has_v9() { return (_features & v9_instructions_m) != 0; } 130 static bool has_hardware_mul32() { return (_features & hardware_mul32_m) != 0; } 131 static bool has_hardware_div32() { return (_features & hardware_div32_m) != 0; } 132 static bool has_hardware_fsmuld() { return (_features & hardware_fsmuld_m) != 0; } 133 static bool has_hardware_popc() { return (_features & hardware_popc_m) != 0; } 134 static bool has_vis1() { return (_features & vis1_instructions_m) != 0; } 135 static bool has_vis2() { return (_features & vis2_instructions_m) != 0; } 136 static bool has_vis3() { return (_features & vis3_instructions_m) != 0; } 137 static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } 138 static bool has_cbcond() { return (_features & cbcond_instructions_m) != 0; } 139 static bool has_sparc5_instr() { return (_features & sparc5_instructions_m) != 0; } 140 static bool has_aes() { return (_features & aes_instructions_m) != 0; } 141 static bool has_sha1() { return (_features & sha1_instruction_m) != 0; } 142 static bool has_sha256() { return (_features & sha256_instruction_m) != 0; } 143 static bool has_sha512() { return (_features & sha512_instruction_m) != 0; } 144 145 static bool supports_compare_and_exchange() 146 { return has_v9(); } | 107 static bool is_M_family(int features) { return (features & M_family_m) != 0; } 108 static bool is_T_family(int features) { return (features & T_family_m) != 0; } 109 static bool is_niagara() { return is_T_family(_features); } 110 #ifdef ASSERT 111 static bool is_niagara(int features) { 112 // 'sun4v_m' may be defined on both Sun/Oracle Sparc CPUs as well as 113 // on Fujitsu Sparc64 CPUs, but only Sun/Oracle Sparcs can be 'niagaras'. 114 return (features & sun4v_m) != 0 && (features & sparc64_family_m) == 0; 115 } 116 #endif 117 118 // Returns true if it is niagara1 (T1). 119 static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); } 120 121 static int maximum_niagara1_processor_count() { return 32; } 122 123 public: 124 // Initialization 125 static void initialize(); 126 127 static void init_before_ergo() { _features = determine_features(); } 128 129 // Instruction support 130 static bool has_v8() { return (_features & v8_instructions_m) != 0; } 131 static bool has_v9() { return (_features & v9_instructions_m) != 0; } 132 static bool has_hardware_mul32() { return (_features & hardware_mul32_m) != 0; } 133 static bool has_hardware_div32() { return (_features & hardware_div32_m) != 0; } 134 static bool has_hardware_fsmuld() { return (_features & hardware_fsmuld_m) != 0; } 135 static bool has_hardware_popc() { return (_features & hardware_popc_m) != 0; } 136 static bool has_vis1() { return (_features & vis1_instructions_m) != 0; } 137 static bool has_vis2() { return (_features & vis2_instructions_m) != 0; } 138 static bool has_vis3() { return (_features & vis3_instructions_m) != 0; } 139 static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } 140 static bool has_cbcond() { return (_features & cbcond_instructions_m) != 0; } 141 static bool has_sparc5_instr() { return (_features & sparc5_instructions_m) != 0; } 142 static bool has_aes() { return (_features & aes_instructions_m) != 0; } 143 static bool has_sha1() { return (_features & sha1_instruction_m) != 0; } 144 static bool has_sha256() { return (_features & sha256_instruction_m) != 0; } 145 static bool has_sha512() { return (_features & sha512_instruction_m) != 0; } 146 147 static bool supports_compare_and_exchange() 148 { return has_v9(); } |