author | ihse |
Tue, 22 Oct 2019 09:51:52 +0200 | |
branch | ihse-cflags-rewrite-branch |
changeset 58736 | e878a0b7cff0 |
parent 55322 | bc5baf205475 |
child 59122 | 5d73255c2d52 |
permissions | -rw-r--r-- |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52355
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
54899
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54485
diff
changeset
|
3 |
* Copyright (c) 2012, 2019 SAP SE. All rights reserved. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
5 |
* |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
6 |
* This code is free software; you can redistribute it and/or modify it |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
9 |
* |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
14 |
* accompanied this code). |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
15 |
* |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License version |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
19 |
* |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
22 |
* questions. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
23 |
* |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
24 |
*/ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
25 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52355
diff
changeset
|
26 |
#ifndef CPU_PPC_VM_VERSION_PPC_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52355
diff
changeset
|
27 |
#define CPU_PPC_VM_VERSION_PPC_HPP |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
28 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
29 |
#include "runtime/globals_extension.hpp" |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
30 |
#include "runtime/vm_version.hpp" |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
31 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
32 |
class VM_Version: public Abstract_VM_Version { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
33 |
protected: |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
34 |
enum Feature_Flag { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
35 |
fsqrt, |
23492 | 36 |
fsqrts, |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
37 |
isel, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
38 |
lxarxeh, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
39 |
cmpb, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
40 |
popcntb, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
41 |
popcntw, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
42 |
fcfids, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
43 |
vand, |
30303 | 44 |
lqarx, |
45 |
vcipher, |
|
46 |
vpmsumb, |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
47 |
mfdscr, |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
36303
diff
changeset
|
48 |
vsx, |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
39236
diff
changeset
|
49 |
ldbrx, |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
39236
diff
changeset
|
50 |
stdbrx, |
47565 | 51 |
vshasig, |
50339
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
52 |
rtm, |
52355 | 53 |
darn, |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
54 |
num_features // last entry to count features |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
55 |
}; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
56 |
enum Feature_Flag_Set { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
57 |
unknown_m = 0, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
58 |
fsqrt_m = (1 << fsqrt ), |
23492 | 59 |
fsqrts_m = (1 << fsqrts ), |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
60 |
isel_m = (1 << isel ), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
61 |
lxarxeh_m = (1 << lxarxeh), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
62 |
cmpb_m = (1 << cmpb ), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
63 |
popcntb_m = (1 << popcntb), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
64 |
popcntw_m = (1 << popcntw), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
65 |
fcfids_m = (1 << fcfids ), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
66 |
vand_m = (1 << vand ), |
30303 | 67 |
lqarx_m = (1 << lqarx ), |
68 |
vcipher_m = (1 << vcipher), |
|
69 |
vpmsumb_m = (1 << vpmsumb), |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
70 |
mfdscr_m = (1 << mfdscr ), |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
36303
diff
changeset
|
71 |
vsx_m = (1 << vsx ), |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
39236
diff
changeset
|
72 |
ldbrx_m = (1 << ldbrx ), |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
39236
diff
changeset
|
73 |
stdbrx_m = (1 << stdbrx ), |
50339
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
74 |
vshasig_m = (1 << vshasig), |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
75 |
rtm_m = (1 << rtm ), |
52355 | 76 |
darn_m = (1 << darn ), |
35151
9b858be6cd3c
8146231: ppc64/gcc 4.1.2: fix build after "8143072: [JVMCI] Port JVMCI to AArch64"
mdoerr
parents:
35148
diff
changeset
|
77 |
all_features_m = (unsigned long)-1 |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
78 |
}; |
35148 | 79 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
80 |
static bool _is_determine_features_test_running; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
81 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
82 |
static void print_features(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
83 |
static void determine_features(); // also measures cache line size |
30303 | 84 |
static void config_dscr(); // Power 8: Configure Data Stream Control Register. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
85 |
static void determine_section_size(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
86 |
static void power6_micro_bench(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
87 |
public: |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
88 |
// Initialization |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
89 |
static void initialize(); |
54899
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54485
diff
changeset
|
90 |
static void check_virtualizations(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
91 |
|
30303 | 92 |
// Override Abstract_VM_Version implementation |
54485
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
53244
diff
changeset
|
93 |
static void print_platform_virtualization_info(outputStream*); |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
53244
diff
changeset
|
94 |
|
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
53244
diff
changeset
|
95 |
// Override Abstract_VM_Version implementation |
30303 | 96 |
static bool use_biased_locking(); |
97 |
||
55322
bc5baf205475
8224826: Implement fast class initialization checks on PPC64
mdoerr
parents:
54899
diff
changeset
|
98 |
// PPC64 supports fast class initialization checks for static methods. |
bc5baf205475
8224826: Implement fast class initialization checks on PPC64
mdoerr
parents:
54899
diff
changeset
|
99 |
static bool supports_fast_class_init_checks() { return true; } |
bc5baf205475
8224826: Implement fast class initialization checks on PPC64
mdoerr
parents:
54899
diff
changeset
|
100 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
101 |
static bool is_determine_features_test_running() { return _is_determine_features_test_running; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
102 |
// CPU instruction support |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
103 |
static bool has_fsqrt() { return (_features & fsqrt_m) != 0; } |
23492 | 104 |
static bool has_fsqrts() { return (_features & fsqrts_m) != 0; } |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
105 |
static bool has_isel() { return (_features & isel_m) != 0; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
106 |
static bool has_lxarxeh() { return (_features & lxarxeh_m) !=0; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
107 |
static bool has_cmpb() { return (_features & cmpb_m) != 0; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
108 |
static bool has_popcntb() { return (_features & popcntb_m) != 0; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
109 |
static bool has_popcntw() { return (_features & popcntw_m) != 0; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
110 |
static bool has_fcfids() { return (_features & fcfids_m) != 0; } |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
111 |
static bool has_vand() { return (_features & vand_m) != 0; } |
30303 | 112 |
static bool has_lqarx() { return (_features & lqarx_m) != 0; } |
113 |
static bool has_vcipher() { return (_features & vcipher_m) != 0; } |
|
114 |
static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; } |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
115 |
static bool has_mfdscr() { return (_features & mfdscr_m) != 0; } |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
36303
diff
changeset
|
116 |
static bool has_vsx() { return (_features & vsx_m) != 0; } |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
39236
diff
changeset
|
117 |
static bool has_ldbrx() { return (_features & ldbrx_m) != 0; } |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
39236
diff
changeset
|
118 |
static bool has_stdbrx() { return (_features & stdbrx_m) != 0; } |
47565 | 119 |
static bool has_vshasig() { return (_features & vshasig_m) != 0; } |
52355 | 120 |
static bool has_tm() { return (_features & rtm_m) != 0; } |
121 |
static bool has_darn() { return (_features & darn_m) != 0; } |
|
122 |
||
46615 | 123 |
static bool has_mtfprd() { return has_vpmsumb(); } // alias for P8 |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
124 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
125 |
// Assembler testing |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
126 |
static void allow_all(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
127 |
static void revert(); |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
36303
diff
changeset
|
128 |
|
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
36303
diff
changeset
|
129 |
// POWER 8: DSCR current value. |
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
36303
diff
changeset
|
130 |
static uint64_t _dscr_val; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
131 |
}; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
132 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52355
diff
changeset
|
133 |
#endif // CPU_PPC_VM_VERSION_PPC_HPP |