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 tcheck,
48 mfdscr,
49 vsx,
50 ldbrx,
51 stdbrx,
52 num_features // last entry to count features
53 };
54 enum Feature_Flag_Set {
55 unknown_m = 0,
56 fsqrt_m = (1 << fsqrt ),
57 fsqrts_m = (1 << fsqrts ),
58 isel_m = (1 << isel ),
59 lxarxeh_m = (1 << lxarxeh),
60 cmpb_m = (1 << cmpb ),
61 popcntb_m = (1 << popcntb),
62 popcntw_m = (1 << popcntw),
63 fcfids_m = (1 << fcfids ),
64 vand_m = (1 << vand ),
65 lqarx_m = (1 << lqarx ),
66 vcipher_m = (1 << vcipher),
67 vpmsumb_m = (1 << vpmsumb),
68 tcheck_m = (1 << tcheck ),
69 mfdscr_m = (1 << mfdscr ),
70 vsx_m = (1 << vsx ),
71 ldbrx_m = (1 << ldbrx ),
72 stdbrx_m = (1 << stdbrx ),
73 all_features_m = (unsigned long)-1
74 };
75
76 static bool _is_determine_features_test_running;
77
78 static void print_features();
79 static void determine_features(); // also measures cache line size
80 static void config_dscr(); // Power 8: Configure Data Stream Control Register.
81 static void determine_section_size();
82 static void power6_micro_bench();
83 public:
84 // Initialization
85 static void initialize();
86
89
90 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
91 // CPU instruction support
92 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
93 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
94 static bool has_isel() { return (_features & isel_m) != 0; }
95 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
96 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
97 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
98 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
99 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
100 static bool has_vand() { return (_features & vand_m) != 0; }
101 static bool has_lqarx() { return (_features & lqarx_m) != 0; }
102 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
103 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
104 static bool has_tcheck() { return (_features & tcheck_m) != 0; }
105 static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
106 static bool has_vsx() { return (_features & vsx_m) != 0; }
107 static bool has_ldbrx() { return (_features & ldbrx_m) != 0; }
108 static bool has_stdbrx() { return (_features & stdbrx_m) != 0; }
109 static bool has_mtfprd() { return has_vpmsumb(); } // alias for P8
110
111 // Assembler testing
112 static void allow_all();
113 static void revert();
114
115 // POWER 8: DSCR current value.
116 static uint64_t _dscr_val;
117 };
118
119 #endif // CPU_PPC_VM_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 tcheck,
48 mfdscr,
49 vsx,
50 ldbrx,
51 stdbrx,
52 vshasig,
53 num_features // last entry to count features
54 };
55 enum Feature_Flag_Set {
56 unknown_m = 0,
57 fsqrt_m = (1 << fsqrt ),
58 fsqrts_m = (1 << fsqrts ),
59 isel_m = (1 << isel ),
60 lxarxeh_m = (1 << lxarxeh),
61 cmpb_m = (1 << cmpb ),
62 popcntb_m = (1 << popcntb),
63 popcntw_m = (1 << popcntw),
64 fcfids_m = (1 << fcfids ),
65 vand_m = (1 << vand ),
66 lqarx_m = (1 << lqarx ),
67 vcipher_m = (1 << vcipher),
68 vshasig_m = (1 << vshasig),
69 vpmsumb_m = (1 << vpmsumb),
70 tcheck_m = (1 << tcheck ),
71 mfdscr_m = (1 << mfdscr ),
72 vsx_m = (1 << vsx ),
73 ldbrx_m = (1 << ldbrx ),
74 stdbrx_m = (1 << stdbrx ),
75 all_features_m = (unsigned long)-1
76 };
77
78 static bool _is_determine_features_test_running;
79
80 static void print_features();
81 static void determine_features(); // also measures cache line size
82 static void config_dscr(); // Power 8: Configure Data Stream Control Register.
83 static void determine_section_size();
84 static void power6_micro_bench();
85 public:
86 // Initialization
87 static void initialize();
88
91
92 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
93 // CPU instruction support
94 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
95 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
96 static bool has_isel() { return (_features & isel_m) != 0; }
97 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
98 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
99 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
100 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
101 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
102 static bool has_vand() { return (_features & vand_m) != 0; }
103 static bool has_lqarx() { return (_features & lqarx_m) != 0; }
104 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
105 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
106 static bool has_tcheck() { return (_features & tcheck_m) != 0; }
107 static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
108 static bool has_vsx() { return (_features & vsx_m) != 0; }
109 static bool has_ldbrx() { return (_features & ldbrx_m) != 0; }
110 static bool has_stdbrx() { return (_features & stdbrx_m) != 0; }
111 static bool has_vshasig() { return (_features & vshasig_m) != 0; }
112 static bool has_mtfprd() { return has_vpmsumb(); } // alias for P8
113
114 // Assembler testing
115 static void allow_all();
116 static void revert();
117
118 // POWER 8: DSCR current value.
119 static uint64_t _dscr_val;
120 };
121
122 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP
|