Tue, 11 Feb 2014 08:49:37 -0800
8031290: Adjust call to getisax() for additional words returned
Reviewed-by: kvn
src/cpu/sparc/vm/vm_version_sparc.hpp | file | annotate | diff | comparison | revisions | |
src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/sparc/vm/vm_version_sparc.hpp Thu Jan 23 09:33:50 2014 +0000 1.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.hpp Tue Feb 11 08:49:37 2014 -0800 1.3 @@ -49,7 +49,8 @@ 1.4 M_family = 15, 1.5 T_family = 16, 1.6 T1_model = 17, 1.7 - aes_instructions = 18 1.8 + sparc5_instructions = 18, 1.9 + aes_instructions = 19 1.10 }; 1.11 1.12 enum Feature_Flag_Set { 1.13 @@ -74,6 +75,7 @@ 1.14 M_family_m = 1 << M_family, 1.15 T_family_m = 1 << T_family, 1.16 T1_model_m = 1 << T1_model, 1.17 + sparc5_instructions_m = 1 << sparc5_instructions, 1.18 aes_instructions_m = 1 << aes_instructions, 1.19 1.20 generic_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m, 1.21 @@ -125,6 +127,7 @@ 1.22 static bool has_vis3() { return (_features & vis3_instructions_m) != 0; } 1.23 static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } 1.24 static bool has_cbcond() { return (_features & cbcond_instructions_m) != 0; } 1.25 + static bool has_sparc5_instr() { return (_features & sparc5_instructions_m) != 0; } 1.26 static bool has_aes() { return (_features & aes_instructions_m) != 0; } 1.27 1.28 static bool supports_compare_and_exchange() 1.29 @@ -136,6 +139,7 @@ 1.30 1.31 static bool is_M_series() { return is_M_family(_features); } 1.32 static bool is_T4() { return is_T_family(_features) && has_cbcond(); } 1.33 + static bool is_T7() { return is_T_family(_features) && has_sparc5_instr(); } 1.34 1.35 // Fujitsu SPARC64 1.36 static bool is_sparc64() { return (_features & sparc64_family_m) != 0; } 1.37 @@ -155,7 +159,7 @@ 1.38 static const char* cpu_features() { return _features_str; } 1.39 1.40 static intx prefetch_data_size() { 1.41 - return is_T4() ? 32 : 64; // default prefetch block size on sparc 1.42 + return is_T4() && !is_T7() ? 32 : 64; // default prefetch block size on sparc 1.43 } 1.44 1.45 // Prefetch
2.1 --- a/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Thu Jan 23 09:33:50 2014 +0000 2.2 +++ b/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp Tue Feb 11 08:49:37 2014 -0800 2.3 @@ -75,13 +75,19 @@ 2.4 do_sysinfo(SI_ARCHITECTURE_64, "sparcv9", &features, generic_v9_m); 2.5 2.6 // Extract valid instruction set extensions. 2.7 - uint_t av; 2.8 - uint_t avn = os::Solaris::getisax(&av, 1); 2.9 - assert(avn == 1, "should only return one av"); 2.10 + uint_t avs[2]; 2.11 + uint_t avn = os::Solaris::getisax(avs, 2); 2.12 + assert(avn <= 2, "should return two or less av's"); 2.13 + uint_t av = avs[0]; 2.14 2.15 #ifndef PRODUCT 2.16 - if (PrintMiscellaneous && Verbose) 2.17 - tty->print_cr("getisax(2) returned: " PTR32_FORMAT, av); 2.18 + if (PrintMiscellaneous && Verbose) { 2.19 + tty->print("getisax(2) returned: " PTR32_FORMAT, av); 2.20 + if (avn > 1) { 2.21 + tty->print(", " PTR32_FORMAT, avs[1]); 2.22 + } 2.23 + tty->cr(); 2.24 + } 2.25 #endif 2.26 2.27 if (av & AV_SPARC_MUL32) features |= hardware_mul32_m; 2.28 @@ -91,6 +97,13 @@ 2.29 if (av & AV_SPARC_POPC) features |= hardware_popc_m; 2.30 if (av & AV_SPARC_VIS) features |= vis1_instructions_m; 2.31 if (av & AV_SPARC_VIS2) features |= vis2_instructions_m; 2.32 + if (avn > 1) { 2.33 + uint_t av2 = avs[1]; 2.34 +#ifndef AV2_SPARC_SPARC5 2.35 +#define AV2_SPARC_SPARC5 0x00000008 /* The 29 new fp and sub instructions */ 2.36 +#endif 2.37 + if (av2 & AV2_SPARC_SPARC5) features |= sparc5_instructions_m; 2.38 + } 2.39 2.40 // Next values are not defined before Solaris 10 2.41 // but Solaris 8 is used for jdk6 update builds.