author | coleenp |
Wed, 14 Aug 2019 10:07:00 -0400 | |
changeset 57745 | 789e967c2731 |
parent 54983 | 81becad91321 |
child 58904 | 1f7981ef8779 |
permissions | -rw-r--r-- |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
1 |
/* |
54899
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
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 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
26 |
#include "precompiled.hpp" |
47765
b7c7428eaab9
8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents:
47634
diff
changeset
|
27 |
#include "jvm.h" |
23211 | 28 |
#include "asm/assembler.inline.hpp" |
29 |
#include "asm/macroAssembler.inline.hpp" |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
30 |
#include "compiler/disassembler.hpp" |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
31 |
#include "memory/resourceArea.hpp" |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
32 |
#include "runtime/java.hpp" |
25949 | 33 |
#include "runtime/os.hpp" |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
34 |
#include "runtime/stubCodeGenerator.hpp" |
46625 | 35 |
#include "utilities/align.hpp" |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
36 |
#include "utilities/defaultStream.hpp" |
30303 | 37 |
#include "utilities/globalDefinitions.hpp" |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
38 |
#include "vm_version_ppc.hpp" |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
39 |
|
50161
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
40 |
#include <sys/sysinfo.h> |
54572
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
41 |
#if defined(_AIX) |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
42 |
#include <libperfstat.h> |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
43 |
#endif |
50161
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
44 |
|
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
45 |
#if defined(LINUX) && defined(VM_LITTLE_ENDIAN) |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
46 |
#include <sys/auxv.h> |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
47 |
|
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
48 |
#ifndef PPC_FEATURE2_HTM_NOSC |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
49 |
#define PPC_FEATURE2_HTM_NOSC (1 << 24) |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
50 |
#endif |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
51 |
#endif |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
52 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
53 |
bool VM_Version::_is_determine_features_test_running = false; |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
54 |
uint64_t VM_Version::_dscr_val = 0; |
22824
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 |
#define MSG(flag) \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
57 |
if (flag && !FLAG_IS_DEFAULT(flag)) \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
58 |
jio_fprintf(defaultStream::error_stream(), \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
59 |
"warning: -XX:+" #flag " requires -XX:+UseSIGTRAP\n" \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
60 |
" -XX:+" #flag " will be disabled!\n"); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
61 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
62 |
void VM_Version::initialize() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
63 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
64 |
// Test which instructions are supported and measure cache line size. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
65 |
determine_features(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
66 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
67 |
// If PowerArchitecturePPC64 hasn't been specified explicitly determine from features. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
68 |
if (FLAG_IS_DEFAULT(PowerArchitecturePPC64)) { |
52355 | 69 |
if (VM_Version::has_darn()) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
70 |
FLAG_SET_ERGO(PowerArchitecturePPC64, 9); |
52355 | 71 |
} else if (VM_Version::has_lqarx()) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
72 |
FLAG_SET_ERGO(PowerArchitecturePPC64, 8); |
30303 | 73 |
} else if (VM_Version::has_popcntw()) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
74 |
FLAG_SET_ERGO(PowerArchitecturePPC64, 7); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
75 |
} else if (VM_Version::has_cmpb()) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
76 |
FLAG_SET_ERGO(PowerArchitecturePPC64, 6); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
77 |
} else if (VM_Version::has_popcntb()) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
78 |
FLAG_SET_ERGO(PowerArchitecturePPC64, 5); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
79 |
} else { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
80 |
FLAG_SET_ERGO(PowerArchitecturePPC64, 0); |
22824
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 |
} |
35085 | 83 |
|
84 |
bool PowerArchitecturePPC64_ok = false; |
|
85 |
switch (PowerArchitecturePPC64) { |
|
52355 | 86 |
case 9: if (!VM_Version::has_darn() ) break; |
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
87 |
case 8: if (!VM_Version::has_lqarx() ) break; |
35085 | 88 |
case 7: if (!VM_Version::has_popcntw()) break; |
89 |
case 6: if (!VM_Version::has_cmpb() ) break; |
|
90 |
case 5: if (!VM_Version::has_popcntb()) break; |
|
91 |
case 0: PowerArchitecturePPC64_ok = true; break; |
|
92 |
default: break; |
|
93 |
} |
|
94 |
guarantee(PowerArchitecturePPC64_ok, "PowerArchitecturePPC64 cannot be set to " |
|
95 |
UINTX_FORMAT " on this machine", PowerArchitecturePPC64); |
|
30303 | 96 |
|
97 |
// Power 8: Configure Data Stream Control Register. |
|
46628 | 98 |
if (PowerArchitecturePPC64 >= 8 && has_mfdscr()) { |
30303 | 99 |
config_dscr(); |
100 |
} |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
101 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
102 |
if (!UseSIGTRAP) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
103 |
MSG(TrapBasedICMissChecks); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
104 |
MSG(TrapBasedNotEntrantChecks); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
105 |
MSG(TrapBasedNullChecks); |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
106 |
FLAG_SET_ERGO(TrapBasedNotEntrantChecks, false); |
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
107 |
FLAG_SET_ERGO(TrapBasedNullChecks, false); |
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
108 |
FLAG_SET_ERGO(TrapBasedICMissChecks, false); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
109 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
110 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
111 |
#ifdef COMPILER2 |
22856
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
112 |
if (!UseSIGTRAP) { |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
113 |
MSG(TrapBasedRangeChecks); |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
114 |
FLAG_SET_ERGO(TrapBasedRangeChecks, false); |
22856
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
115 |
} |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
116 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
117 |
// On Power6 test for section size. |
22861 | 118 |
if (PowerArchitecturePPC64 == 6) { |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
119 |
determine_section_size(); |
22861 | 120 |
// TODO: PPC port } else { |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
121 |
// TODO: PPC port PdScheduling::power6SectorSize = 0x20; |
22861 | 122 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
123 |
|
47594
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
124 |
if (PowerArchitecturePPC64 >= 8) { |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
125 |
if (FLAG_IS_DEFAULT(SuperwordUseVSX)) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
126 |
FLAG_SET_ERGO(SuperwordUseVSX, true); |
47594
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
127 |
} |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
128 |
} else { |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
129 |
if (SuperwordUseVSX) { |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
130 |
warning("SuperwordUseVSX specified, but needs at least Power8."); |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
131 |
FLAG_SET_DEFAULT(SuperwordUseVSX, false); |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
132 |
} |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
133 |
} |
fd0db78ac8d4
8188802: PPC64: Failure on assert(lrgmask.is_aligned_sets(RegMask::SlotsPerVecX))
mhorie
parents:
47583
diff
changeset
|
134 |
MaxVectorSize = SuperwordUseVSX ? 16 : 8; |
52667
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
135 |
|
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
136 |
if (PowerArchitecturePPC64 >= 9) { |
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
137 |
if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstructionsPPC64)) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
138 |
FLAG_SET_ERGO(UseCountTrailingZerosInstructionsPPC64, true); |
52667
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
139 |
} |
52979
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52667
diff
changeset
|
140 |
if (FLAG_IS_DEFAULT(UseCharacterCompareIntrinsics)) { |
54983
81becad91321
8224203: Remove need to specify type when using FLAG_SET macros
stefank
parents:
54960
diff
changeset
|
141 |
FLAG_SET_ERGO(UseCharacterCompareIntrinsics, true); |
52979
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52667
diff
changeset
|
142 |
} |
52667
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
143 |
} else { |
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
144 |
if (UseCountTrailingZerosInstructionsPPC64) { |
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
145 |
warning("UseCountTrailingZerosInstructionsPPC64 specified, but needs at least Power9."); |
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
146 |
FLAG_SET_DEFAULT(UseCountTrailingZerosInstructionsPPC64, false); |
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
147 |
} |
52979
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52667
diff
changeset
|
148 |
if (UseCharacterCompareIntrinsics) { |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52667
diff
changeset
|
149 |
warning("UseCharacterCompareIntrinsics specified, but needs at least Power9."); |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52667
diff
changeset
|
150 |
FLAG_SET_DEFAULT(UseCharacterCompareIntrinsics, false); |
7384e00d5860
8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
mhorie
parents:
52667
diff
changeset
|
151 |
} |
52667
a959583eea01
8214205: PPC64: Add instructions for counting trailing zeros
mhorie
parents:
52355
diff
changeset
|
152 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
153 |
#endif |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
154 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
155 |
// Create and print feature-string. |
22861 | 156 |
char buf[(num_features+1) * 16]; // Max 16 chars per feature. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
157 |
jio_snprintf(buf, sizeof(buf), |
52355 | 158 |
"ppc64%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
159 |
(has_fsqrt() ? " fsqrt" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
160 |
(has_isel() ? " isel" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
161 |
(has_lxarxeh() ? " lxarxeh" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
162 |
(has_cmpb() ? " cmpb" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
163 |
(has_popcntb() ? " popcntb" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
164 |
(has_popcntw() ? " popcntw" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
165 |
(has_fcfids() ? " fcfids" : ""), |
30303 | 166 |
(has_vand() ? " vand" : ""), |
167 |
(has_lqarx() ? " lqarx" : ""), |
|
37275 | 168 |
(has_vcipher() ? " aes" : ""), |
30303 | 169 |
(has_vpmsumb() ? " vpmsumb" : ""), |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
170 |
(has_mfdscr() ? " mfdscr" : ""), |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
171 |
(has_vsx() ? " vsx" : ""), |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
172 |
(has_ldbrx() ? " ldbrx" : ""), |
47565 | 173 |
(has_stdbrx() ? " 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
|
174 |
(has_vshasig() ? " sha" : ""), |
52355 | 175 |
(has_tm() ? " rtm" : ""), |
176 |
(has_darn() ? " darn" : "") |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
177 |
// Make sure number of %s matches num_features! |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
178 |
); |
35148 | 179 |
_features_string = os::strdup(buf); |
30303 | 180 |
if (Verbose) { |
181 |
print_features(); |
|
182 |
} |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
183 |
|
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47608
diff
changeset
|
184 |
// PPC64 supports 8-byte compare-exchange operations (see Atomic::cmpxchg) |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
185 |
// and 'atomic long memory ops' (see Unsafe_GetLongVolatile). |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
186 |
_supports_cx8 = true; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
187 |
|
35085 | 188 |
// Used by C1. |
189 |
_supports_atomic_getset4 = true; |
|
190 |
_supports_atomic_getadd4 = true; |
|
191 |
_supports_atomic_getset8 = true; |
|
192 |
_supports_atomic_getadd8 = true; |
|
193 |
||
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
194 |
UseSSE = 0; // Only on x86 and x64 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
195 |
|
35085 | 196 |
intx cache_line_size = L1_data_cache_line_size(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
197 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
198 |
if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) AllocatePrefetchStyle = 1; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
199 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
200 |
if (AllocatePrefetchStyle == 4) { |
22861 | 201 |
AllocatePrefetchStepSize = cache_line_size; // Need exact value. |
202 |
if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 12; // Use larger blocks by default. |
|
203 |
if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 2*cache_line_size; // Default is not defined? |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
204 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
205 |
if (cache_line_size > AllocatePrefetchStepSize) AllocatePrefetchStepSize = cache_line_size; |
22861 | 206 |
if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 3; // Optimistic value. |
207 |
if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 3*cache_line_size; // Default is not defined? |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
208 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
209 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
210 |
assert(AllocatePrefetchLines > 0, "invalid value"); |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
211 |
if (AllocatePrefetchLines < 1) { // Set valid value in product VM. |
22861 | 212 |
AllocatePrefetchLines = 1; // Conservative value. |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
213 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
214 |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
215 |
if (AllocatePrefetchStyle == 3 && AllocatePrefetchDistance < cache_line_size) { |
22861 | 216 |
AllocatePrefetchStyle = 1; // Fall back if inappropriate. |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
217 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
218 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
219 |
assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive"); |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
220 |
|
49376
7cd503c499a0
8198894: [PPC64] More generic vector CRC implementation
mdoerr
parents:
48810
diff
changeset
|
221 |
// If running on Power8 or newer hardware, the implementation uses the available vector instructions. |
46317
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
222 |
// In all other cases, the implementation uses only generally available instructions. |
31861 | 223 |
if (!UseCRC32Intrinsics) { |
224 |
if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { |
|
225 |
FLAG_SET_DEFAULT(UseCRC32Intrinsics, true); |
|
226 |
} |
|
227 |
} |
|
228 |
||
46317
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
229 |
// Implementation does not use any of the vector instructions available with Power8. |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
230 |
// Their exploitation is still pending (aka "work in progress"). |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
231 |
if (!UseCRC32CIntrinsics) { |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
232 |
if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
233 |
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, true); |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
234 |
} |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
235 |
} |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
236 |
|
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
237 |
// TODO: Provide implementation. |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
238 |
if (UseAdler32Intrinsics) { |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
239 |
warning("Adler32Intrinsics not available on this CPU."); |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
240 |
FLAG_SET_DEFAULT(UseAdler32Intrinsics, false); |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
241 |
} |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
242 |
|
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
243 |
// The AES intrinsic stubs require AES instruction support. |
37275 | 244 |
if (has_vcipher()) { |
245 |
if (FLAG_IS_DEFAULT(UseAES)) { |
|
246 |
UseAES = true; |
|
247 |
} |
|
248 |
} else if (UseAES) { |
|
249 |
if (!FLAG_IS_DEFAULT(UseAES)) |
|
250 |
warning("AES instructions are not available on this CPU"); |
|
251 |
FLAG_SET_DEFAULT(UseAES, false); |
|
252 |
} |
|
253 |
||
254 |
if (UseAES && has_vcipher()) { |
|
255 |
if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
|
256 |
UseAESIntrinsics = true; |
|
257 |
} |
|
258 |
} else if (UseAESIntrinsics) { |
|
259 |
if (!FLAG_IS_DEFAULT(UseAESIntrinsics)) |
|
260 |
warning("AES intrinsics are not available on this CPU"); |
|
261 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
|
262 |
} |
|
263 |
||
35154 | 264 |
if (UseAESCTRIntrinsics) { |
265 |
warning("AES/CTR intrinsics are not available on this CPU"); |
|
266 |
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); |
|
267 |
} |
|
268 |
||
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
269 |
if (UseGHASHIntrinsics) { |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
270 |
warning("GHASH intrinsics are not available on this CPU"); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
271 |
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
272 |
} |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
273 |
|
42884
05815125c157
8171244: PPC64: Make interpreter's math entries consistent with C1 and C2 and support FMA
mdoerr
parents:
42034
diff
changeset
|
274 |
if (FLAG_IS_DEFAULT(UseFMA)) { |
05815125c157
8171244: PPC64: Make interpreter's math entries consistent with C1 and C2 and support FMA
mdoerr
parents:
42034
diff
changeset
|
275 |
FLAG_SET_DEFAULT(UseFMA, true); |
41323 | 276 |
} |
277 |
||
47565 | 278 |
if (has_vshasig()) { |
279 |
if (FLAG_IS_DEFAULT(UseSHA)) { |
|
280 |
UseSHA = true; |
|
281 |
} |
|
282 |
} else if (UseSHA) { |
|
283 |
if (!FLAG_IS_DEFAULT(UseSHA)) |
|
284 |
warning("SHA instructions are not available on this CPU"); |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
285 |
FLAG_SET_DEFAULT(UseSHA, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
286 |
} |
47565 | 287 |
|
288 |
if (UseSHA1Intrinsics) { |
|
289 |
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU."); |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
290 |
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false); |
47565 | 291 |
} |
292 |
||
293 |
if (UseSHA && has_vshasig()) { |
|
294 |
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) { |
|
295 |
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true); |
|
296 |
} |
|
297 |
} else if (UseSHA256Intrinsics) { |
|
298 |
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU."); |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
299 |
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false); |
47565 | 300 |
} |
301 |
||
302 |
if (UseSHA && has_vshasig()) { |
|
303 |
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) { |
|
304 |
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true); |
|
305 |
} |
|
306 |
} else if (UseSHA512Intrinsics) { |
|
307 |
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU."); |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
308 |
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
309 |
} |
31515 | 310 |
|
47565 | 311 |
if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics)) { |
312 |
FLAG_SET_DEFAULT(UseSHA, false); |
|
313 |
} |
|
314 |
||
47521
122833427b36
8185976: PPC64: Implement MulAdd and SquareToLen intrinsics
goetz
parents:
47216
diff
changeset
|
315 |
if (FLAG_IS_DEFAULT(UseSquareToLenIntrinsic)) { |
122833427b36
8185976: PPC64: Implement MulAdd and SquareToLen intrinsics
goetz
parents:
47216
diff
changeset
|
316 |
UseSquareToLenIntrinsic = true; |
122833427b36
8185976: PPC64: Implement MulAdd and SquareToLen intrinsics
goetz
parents:
47216
diff
changeset
|
317 |
} |
122833427b36
8185976: PPC64: Implement MulAdd and SquareToLen intrinsics
goetz
parents:
47216
diff
changeset
|
318 |
if (FLAG_IS_DEFAULT(UseMulAddIntrinsic)) { |
122833427b36
8185976: PPC64: Implement MulAdd and SquareToLen intrinsics
goetz
parents:
47216
diff
changeset
|
319 |
UseMulAddIntrinsic = true; |
122833427b36
8185976: PPC64: Implement MulAdd and SquareToLen intrinsics
goetz
parents:
47216
diff
changeset
|
320 |
} |
31773 | 321 |
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
322 |
UseMultiplyToLenIntrinsic = true; |
|
323 |
} |
|
35156 | 324 |
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { |
325 |
UseMontgomeryMultiplyIntrinsic = true; |
|
326 |
} |
|
327 |
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { |
|
328 |
UseMontgomerySquareIntrinsic = true; |
|
329 |
} |
|
31773 | 330 |
|
35110
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
331 |
if (UseVectorizedMismatchIntrinsic) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
332 |
warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
333 |
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
334 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
335 |
|
35156 | 336 |
|
30303 | 337 |
// Adjust RTM (Restricted Transactional Memory) flags. |
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
338 |
if (UseRTMLocking) { |
50161
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
339 |
// If CPU or OS do not support TM: |
30303 | 340 |
// Can't continue because UseRTMLocking affects UseBiasedLocking flag |
341 |
// setting during arguments processing. See use_biased_locking(). |
|
342 |
// VM_Version_init() is executed after UseBiasedLocking is used |
|
343 |
// in Thread::allocate(). |
|
50161
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
344 |
if (PowerArchitecturePPC64 < 8) { |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
345 |
vm_exit_during_initialization("RTM instructions are not available on this CPU."); |
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
346 |
} |
50161
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
347 |
|
50339
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
348 |
if (!has_tm()) { |
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
349 |
vm_exit_during_initialization("RTM is not supported on this OS version."); |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
350 |
} |
30303 | 351 |
} |
352 |
||
353 |
if (UseRTMLocking) { |
|
354 |
#if INCLUDE_RTM_OPT |
|
355 |
if (!FLAG_IS_CMDLINE(UseRTMLocking)) { |
|
356 |
// RTM locking should be used only for applications with |
|
357 |
// high lock contention. For now we do not use it by default. |
|
358 |
vm_exit_during_initialization("UseRTMLocking flag should be only set on command line"); |
|
359 |
} |
|
360 |
#else |
|
361 |
// Only C2 does RTM locking optimization. |
|
362 |
// Can't continue because UseRTMLocking affects UseBiasedLocking flag |
|
363 |
// setting during arguments processing. See use_biased_locking(). |
|
364 |
vm_exit_during_initialization("RTM locking optimization is not supported in this VM"); |
|
365 |
#endif |
|
366 |
} else { // !UseRTMLocking |
|
367 |
if (UseRTMForStackLocks) { |
|
368 |
if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) { |
|
369 |
warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off"); |
|
370 |
} |
|
371 |
FLAG_SET_DEFAULT(UseRTMForStackLocks, false); |
|
372 |
} |
|
373 |
if (UseRTMDeopt) { |
|
374 |
FLAG_SET_DEFAULT(UseRTMDeopt, false); |
|
375 |
} |
|
376 |
if (PrintPreciseRTMLockingStatistics) { |
|
377 |
FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false); |
|
378 |
} |
|
379 |
} |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
380 |
|
35085 | 381 |
// This machine allows unaligned memory accesses |
382 |
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { |
|
383 |
FLAG_SET_DEFAULT(UseUnalignedAccesses, true); |
|
30209
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28187
diff
changeset
|
384 |
} |
54899
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
385 |
|
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
386 |
check_virtualizations(); |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
387 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
388 |
|
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
389 |
void VM_Version::check_virtualizations() { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
390 |
#if defined(_AIX) |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
391 |
int rc = 0; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
392 |
perfstat_partition_total_t pinfo; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
393 |
rc = perfstat_partition_total(NULL, &pinfo, sizeof(perfstat_partition_total_t), 1); |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
394 |
if (rc == 1) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
395 |
Abstract_VM_Version::_detected_virtualization = PowerVM; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
396 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
397 |
#else |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
398 |
const char* info_file = "/proc/ppc64/lparcfg"; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
399 |
// system_type=...qemu indicates PowerKVM |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
400 |
// e.g. system_type=IBM pSeries (emulated by qemu) |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
401 |
char line[500]; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
402 |
FILE* fp = fopen(info_file, "r"); |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
403 |
if (fp == NULL) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
404 |
return; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
405 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
406 |
const char* system_type="system_type="; // in case this line contains qemu, it is KVM |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
407 |
const char* num_lpars="NumLpars="; // in case of non-KVM : if this line is found it is PowerVM |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
408 |
bool num_lpars_found = false; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
409 |
|
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
410 |
while (fgets(line, sizeof(line), fp) != NULL) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
411 |
if (strncmp(line, system_type, strlen(system_type)) == 0) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
412 |
if (strstr(line, "qemu") != 0) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
413 |
Abstract_VM_Version::_detected_virtualization = PowerKVM; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
414 |
fclose(fp); |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
415 |
return; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
416 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
417 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
418 |
if (strncmp(line, num_lpars, strlen(num_lpars)) == 0) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
419 |
num_lpars_found = true; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
420 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
421 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
422 |
if (num_lpars_found) { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
423 |
Abstract_VM_Version::_detected_virtualization = PowerVM; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
424 |
} else { |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
425 |
Abstract_VM_Version::_detected_virtualization = PowerFullPartitionMode; |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
426 |
} |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
427 |
fclose(fp); |
e4cff3cf0234
8223438: add VirtualizationInformation JFR event
mbaesken
parents:
54572
diff
changeset
|
428 |
#endif |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
429 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
430 |
|
54485
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
431 |
void VM_Version::print_platform_virtualization_info(outputStream* st) { |
54572
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
432 |
#if defined(_AIX) |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
433 |
// more info about perfstat API see |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
434 |
// https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.prftools/idprftools_perfstat_glob_partition.htm |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
435 |
int rc = 0; |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
436 |
perfstat_partition_total_t pinfo; |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
437 |
memset(&pinfo, 0, sizeof(perfstat_partition_total_t)); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
438 |
rc = perfstat_partition_total(NULL, &pinfo, sizeof(perfstat_partition_total_t), 1); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
439 |
if (rc != 1) { |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
440 |
return; |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
441 |
} else { |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
442 |
st->print_cr("Virtualization type : PowerVM"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
443 |
} |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
444 |
// CPU information |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
445 |
perfstat_cpu_total_t cpuinfo; |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
446 |
memset(&cpuinfo, 0, sizeof(perfstat_cpu_total_t)); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
447 |
rc = perfstat_cpu_total(NULL, &cpuinfo, sizeof(perfstat_cpu_total_t), 1); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
448 |
if (rc != 1) { |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
449 |
return; |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
450 |
} |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
451 |
|
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
452 |
st->print_cr("Processor description : %s", cpuinfo.description); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
453 |
st->print_cr("Processor speed : %llu Hz", cpuinfo.processorHZ); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
454 |
|
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
455 |
st->print_cr("LPAR partition name : %s", pinfo.name); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
456 |
st->print_cr("LPAR partition number : %u", pinfo.lpar_id); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
457 |
st->print_cr("LPAR partition type : %s", pinfo.type.b.shared_enabled ? "shared" : "dedicated"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
458 |
st->print_cr("LPAR mode : %s", pinfo.type.b.donate_enabled ? "donating" : pinfo.type.b.capped ? "capped" : "uncapped"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
459 |
st->print_cr("LPAR partition group ID : %u", pinfo.group_id); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
460 |
st->print_cr("LPAR shared pool ID : %u", pinfo.pool_id); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
461 |
|
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
462 |
st->print_cr("AMS (active memory sharing) : %s", pinfo.type.b.ams_capable ? "capable" : "not capable"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
463 |
st->print_cr("AMS (active memory sharing) : %s", pinfo.type.b.ams_enabled ? "on" : "off"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
464 |
st->print_cr("AME (active memory expansion) : %s", pinfo.type.b.ame_enabled ? "on" : "off"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
465 |
|
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
466 |
if (pinfo.type.b.ame_enabled) { |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
467 |
st->print_cr("AME true memory in bytes : %llu", pinfo.true_memory); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
468 |
st->print_cr("AME expanded memory in bytes : %llu", pinfo.expanded_memory); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
469 |
} |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
470 |
|
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
471 |
st->print_cr("SMT : %s", pinfo.type.b.smt_capable ? "capable" : "not capable"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
472 |
st->print_cr("SMT : %s", pinfo.type.b.smt_enabled ? "on" : "off"); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
473 |
int ocpus = pinfo.online_cpus > 0 ? pinfo.online_cpus : 1; |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
474 |
st->print_cr("LPAR threads : %d", cpuinfo.ncpus/ocpus); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
475 |
st->print_cr("LPAR online virtual cpus : %d", pinfo.online_cpus); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
476 |
st->print_cr("LPAR logical cpus : %d", cpuinfo.ncpus); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
477 |
st->print_cr("LPAR maximum virtual cpus : %u", pinfo.max_cpus); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
478 |
st->print_cr("LPAR minimum virtual cpus : %u", pinfo.min_cpus); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
479 |
st->print_cr("LPAR entitled capacity : %4.2f", (double) (pinfo.entitled_proc_capacity/100.0)); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
480 |
st->print_cr("LPAR online memory : %llu MB", pinfo.online_memory); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
481 |
st->print_cr("LPAR maximum memory : %llu MB", pinfo.max_memory); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
482 |
st->print_cr("LPAR minimum memory : %llu MB", pinfo.min_memory); |
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
483 |
#else |
54485
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
484 |
const char* info_file = "/proc/ppc64/lparcfg"; |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
485 |
const char* kw[] = { "system_type=", // qemu indicates PowerKVM |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
486 |
"partition_entitled_capacity=", // entitled processor capacity percentage |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
487 |
"partition_max_entitled_capacity=", |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
488 |
"capacity_weight=", // partition CPU weight |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
489 |
"partition_active_processors=", |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
490 |
"partition_potential_processors=", |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
491 |
"entitled_proc_capacity_available=", |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
492 |
"capped=", // 0 - uncapped, 1 - vcpus capped at entitled processor capacity percentage |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
493 |
"shared_processor_mode=", // (non)dedicated partition |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
494 |
"system_potential_processors=", |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
495 |
"pool=", // CPU-pool number |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
496 |
"pool_capacity=", |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
497 |
"NumLpars=", // on non-KVM machines, NumLpars is not found for full partition mode machines |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
498 |
NULL }; |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
499 |
if (!print_matching_lines_from_file(info_file, st, kw)) { |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
500 |
st->print_cr(" <%s Not Available>", info_file); |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
501 |
} |
54572
75a42622414e
8222280: Provide virtualization related info in the hs_error file on AIX
mbaesken
parents:
54485
diff
changeset
|
502 |
#endif |
54485
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
503 |
} |
ddc19ea5059c
8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
mbaesken
parents:
52979
diff
changeset
|
504 |
|
30303 | 505 |
bool VM_Version::use_biased_locking() { |
506 |
#if INCLUDE_RTM_OPT |
|
507 |
// RTM locking is most useful when there is high lock contention and |
|
508 |
// low data contention. With high lock contention the lock is usually |
|
509 |
// inflated and biased locking is not suitable for that case. |
|
510 |
// RTM locking code requires that biased locking is off. |
|
511 |
// Note: we can't switch off UseBiasedLocking in get_processor_features() |
|
512 |
// because it is used by Thread::allocate() which is called before |
|
513 |
// VM_Version::initialize(). |
|
514 |
if (UseRTMLocking && UseBiasedLocking) { |
|
515 |
if (FLAG_IS_DEFAULT(UseBiasedLocking)) { |
|
516 |
FLAG_SET_DEFAULT(UseBiasedLocking, false); |
|
517 |
} else { |
|
518 |
warning("Biased locking is not supported with RTM locking; ignoring UseBiasedLocking flag." ); |
|
519 |
UseBiasedLocking = false; |
|
520 |
} |
|
521 |
} |
|
522 |
#endif |
|
523 |
return UseBiasedLocking; |
|
524 |
} |
|
525 |
||
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
526 |
void VM_Version::print_features() { |
35148 | 527 |
tty->print_cr("Version: %s L1_data_cache_line_size=%d", features_string(), L1_data_cache_line_size()); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
528 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
529 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
530 |
#ifdef COMPILER2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
531 |
// Determine section size on power6: If section size is 8 instructions, |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
532 |
// there should be a difference between the two testloops of ~15 %. If |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
533 |
// no difference is detected the section is assumed to be 32 instructions. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
534 |
void VM_Version::determine_section_size() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
535 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
536 |
int unroll = 80; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
537 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
538 |
const int code_size = (2* unroll * 32 + 100)*BytesPerInstWord; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
539 |
|
22861 | 540 |
// Allocate space for the code. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
541 |
ResourceMark rm; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
542 |
CodeBuffer cb("detect_section_size", code_size, 0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
543 |
MacroAssembler* a = new MacroAssembler(&cb); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
544 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
545 |
uint32_t *code = (uint32_t *)a->pc(); |
22861 | 546 |
// Emit code. |
23211 | 547 |
void (*test1)() = (void(*)())(void *)a->function_entry(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
548 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
549 |
Label l1; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
550 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
551 |
a->li(R4, 1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
552 |
a->sldi(R4, R4, 28); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
553 |
a->b(l1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
554 |
a->align(CodeEntryAlignment); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
555 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
556 |
a->bind(l1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
557 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
558 |
for (int i = 0; i < unroll; i++) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
559 |
// Schleife 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
560 |
// ------- sector 0 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
561 |
// ;; 0 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
562 |
a->nop(); // 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
563 |
a->fpnop0(); // 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
564 |
a->fpnop1(); // 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
565 |
a->addi(R4,R4, -1); // 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
566 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
567 |
// ;; 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
568 |
a->nop(); // 5 |
22861 | 569 |
a->fmr(F6, F6); // 6 |
570 |
a->fmr(F7, F7); // 7 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
571 |
a->endgroup(); // 8 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
572 |
// ------- sector 8 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
573 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
574 |
// ;; 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
575 |
a->nop(); // 9 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
576 |
a->nop(); // 10 |
22861 | 577 |
a->fmr(F8, F8); // 11 |
578 |
a->fmr(F9, F9); // 12 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
579 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
580 |
// ;; 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
581 |
a->nop(); // 13 |
22861 | 582 |
a->fmr(F10, F10); // 14 |
583 |
a->fmr(F11, F11); // 15 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
584 |
a->endgroup(); // 16 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
585 |
// -------- sector 16 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
586 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
587 |
// ;; 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
588 |
a->nop(); // 17 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
589 |
a->nop(); // 18 |
22861 | 590 |
a->fmr(F15, F15); // 19 |
591 |
a->fmr(F16, F16); // 20 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
592 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
593 |
// ;; 5 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
594 |
a->nop(); // 21 |
22861 | 595 |
a->fmr(F17, F17); // 22 |
596 |
a->fmr(F18, F18); // 23 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
597 |
a->endgroup(); // 24 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
598 |
// ------- sector 24 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
599 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
600 |
// ;; 6 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
601 |
a->nop(); // 25 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
602 |
a->nop(); // 26 |
22861 | 603 |
a->fmr(F19, F19); // 27 |
604 |
a->fmr(F20, F20); // 28 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
605 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
606 |
// ;; 7 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
607 |
a->nop(); // 29 |
22861 | 608 |
a->fmr(F21, F21); // 30 |
609 |
a->fmr(F22, F22); // 31 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
610 |
a->brnop0(); // 32 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
611 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
612 |
// ------- sector 32 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
613 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
614 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
615 |
// ;; 8 |
22861 | 616 |
a->cmpdi(CCR0, R4, unroll); // 33 |
617 |
a->bge(CCR0, l1); // 34 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
618 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
619 |
|
22861 | 620 |
// Emit code. |
23211 | 621 |
void (*test2)() = (void(*)())(void *)a->function_entry(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
622 |
// uint32_t *code = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
623 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
624 |
Label l2; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
625 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
626 |
a->li(R4, 1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
627 |
a->sldi(R4, R4, 28); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
628 |
a->b(l2); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
629 |
a->align(CodeEntryAlignment); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
630 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
631 |
a->bind(l2); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
632 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
633 |
for (int i = 0; i < unroll; i++) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
634 |
// Schleife 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
635 |
// ------- sector 0 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
636 |
// ;; 0 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
637 |
a->brnop0(); // 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
638 |
a->nop(); // 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
639 |
//a->cmpdi(CCR0, R4, unroll); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
640 |
a->fpnop0(); // 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
641 |
a->fpnop1(); // 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
642 |
a->addi(R4,R4, -1); // 5 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
643 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
644 |
// ;; 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
645 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
646 |
a->nop(); // 6 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
647 |
a->fmr(F6, F6); // 7 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
648 |
a->fmr(F7, F7); // 8 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
649 |
// ------- sector 8 --------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
650 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
651 |
// ;; 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
652 |
a->endgroup(); // 9 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
653 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
654 |
// ;; 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
655 |
a->nop(); // 10 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
656 |
a->nop(); // 11 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
657 |
a->fmr(F8, F8); // 12 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
658 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
659 |
// ;; 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
660 |
a->fmr(F9, F9); // 13 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
661 |
a->nop(); // 14 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
662 |
a->fmr(F10, F10); // 15 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
663 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
664 |
// ;; 5 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
665 |
a->fmr(F11, F11); // 16 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
666 |
// -------- sector 16 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
667 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
668 |
// ;; 6 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
669 |
a->endgroup(); // 17 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
670 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
671 |
// ;; 7 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
672 |
a->nop(); // 18 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
673 |
a->nop(); // 19 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
674 |
a->fmr(F15, F15); // 20 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
675 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
676 |
// ;; 8 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
677 |
a->fmr(F16, F16); // 21 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
678 |
a->nop(); // 22 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
679 |
a->fmr(F17, F17); // 23 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
680 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
681 |
// ;; 9 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
682 |
a->fmr(F18, F18); // 24 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
683 |
// -------- sector 24 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
684 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
685 |
// ;; 10 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
686 |
a->endgroup(); // 25 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
687 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
688 |
// ;; 11 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
689 |
a->nop(); // 26 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
690 |
a->nop(); // 27 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
691 |
a->fmr(F19, F19); // 28 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
692 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
693 |
// ;; 12 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
694 |
a->fmr(F20, F20); // 29 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
695 |
a->nop(); // 30 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
696 |
a->fmr(F21, F21); // 31 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
697 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
698 |
// ;; 13 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
699 |
a->fmr(F22, F22); // 32 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
700 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
701 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
702 |
// -------- sector 32 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
703 |
// ;; 14 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
704 |
a->cmpdi(CCR0, R4, unroll); // 33 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
705 |
a->bge(CCR0, l2); // 34 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
706 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
707 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
708 |
uint32_t *code_end = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
709 |
a->flush(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
710 |
|
54960
e46fe26d7f77
8213084: Rework and enhance Print[Opto]Assembly output
lucy
parents:
54899
diff
changeset
|
711 |
cb.insts()->set_end((u_char*)code_end); |
e46fe26d7f77
8213084: Rework and enhance Print[Opto]Assembly output
lucy
parents:
54899
diff
changeset
|
712 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
713 |
double loop1_seconds,loop2_seconds, rel_diff; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
714 |
uint64_t start1, stop1; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
715 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
716 |
start1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
717 |
(*test1)(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
718 |
stop1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
719 |
loop1_seconds = (stop1- start1) / (1000 *1000 *1000.0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
720 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
721 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
722 |
start1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
723 |
(*test2)(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
724 |
stop1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
725 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
726 |
loop2_seconds = (stop1 - start1) / (1000 *1000 *1000.0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
727 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
728 |
rel_diff = (loop2_seconds - loop1_seconds) / loop1_seconds *100; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
729 |
|
54960
e46fe26d7f77
8213084: Rework and enhance Print[Opto]Assembly output
lucy
parents:
54899
diff
changeset
|
730 |
if (PrintAssembly || PrintStubCode) { |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
731 |
ttyLocker ttyl; |
25374
d7fb2af5d53c
8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents:
24424
diff
changeset
|
732 |
tty->print_cr("Decoding section size detection stub at " INTPTR_FORMAT " before execution:", p2i(code)); |
54960
e46fe26d7f77
8213084: Rework and enhance Print[Opto]Assembly output
lucy
parents:
54899
diff
changeset
|
733 |
// Use existing decode function. This enables the [MachCode] format which is needed to DecodeErrorFile. |
e46fe26d7f77
8213084: Rework and enhance Print[Opto]Assembly output
lucy
parents:
54899
diff
changeset
|
734 |
Disassembler::decode(&cb, (u_char*)code, (u_char*)code_end, tty); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
735 |
tty->print_cr("Time loop1 :%f", loop1_seconds); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
736 |
tty->print_cr("Time loop2 :%f", loop2_seconds); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
737 |
tty->print_cr("(time2 - time1) / time1 = %f %%", rel_diff); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
738 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
739 |
if (rel_diff > 12.0) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
740 |
tty->print_cr("Section Size 8 Instructions"); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
741 |
} else{ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
742 |
tty->print_cr("Section Size 32 Instructions or Power5"); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
743 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
744 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
745 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
746 |
#if 0 // TODO: PPC port |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
747 |
// Set sector size (if not set explicitly). |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
748 |
if (FLAG_IS_DEFAULT(Power6SectorSize128PPC64)) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
749 |
if (rel_diff > 12.0) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
750 |
PdScheduling::power6SectorSize = 0x20; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
751 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
752 |
PdScheduling::power6SectorSize = 0x80; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
753 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
754 |
} else if (Power6SectorSize128PPC64) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
755 |
PdScheduling::power6SectorSize = 0x80; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
756 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
757 |
PdScheduling::power6SectorSize = 0x20; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
758 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
759 |
#endif |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
760 |
if (UsePower6SchedulerPPC64) Unimplemented(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
761 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
762 |
#endif // COMPILER2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
763 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
764 |
void VM_Version::determine_features() { |
23211 | 765 |
#if defined(ABI_ELFv2) |
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
766 |
// 1 InstWord per call for the blr instruction. |
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
767 |
const int code_size = (num_features+1+2*1)*BytesPerInstWord; |
23211 | 768 |
#else |
22861 | 769 |
// 7 InstWords for each call (function descriptor + blr instruction). |
770 |
const int code_size = (num_features+1+2*7)*BytesPerInstWord; |
|
23211 | 771 |
#endif |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
772 |
int features = 0; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
773 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
774 |
// create test area |
22861 | 775 |
enum { BUFFER_SIZE = 2*4*K }; // Needs to be >=2* max cache line size (cache line size can't exceed min page size). |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
776 |
char test_area[BUFFER_SIZE]; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
777 |
char *mid_of_test_area = &test_area[BUFFER_SIZE>>1]; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
778 |
|
22861 | 779 |
// Allocate space for the code. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
780 |
ResourceMark rm; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
781 |
CodeBuffer cb("detect_cpu_features", code_size, 0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
782 |
MacroAssembler* a = new MacroAssembler(&cb); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
783 |
|
23492 | 784 |
// Must be set to true so we can generate the test code. |
785 |
_features = VM_Version::all_features_m; |
|
786 |
||
22861 | 787 |
// Emit code. |
23211 | 788 |
void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->function_entry(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
789 |
uint32_t *code = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
790 |
// Don't use R0 in ldarx. |
22861 | 791 |
// Keep R3_ARG1 unmodified, it contains &field (see below). |
792 |
// Keep R4_ARG2 unmodified, it contains offset = 0 (see below). |
|
30303 | 793 |
a->fsqrt(F3, F4); // code[0] -> fsqrt_m |
794 |
a->fsqrts(F3, F4); // code[1] -> fsqrts_m |
|
795 |
a->isel(R7, R5, R6, 0); // code[2] -> isel_m |
|
796 |
a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[3] -> lxarx_m |
|
797 |
a->cmpb(R7, R5, R6); // code[4] -> cmpb |
|
798 |
a->popcntb(R7, R5); // code[5] -> popcntb |
|
799 |
a->popcntw(R7, R5); // code[6] -> popcntw |
|
800 |
a->fcfids(F3, F4); // code[7] -> fcfids |
|
801 |
a->vand(VR0, VR0, VR0); // code[8] -> vand |
|
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
802 |
// arg0 of lqarx must be an even register, (arg1 + arg2) must be a multiple of 16 |
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
803 |
a->lqarx_unchecked(R6, R3_ARG1, R4_ARG2, 1); // code[9] -> lqarx_m |
30303 | 804 |
a->vcipher(VR0, VR1, VR2); // code[10] -> vcipher |
805 |
a->vpmsumb(VR0, VR1, VR2); // code[11] -> vpmsumb |
|
50161
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
806 |
a->mfdscr(R0); // code[12] -> mfdscr |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
807 |
a->lxvd2x(VSR0, R3_ARG1); // code[13] -> vsx |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
808 |
a->ldbrx(R7, R3_ARG1, R4_ARG2); // code[14] -> ldbrx |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
809 |
a->stdbrx(R7, R3_ARG1, R4_ARG2); // code[15] -> stdbrx |
e2d9b38630c3
8203305: PPC64: Improve TM detection for enabling RTM on Linux / POWER9
gromero
parents:
49376
diff
changeset
|
810 |
a->vshasigmaw(VR0, VR1, 1, 0xF); // code[16] -> vshasig |
52355 | 811 |
// rtm is determined by OS |
812 |
a->darn(R7); // code[17] -> darn |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
813 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
814 |
|
22861 | 815 |
// Emit function to set one cache line to zero. Emit function descriptor and get pointer to it. |
23211 | 816 |
void (*zero_cacheline_func_ptr)(char*) = (void(*)(char*))(void *)a->function_entry(); |
22861 | 817 |
a->dcbz(R3_ARG1); // R3_ARG1 = addr |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
818 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
819 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
820 |
uint32_t *code_end = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
821 |
a->flush(); |
23492 | 822 |
_features = VM_Version::unknown_m; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
823 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
824 |
// Print the detection code. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
825 |
if (PrintAssembly) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
826 |
ttyLocker ttyl; |
25374
d7fb2af5d53c
8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents:
24424
diff
changeset
|
827 |
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " before execution:", p2i(code)); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
828 |
Disassembler::decode((u_char*)code, (u_char*)code_end, tty); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
829 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
830 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
831 |
// Measure cache line size. |
22861 | 832 |
memset(test_area, 0xFF, BUFFER_SIZE); // Fill test area with 0xFF. |
833 |
(*zero_cacheline_func_ptr)(mid_of_test_area); // Call function which executes dcbz to the middle. |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
834 |
int count = 0; // count zeroed bytes |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
835 |
for (int i = 0; i < BUFFER_SIZE; i++) if (test_area[i] == 0) count++; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
836 |
guarantee(is_power_of_2(count), "cache line size needs to be a power of 2"); |
35085 | 837 |
_L1_data_cache_line_size = count; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
838 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
839 |
// Execute code. Illegal instructions will be replaced by 0 in the signal handler. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
840 |
VM_Version::_is_determine_features_test_running = true; |
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
841 |
// We must align the first argument to 16 bytes because of the lqarx check. |
46628 | 842 |
(*test)(align_up((address)mid_of_test_area, 16), 0); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
843 |
VM_Version::_is_determine_features_test_running = false; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
844 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
845 |
// determine which instructions are legal. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
846 |
int feature_cntr = 0; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
847 |
if (code[feature_cntr++]) features |= fsqrt_m; |
23492 | 848 |
if (code[feature_cntr++]) features |= fsqrts_m; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
849 |
if (code[feature_cntr++]) features |= isel_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
850 |
if (code[feature_cntr++]) features |= lxarxeh_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
851 |
if (code[feature_cntr++]) features |= cmpb_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
852 |
if (code[feature_cntr++]) features |= popcntb_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
853 |
if (code[feature_cntr++]) features |= popcntw_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
854 |
if (code[feature_cntr++]) features |= fcfids_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
855 |
if (code[feature_cntr++]) features |= vand_m; |
30303 | 856 |
if (code[feature_cntr++]) features |= lqarx_m; |
857 |
if (code[feature_cntr++]) features |= vcipher_m; |
|
858 |
if (code[feature_cntr++]) features |= vpmsumb_m; |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
859 |
if (code[feature_cntr++]) features |= mfdscr_m; |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
860 |
if (code[feature_cntr++]) features |= vsx_m; |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
861 |
if (code[feature_cntr++]) features |= ldbrx_m; |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
862 |
if (code[feature_cntr++]) features |= stdbrx_m; |
47565 | 863 |
if (code[feature_cntr++]) features |= vshasig_m; |
52355 | 864 |
// feature rtm_m is determined by OS |
865 |
if (code[feature_cntr++]) features |= darn_m; |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
866 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
867 |
// Print the detection code. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
868 |
if (PrintAssembly) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
869 |
ttyLocker ttyl; |
25374
d7fb2af5d53c
8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents:
24424
diff
changeset
|
870 |
tty->print_cr("Decoding cpu-feature detection stub at " INTPTR_FORMAT " after execution:", p2i(code)); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
871 |
Disassembler::decode((u_char*)code, (u_char*)code_end, tty); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
872 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
873 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
874 |
_features = features; |
50339
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
875 |
|
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
876 |
#ifdef AIX |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
877 |
// To enable it on AIX it's necessary POWER8 or above and at least AIX 7.2. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
878 |
// Actually, this is supported since AIX 7.1.. Unfortunately, this first |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
879 |
// contained bugs, so that it can only be enabled after AIX 7.1.3.30. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
880 |
// The Java property os.version, which is used in RTM tests to decide |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
881 |
// whether the feature is available, only knows major and minor versions. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
882 |
// We don't want to change this property, as user code might depend on it. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
883 |
// So the tests can not check on subversion 3.30, and we only enable RTM |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
884 |
// with AIX 7.2. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
885 |
if (has_lqarx()) { // POWER8 or above |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
886 |
if (os::Aix::os_version() >= 0x07020000) { // At least AIX 7.2. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
887 |
_features |= rtm_m; |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
888 |
} |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
889 |
} |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
890 |
#endif |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
891 |
#if defined(LINUX) && defined(VM_LITTLE_ENDIAN) |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
892 |
unsigned long auxv = getauxval(AT_HWCAP2); |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
893 |
|
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
894 |
if (auxv & PPC_FEATURE2_HTM_NOSC) { |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
895 |
if (auxv & PPC_FEATURE2_HAS_HTM) { |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
896 |
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
897 |
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
898 |
// POWER9 DD2.1 NV has a few issues that need a couple of firmware |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
899 |
// and kernel workarounds, so there is a new mode only supported |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
900 |
// on non-virtualized P9 machines called HTM with no Suspend Mode). |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
901 |
// TM on POWER9 D2.2+ NV is not supported at all by Linux. |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
902 |
_features |= rtm_m; |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
903 |
} |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
904 |
} |
ede65c4fb6da
8203669: PPC64: Fix jtreg RTM tests after "8203305: Improve TM detection for enabling RTM on Linux / POWER9"
gromero
parents:
50161
diff
changeset
|
905 |
#endif |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
906 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
907 |
|
30303 | 908 |
// Power 8: Configure Data Stream Control Register. |
909 |
void VM_Version::config_dscr() { |
|
910 |
// 7 InstWords for each call (function descriptor + blr instruction). |
|
911 |
const int code_size = (2+2*7)*BytesPerInstWord; |
|
912 |
||
913 |
// Allocate space for the code. |
|
914 |
ResourceMark rm; |
|
915 |
CodeBuffer cb("config_dscr", code_size, 0); |
|
916 |
MacroAssembler* a = new MacroAssembler(&cb); |
|
917 |
||
918 |
// Emit code. |
|
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
919 |
uint64_t (*get_dscr)() = (uint64_t(*)())(void *)a->function_entry(); |
30303 | 920 |
uint32_t *code = (uint32_t *)a->pc(); |
921 |
a->mfdscr(R3); |
|
922 |
a->blr(); |
|
923 |
||
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
924 |
void (*set_dscr)(long) = (void(*)(long))(void *)a->function_entry(); |
30303 | 925 |
a->mtdscr(R3); |
926 |
a->blr(); |
|
927 |
||
928 |
uint32_t *code_end = (uint32_t *)a->pc(); |
|
929 |
a->flush(); |
|
930 |
||
931 |
// Print the detection code. |
|
932 |
if (PrintAssembly) { |
|
933 |
ttyLocker ttyl; |
|
30587
751a7698b62e
8079280: Fix format warning/error in vm_version_ppc.cpp
simonis
parents:
30303
diff
changeset
|
934 |
tty->print_cr("Decoding dscr configuration stub at " INTPTR_FORMAT " before execution:", p2i(code)); |
30303 | 935 |
Disassembler::decode((u_char*)code, (u_char*)code_end, tty); |
936 |
} |
|
937 |
||
938 |
// Apply the configuration if needed. |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
939 |
_dscr_val = (*get_dscr)(); |
30303 | 940 |
if (Verbose) { |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
941 |
tty->print_cr("dscr value was 0x%lx" , _dscr_val); |
30303 | 942 |
} |
943 |
bool change_requested = false; |
|
944 |
if (DSCR_PPC64 != (uintx)-1) { |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
945 |
_dscr_val = DSCR_PPC64; |
30303 | 946 |
change_requested = true; |
947 |
} |
|
948 |
if (DSCR_DPFD_PPC64 <= 7) { |
|
949 |
uint64_t mask = 0x7; |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
950 |
if ((_dscr_val & mask) != DSCR_DPFD_PPC64) { |
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
951 |
_dscr_val = (_dscr_val & ~mask) | (DSCR_DPFD_PPC64); |
30303 | 952 |
change_requested = true; |
953 |
} |
|
954 |
} |
|
955 |
if (DSCR_URG_PPC64 <= 7) { |
|
956 |
uint64_t mask = 0x7 << 6; |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
957 |
if ((_dscr_val & mask) != DSCR_DPFD_PPC64 << 6) { |
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
958 |
_dscr_val = (_dscr_val & ~mask) | (DSCR_URG_PPC64 << 6); |
30303 | 959 |
change_requested = true; |
960 |
} |
|
961 |
} |
|
962 |
if (change_requested) { |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
963 |
(*set_dscr)(_dscr_val); |
30303 | 964 |
if (Verbose) { |
965 |
tty->print_cr("dscr was set to 0x%lx" , (*get_dscr)()); |
|
966 |
} |
|
967 |
} |
|
968 |
} |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
969 |
|
35148 | 970 |
static uint64_t saved_features = 0; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
971 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
972 |
void VM_Version::allow_all() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
973 |
saved_features = _features; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
974 |
_features = all_features_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
975 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
976 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
977 |
void VM_Version::revert() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
978 |
_features = saved_features; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
979 |
} |