1 /*
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
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 lqarx,
45 vcipher,
46 vpmsumb,
47 tcheck,
48 num_features // last entry to count features
49 };
50 enum Feature_Flag_Set {
51 unknown_m = 0,
52 fsqrt_m = (1 << fsqrt ),
53 fsqrts_m = (1 << fsqrts ),
54 isel_m = (1 << isel ),
55 lxarxeh_m = (1 << lxarxeh),
56 cmpb_m = (1 << cmpb ),
57 popcntb_m = (1 << popcntb),
58 popcntw_m = (1 << popcntw),
59 fcfids_m = (1 << fcfids ),
60 vand_m = (1 << vand ),
61 lqarx_m = (1 << lqarx ),
62 vcipher_m = (1 << vcipher),
63 vpmsumb_m = (1 << vpmsumb),
64 tcheck_m = (1 << tcheck ),
65 all_features_m = (unsigned long)-1
66 };
67
68 static bool _is_determine_features_test_running;
69
70 static void print_features();
71 static void determine_features(); // also measures cache line size
72 static void config_dscr(); // Power 8: Configure Data Stream Control Register.
73 static void determine_section_size();
74 static void power6_micro_bench();
75 public:
76 // Initialization
77 static void initialize();
78
79 // Override Abstract_VM_Version implementation
80 static bool use_biased_locking();
81
82 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
83 // CPU instruction support
84 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
85 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
86 static bool has_isel() { return (_features & isel_m) != 0; }
87 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
88 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
89 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
90 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
91 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
92 static bool has_vand() { return (_features & vand_m) != 0; }
93 static bool has_lqarx() { return (_features & lqarx_m) != 0; }
94 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
95 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
96 static bool has_tcheck() { return (_features & tcheck_m) != 0; }
97
98 // Assembler testing
99 static void allow_all();
100 static void revert();
101 };
102
103 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP
|
1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
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 lqarx,
45 vcipher,
46 vpmsumb,
47 tcheck,
48 mfdscr,
49 num_features // last entry to count features
50 };
51 enum Feature_Flag_Set {
52 unknown_m = 0,
53 fsqrt_m = (1 << fsqrt ),
54 fsqrts_m = (1 << fsqrts ),
55 isel_m = (1 << isel ),
56 lxarxeh_m = (1 << lxarxeh),
57 cmpb_m = (1 << cmpb ),
58 popcntb_m = (1 << popcntb),
59 popcntw_m = (1 << popcntw),
60 fcfids_m = (1 << fcfids ),
61 vand_m = (1 << vand ),
62 lqarx_m = (1 << lqarx ),
63 vcipher_m = (1 << vcipher),
64 vpmsumb_m = (1 << vpmsumb),
65 tcheck_m = (1 << tcheck ),
66 mfdscr_m = (1 << mfdscr ),
67 all_features_m = (unsigned long)-1
68 };
69
70 static bool _is_determine_features_test_running;
71
72 static void print_features();
73 static void determine_features(); // also measures cache line size
74 static void config_dscr(); // Power 8: Configure Data Stream Control Register.
75 static void determine_section_size();
76 static void power6_micro_bench();
77 public:
78 // Initialization
79 static void initialize();
80
81 // Override Abstract_VM_Version implementation
82 static bool use_biased_locking();
83
84 static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
85 // CPU instruction support
86 static bool has_fsqrt() { return (_features & fsqrt_m) != 0; }
87 static bool has_fsqrts() { return (_features & fsqrts_m) != 0; }
88 static bool has_isel() { return (_features & isel_m) != 0; }
89 static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; }
90 static bool has_cmpb() { return (_features & cmpb_m) != 0; }
91 static bool has_popcntb() { return (_features & popcntb_m) != 0; }
92 static bool has_popcntw() { return (_features & popcntw_m) != 0; }
93 static bool has_fcfids() { return (_features & fcfids_m) != 0; }
94 static bool has_vand() { return (_features & vand_m) != 0; }
95 static bool has_lqarx() { return (_features & lqarx_m) != 0; }
96 static bool has_vcipher() { return (_features & vcipher_m) != 0; }
97 static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
98 static bool has_tcheck() { return (_features & tcheck_m) != 0; }
99 static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
100
101 // Assembler testing
102 static void allow_all();
103 static void revert();
104 };
105
106 #endif // CPU_PPC_VM_VM_VERSION_PPC_HPP
|