25
26 #ifndef CPU_PPC_VM_VM_VERSION_PPC_HPP
27 #define CPU_PPC_VM_VM_VERSION_PPC_HPP
28
29 #include "runtime/globals_extension.hpp"
30 #include "runtime/vm_version.hpp"
31
32 class VM_Version: public Abstract_VM_Version {
33 protected:
34 enum Feature_Flag {
35 fsqrt,
36 fsqrts,
37 isel,
38 lxarxeh,
39 cmpb,
40 popcntb,
41 popcntw,
42 fcfids,
43 vand,
44 dcba,
45 num_features // last entry to count features
46 };
47 enum Feature_Flag_Set {
48 unknown_m = 0,
49 fsqrt_m = (1 << fsqrt ),
50 fsqrts_m = (1 << fsqrts ),
51 isel_m = (1 << isel ),
52 lxarxeh_m = (1 << lxarxeh),
53 cmpb_m = (1 << cmpb ),
54 popcntb_m = (1 << popcntb),
55 popcntw_m = (1 << popcntw),
56 fcfids_m = (1 << fcfids ),
57 vand_m = (1 << vand ),
58 dcba_m = (1 << dcba ),
59 all_features_m = -1
60 };
61 static int _features;
62 static int _measured_cache_line_size;
63 static const char* _features_str;
64 static bool _is_determine_features_test_running;
65
66 static void print_features();
67 static void determine_features(); // also measures cache line size
68 static void determine_section_size();
69 static void power6_micro_bench();
70 public:
71 // Initialization
72 static void initialize();
73
74 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
75 // CPU instruction support
76 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
77 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
78 static bool has_isel() { return (_features & isel_m) != 0; }
79 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
80 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
81 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
82 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
83 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
84 static bool has_vand() { return (_features & vand_m) != 0; }
85 static bool has_dcba() { return (_features & dcba_m) != 0; }
86
87 static const char* cpu_features() { return _features_str; }
88
89 static int get_cache_line_size() { return _measured_cache_line_size; }
90
91 // Assembler testing
92 static void allow_all();
93 static void revert();
94 };
95
96 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP
|
25
26 #ifndef CPU_PPC_VM_VM_VERSION_PPC_HPP
27 #define CPU_PPC_VM_VM_VERSION_PPC_HPP
28
29 #include "runtime/globals_extension.hpp"
30 #include "runtime/vm_version.hpp"
31
32 class VM_Version: public Abstract_VM_Version {
33 protected:
34 enum Feature_Flag {
35 fsqrt,
36 fsqrts,
37 isel,
38 lxarxeh,
39 cmpb,
40 popcntb,
41 popcntw,
42 fcfids,
43 vand,
44 dcba,
45 vcipher,
46 num_features // last entry to count features
47 };
48 enum Feature_Flag_Set {
49 unknown_m = 0,
50 fsqrt_m = (1 << fsqrt ),
51 fsqrts_m = (1 << fsqrts ),
52 isel_m = (1 << isel ),
53 lxarxeh_m = (1 << lxarxeh),
54 cmpb_m = (1 << cmpb ),
55 popcntb_m = (1 << popcntb),
56 popcntw_m = (1 << popcntw),
57 fcfids_m = (1 << fcfids ),
58 vand_m = (1 << vand ),
59 dcba_m = (1 << dcba ),
60 vcipher_m = (1 << vcipher),
61 all_features_m = -1
62 };
63 static int _features;
64 static int _measured_cache_line_size;
65 static const char* _features_str;
66 static bool _is_determine_features_test_running;
67
68 static void print_features();
69 static void determine_features(); // also measures cache line size
70 static void determine_section_size();
71 static void power6_micro_bench();
72 public:
73 // Initialization
74 static void initialize();
75
76 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
77 // CPU instruction support
78 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
79 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
80 static bool has_isel() { return (_features & isel_m) != 0; }
81 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
82 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
83 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
84 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
85 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
86 static bool has_vand() { return (_features & vand_m) != 0; }
87 static bool has_dcba() { return (_features & dcba_m) != 0; }
88 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
89
90 static const char* cpu_features() { return _features_str; }
91
92 static int get_cache_line_size() { return _measured_cache_line_size; }
93
94 // Assembler testing
95 static void allow_all();
96 static void revert();
97 };
98
99 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP
|