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 lqarx,
45 vcipher,
46 vpmsumb,
47 mfdscr,
48 vsx,
49 ldbrx,
50 stdbrx,
51 vshasig,
52 rtm,
53 darn,
54 brw,
55 num_features // last entry to count features
56 };
57 enum Feature_Flag_Set {
58 unknown_m = 0,
59 fsqrt_m = (1 << fsqrt ),
60 fsqrts_m = (1 << fsqrts ),
61 isel_m = (1 << isel ),
62 lxarxeh_m = (1 << lxarxeh),
63 cmpb_m = (1 << cmpb ),
64 popcntb_m = (1 << popcntb),
65 popcntw_m = (1 << popcntw),
66 fcfids_m = (1 << fcfids ),
67 vand_m = (1 << vand ),
68 lqarx_m = (1 << lqarx ),
69 vcipher_m = (1 << vcipher),
70 vpmsumb_m = (1 << vpmsumb),
71 mfdscr_m = (1 << mfdscr ),
72 vsx_m = (1 << vsx ),
73 ldbrx_m = (1 << ldbrx ),
74 stdbrx_m = (1 << stdbrx ),
75 vshasig_m = (1 << vshasig),
76 rtm_m = (1 << rtm ),
77 darn_m = (1 << darn ),
78 brw_m = (1 << brw ),
79 all_features_m = (unsigned long)-1
80 };
81
82 static bool _is_determine_features_test_running;
83
84 static void print_features();
85 static void determine_features(); // also measures cache line size
86 static void config_dscr(); // Power 8: Configure Data Stream Control Register.
87
88 public:
89 // Initialization
90 static void initialize();
91 static void check_virtualizations();
92
93 // Override Abstract_VM_Version implementation
94 static void print_platform_virtualization_info(outputStream*);
95
96 // PPC64 supports fast class initialization checks for static methods.
97 static bool supports_fast_class_init_checks() { return true; }
98 constexpr static bool supports_stack_watermark_barrier() { return true; }
99
100 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
101 // CPU instruction support
102 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
103 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
104 static bool has_isel() { return (_features & isel_m) != 0; }
105 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
106 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
107 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
108 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
109 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
110 static bool has_vand() { return (_features & vand_m) != 0; }
111 static bool has_lqarx() { return (_features & lqarx_m) != 0; }
112 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
113 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
114 static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
115 static bool has_vsx() { return (_features & vsx_m) != 0; }
116 static bool has_ldbrx() { return (_features & ldbrx_m) != 0; }
117 static bool has_stdbrx() { return (_features & stdbrx_m) != 0; }
118 static bool has_vshasig() { return (_features & vshasig_m) != 0; }
119 static bool has_tm() { return (_features & rtm_m) != 0; }
120 static bool has_darn() { return (_features & darn_m) != 0; }
121 static bool has_brw() { return (_features & brw_m) != 0; }
122
123 static bool has_mtfprd() { return has_vpmsumb(); } // alias for P8
124
125 // Assembler testing
126 static void allow_all();
127 static void revert();
128
129 // POWER 8: DSCR current value.
130 static uint64_t _dscr_val;
131
132 static void initialize_cpu_information(void);
133 };
134
135 #endif // CPU_PPC_VM_VERSION_PPC_HPP
|
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 lqarx,
45 vcipher,
46 vpmsumb,
47 mfdscr,
48 vsx,
49 ldbrx,
50 stdbrx,
51 vshasig,
52 darn,
53 brw,
54 num_features // last entry to count features
55 };
56 enum Feature_Flag_Set {
57 unknown_m = 0,
58 fsqrt_m = (1 << fsqrt ),
59 fsqrts_m = (1 << fsqrts ),
60 isel_m = (1 << isel ),
61 lxarxeh_m = (1 << lxarxeh),
62 cmpb_m = (1 << cmpb ),
63 popcntb_m = (1 << popcntb),
64 popcntw_m = (1 << popcntw),
65 fcfids_m = (1 << fcfids ),
66 vand_m = (1 << vand ),
67 lqarx_m = (1 << lqarx ),
68 vcipher_m = (1 << vcipher),
69 vpmsumb_m = (1 << vpmsumb),
70 mfdscr_m = (1 << mfdscr ),
71 vsx_m = (1 << vsx ),
72 ldbrx_m = (1 << ldbrx ),
73 stdbrx_m = (1 << stdbrx ),
74 vshasig_m = (1 << vshasig),
75 darn_m = (1 << darn ),
76 brw_m = (1 << brw ),
77 all_features_m = (unsigned long)-1
78 };
79
80 static bool _is_determine_features_test_running;
81
82 static void print_features();
83 static void determine_features(); // also measures cache line size
84 static void config_dscr(); // Power 8: Configure Data Stream Control Register.
85
86 public:
87 // Initialization
88 static void initialize();
89 static void check_virtualizations();
90
91 // Override Abstract_VM_Version implementation
92 static void print_platform_virtualization_info(outputStream*);
93
94 // PPC64 supports fast class initialization checks for static methods.
95 static bool supports_fast_class_init_checks() { return true; }
96 constexpr static bool supports_stack_watermark_barrier() { return true; }
97 constexpr static bool supports_recursive_lightweight_locking() { return true; }
98
99 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
100 // CPU instruction support
101 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
102 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
103 static bool has_isel() { return (_features & isel_m) != 0; }
104 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
105 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
106 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
107 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
108 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
109 static bool has_vand() { return (_features & vand_m) != 0; }
110 static bool has_lqarx() { return (_features & lqarx_m) != 0; }
111 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
112 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
113 static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
114 static bool has_vsx() { return (_features & vsx_m) != 0; }
115 static bool has_ldbrx() { return (_features & ldbrx_m) != 0; }
116 static bool has_stdbrx() { return (_features & stdbrx_m) != 0; }
117 static bool has_vshasig() { return (_features & vshasig_m) != 0; }
118 static bool has_darn() { return (_features & darn_m) != 0; }
119 static bool has_brw() { return (_features & brw_m) != 0; }
120
121 static bool has_mtfprd() { return has_vpmsumb(); } // alias for P8
122
123 // Assembler testing
124 static void allow_all();
125 static void revert();
126
127 // POWER 8: DSCR current value.
128 static uint64_t _dscr_val;
129
130 static void initialize_cpu_information(void);
131 };
132
133 #endif // CPU_PPC_VM_VERSION_PPC_HPP
|