author | stefank |
Wed, 05 Jul 2017 11:33:17 +0200 | |
changeset 46625 | edefffab74e2 |
parent 46619 | a3919f5e8d2b |
child 46628 | d19bf13a5655 |
permissions | -rw-r--r-- |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
1 |
/* |
46317
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
3 |
* Copyright (c) 2012, 2017, 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" |
23211 | 27 |
#include "asm/assembler.inline.hpp" |
28 |
#include "asm/macroAssembler.inline.hpp" |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
29 |
#include "compiler/disassembler.hpp" |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
30 |
#include "memory/resourceArea.hpp" |
46560
388aa8d67c80
8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents:
46521
diff
changeset
|
31 |
#include "prims/jvm.h" |
22824
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 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
40 |
# include <sys/sysinfo.h> |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
41 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
42 |
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
|
43 |
uint64_t VM_Version::_dscr_val = 0; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
44 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
45 |
#define MSG(flag) \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
46 |
if (flag && !FLAG_IS_DEFAULT(flag)) \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
47 |
jio_fprintf(defaultStream::error_stream(), \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
48 |
"warning: -XX:+" #flag " requires -XX:+UseSIGTRAP\n" \ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
49 |
" -XX:+" #flag " will be disabled!\n"); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
50 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
51 |
void VM_Version::initialize() { |
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 |
// 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
|
54 |
determine_features(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
55 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
56 |
// 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
|
57 |
if (FLAG_IS_DEFAULT(PowerArchitecturePPC64)) { |
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
58 |
if (VM_Version::has_lqarx()) { |
30303 | 59 |
FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 8); |
60 |
} else if (VM_Version::has_popcntw()) { |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
61 |
FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 7); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
62 |
} else if (VM_Version::has_cmpb()) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
63 |
FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 6); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
64 |
} else if (VM_Version::has_popcntb()) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
65 |
FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 5); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
66 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
67 |
FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
68 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
69 |
} |
35085 | 70 |
|
71 |
bool PowerArchitecturePPC64_ok = false; |
|
72 |
switch (PowerArchitecturePPC64) { |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
73 |
case 8: if (!VM_Version::has_lqarx() ) break; |
35085 | 74 |
case 7: if (!VM_Version::has_popcntw()) break; |
75 |
case 6: if (!VM_Version::has_cmpb() ) break; |
|
76 |
case 5: if (!VM_Version::has_popcntb()) break; |
|
77 |
case 0: PowerArchitecturePPC64_ok = true; break; |
|
78 |
default: break; |
|
79 |
} |
|
80 |
guarantee(PowerArchitecturePPC64_ok, "PowerArchitecturePPC64 cannot be set to " |
|
81 |
UINTX_FORMAT " on this machine", PowerArchitecturePPC64); |
|
30303 | 82 |
|
83 |
// Power 8: Configure Data Stream Control Register. |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
84 |
if (has_mfdscr()) { |
30303 | 85 |
config_dscr(); |
86 |
} |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
87 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
88 |
if (!UseSIGTRAP) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
89 |
MSG(TrapBasedICMissChecks); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
90 |
MSG(TrapBasedNotEntrantChecks); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
91 |
MSG(TrapBasedNullChecks); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
92 |
FLAG_SET_ERGO(bool, TrapBasedNotEntrantChecks, false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
93 |
FLAG_SET_ERGO(bool, TrapBasedNullChecks, false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
94 |
FLAG_SET_ERGO(bool, TrapBasedICMissChecks, false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
95 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
96 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
97 |
#ifdef COMPILER2 |
22856
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
98 |
if (!UseSIGTRAP) { |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
99 |
MSG(TrapBasedRangeChecks); |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
100 |
FLAG_SET_ERGO(bool, TrapBasedRangeChecks, false); |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
101 |
} |
03ad2cf18166
8029015: PPC64 (part 216): opto: trap based null and range checks
goetz
parents:
22824
diff
changeset
|
102 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
103 |
// On Power6 test for section size. |
22861 | 104 |
if (PowerArchitecturePPC64 == 6) { |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
105 |
determine_section_size(); |
22861 | 106 |
// TODO: PPC port } else { |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
107 |
// TODO: PPC port PdScheduling::power6SectorSize = 0x20; |
22861 | 108 |
} |
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 |
MaxVectorSize = 8; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
111 |
#endif |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
112 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
113 |
// Create and print feature-string. |
22861 | 114 |
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
|
115 |
jio_snprintf(buf, sizeof(buf), |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
116 |
"ppc64%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
|
117 |
(has_fsqrt() ? " fsqrt" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
118 |
(has_isel() ? " isel" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
119 |
(has_lxarxeh() ? " lxarxeh" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
120 |
(has_cmpb() ? " cmpb" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
121 |
//(has_mftgpr()? " mftgpr" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
122 |
(has_popcntb() ? " popcntb" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
123 |
(has_popcntw() ? " popcntw" : ""), |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
124 |
(has_fcfids() ? " fcfids" : ""), |
30303 | 125 |
(has_vand() ? " vand" : ""), |
126 |
(has_lqarx() ? " lqarx" : ""), |
|
37275 | 127 |
(has_vcipher() ? " aes" : ""), |
30303 | 128 |
(has_vpmsumb() ? " vpmsumb" : ""), |
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
129 |
(has_tcheck() ? " tcheck" : ""), |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
130 |
(has_mfdscr() ? " mfdscr" : ""), |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
131 |
(has_vsx() ? " vsx" : ""), |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
132 |
(has_ldbrx() ? " ldbrx" : ""), |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
133 |
(has_stdbrx() ? " stdbrx" : "") |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
134 |
// Make sure number of %s matches num_features! |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
135 |
); |
35148 | 136 |
_features_string = os::strdup(buf); |
30303 | 137 |
if (Verbose) { |
138 |
print_features(); |
|
139 |
} |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
140 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
141 |
// PPC64 supports 8-byte compare-exchange operations (see |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
142 |
// Atomic::cmpxchg and StubGenerator::generate_atomic_cmpxchg_ptr) |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
143 |
// and 'atomic long memory ops' (see Unsafe_GetLongVolatile). |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
144 |
_supports_cx8 = true; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
145 |
|
35085 | 146 |
// Used by C1. |
147 |
_supports_atomic_getset4 = true; |
|
148 |
_supports_atomic_getadd4 = true; |
|
149 |
_supports_atomic_getset8 = true; |
|
150 |
_supports_atomic_getadd8 = true; |
|
151 |
||
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
152 |
UseSSE = 0; // Only on x86 and x64 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
153 |
|
35085 | 154 |
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
|
155 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
156 |
if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) AllocatePrefetchStyle = 1; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
157 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
158 |
if (AllocatePrefetchStyle == 4) { |
22861 | 159 |
AllocatePrefetchStepSize = cache_line_size; // Need exact value. |
160 |
if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 12; // Use larger blocks by default. |
|
161 |
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
|
162 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
163 |
if (cache_line_size > AllocatePrefetchStepSize) AllocatePrefetchStepSize = cache_line_size; |
22861 | 164 |
if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 3; // Optimistic value. |
165 |
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
|
166 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
167 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
168 |
assert(AllocatePrefetchLines > 0, "invalid value"); |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
169 |
if (AllocatePrefetchLines < 1) { // Set valid value in product VM. |
22861 | 170 |
AllocatePrefetchLines = 1; // Conservative value. |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
171 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
172 |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
173 |
if (AllocatePrefetchStyle == 3 && AllocatePrefetchDistance < cache_line_size) { |
22861 | 174 |
AllocatePrefetchStyle = 1; // Fall back if inappropriate. |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
175 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
176 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
177 |
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
|
178 |
|
46317
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
179 |
// If defined(VM_LITTLE_ENDIAN) and running on Power8 or newer hardware, |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
180 |
// the implementation uses the vector instructions available with Power8. |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
181 |
// In all other cases, the implementation uses only generally available instructions. |
31861 | 182 |
if (!UseCRC32Intrinsics) { |
183 |
if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { |
|
184 |
FLAG_SET_DEFAULT(UseCRC32Intrinsics, true); |
|
185 |
} |
|
186 |
} |
|
187 |
||
46317
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
188 |
// 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
|
189 |
// Their exploitation is still pending (aka "work in progress"). |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
190 |
if (!UseCRC32CIntrinsics) { |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
191 |
if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
192 |
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, true); |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
193 |
} |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
194 |
} |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
195 |
|
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
196 |
// TODO: Provide implementation. |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
197 |
if (UseAdler32Intrinsics) { |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
198 |
warning("Adler32Intrinsics not available on this CPU."); |
5f88747fe29e
8175369: [ppc] Provide intrinsic implementation for CRC32C
lucy
parents:
43428
diff
changeset
|
199 |
FLAG_SET_DEFAULT(UseAdler32Intrinsics, false); |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
200 |
} |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
201 |
|
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
202 |
// The AES intrinsic stubs require AES instruction support. |
37275 | 203 |
#if defined(VM_LITTLE_ENDIAN) |
204 |
if (has_vcipher()) { |
|
205 |
if (FLAG_IS_DEFAULT(UseAES)) { |
|
206 |
UseAES = true; |
|
207 |
} |
|
208 |
} else if (UseAES) { |
|
209 |
if (!FLAG_IS_DEFAULT(UseAES)) |
|
210 |
warning("AES instructions are not available on this CPU"); |
|
211 |
FLAG_SET_DEFAULT(UseAES, false); |
|
212 |
} |
|
213 |
||
214 |
if (UseAES && has_vcipher()) { |
|
215 |
if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
|
216 |
UseAESIntrinsics = true; |
|
217 |
} |
|
218 |
} else if (UseAESIntrinsics) { |
|
219 |
if (!FLAG_IS_DEFAULT(UseAESIntrinsics)) |
|
220 |
warning("AES intrinsics are not available on this CPU"); |
|
221 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
|
222 |
} |
|
223 |
||
224 |
#else |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
225 |
if (UseAES) { |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
226 |
warning("AES instructions are not available on this CPU"); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
227 |
FLAG_SET_DEFAULT(UseAES, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
228 |
} |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
229 |
if (UseAESIntrinsics) { |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
230 |
if (!FLAG_IS_DEFAULT(UseAESIntrinsics)) |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
231 |
warning("AES intrinsics are not available on this CPU"); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
232 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
233 |
} |
37275 | 234 |
#endif |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
235 |
|
35154 | 236 |
if (UseAESCTRIntrinsics) { |
237 |
warning("AES/CTR intrinsics are not available on this CPU"); |
|
238 |
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); |
|
239 |
} |
|
240 |
||
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
241 |
if (UseGHASHIntrinsics) { |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
242 |
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
|
243 |
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
244 |
} |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
30587
diff
changeset
|
245 |
|
42884
05815125c157
8171244: PPC64: Make interpreter's math entries consistent with C1 and C2 and support FMA
mdoerr
parents:
42034
diff
changeset
|
246 |
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
|
247 |
FLAG_SET_DEFAULT(UseFMA, true); |
41323 | 248 |
} |
249 |
||
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
250 |
if (UseSHA) { |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
251 |
warning("SHA instructions are not available on this CPU"); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
252 |
FLAG_SET_DEFAULT(UseSHA, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
253 |
} |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
254 |
if (UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics) { |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
255 |
warning("SHA intrinsics are not available on this CPU"); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
256 |
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
257 |
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
258 |
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
259 |
} |
31515 | 260 |
|
31773 | 261 |
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
262 |
UseMultiplyToLenIntrinsic = true; |
|
263 |
} |
|
35156 | 264 |
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { |
265 |
UseMontgomeryMultiplyIntrinsic = true; |
|
266 |
} |
|
267 |
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { |
|
268 |
UseMontgomerySquareIntrinsic = true; |
|
269 |
} |
|
31773 | 270 |
|
35110
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
271 |
if (UseVectorizedMismatchIntrinsic) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
272 |
warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
273 |
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
274 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
35085
diff
changeset
|
275 |
|
35156 | 276 |
|
30303 | 277 |
// Adjust RTM (Restricted Transactional Memory) flags. |
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
278 |
if (UseRTMLocking) { |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
279 |
// If CPU or OS are too old: |
30303 | 280 |
// Can't continue because UseRTMLocking affects UseBiasedLocking flag |
281 |
// setting during arguments processing. See use_biased_locking(). |
|
282 |
// VM_Version_init() is executed after UseBiasedLocking is used |
|
283 |
// in Thread::allocate(). |
|
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
284 |
if (!has_tcheck()) { |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
285 |
vm_exit_during_initialization("RTM instructions are not available on this CPU"); |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
286 |
} |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
287 |
bool os_too_old = true; |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
288 |
#ifdef AIX |
41321 | 289 |
// Actually, this is supported since AIX 7.1.. Unfortunately, this first |
290 |
// contained bugs, so that it can only be enabled after AIX 7.1.3.30. |
|
291 |
// The Java property os.version, which is used in RTM tests to decide |
|
292 |
// whether the feature is available, only knows major and minor versions. |
|
293 |
// We don't want to change this property, as user code might depend on it. |
|
294 |
// So the tests can not check on subversion 3.30, and we only enable RTM |
|
295 |
// with AIX 7.2. |
|
296 |
if (os::Aix::os_version() >= 0x07020000) { // At least AIX 7.2. |
|
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
297 |
os_too_old = false; |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
298 |
} |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
299 |
#endif |
40010 | 300 |
#ifdef LINUX |
36560 | 301 |
// At least Linux kernel 4.2, as the problematic behavior of syscalls |
302 |
// being called in the middle of a transaction has been addressed. |
|
303 |
// Please, refer to commit b4b56f9ecab40f3b4ef53e130c9f6663be491894 |
|
304 |
// in Linux kernel source tree: https://goo.gl/Kc5i7A |
|
305 |
if (os::Linux::os_version_is_known()) { |
|
306 |
if (os::Linux::os_version() >= 0x040200) |
|
307 |
os_too_old = false; |
|
308 |
} else { |
|
309 |
vm_exit_during_initialization("RTM can not be enabled: kernel version is unknown."); |
|
310 |
} |
|
35063
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
311 |
#endif |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
312 |
if (os_too_old) { |
cb24277be2e7
8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code
mdoerr
parents:
32581
diff
changeset
|
313 |
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
|
314 |
} |
30303 | 315 |
} |
316 |
||
317 |
if (UseRTMLocking) { |
|
318 |
#if INCLUDE_RTM_OPT |
|
319 |
if (!UnlockExperimentalVMOptions) { |
|
320 |
vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. " |
|
321 |
"It must be enabled via -XX:+UnlockExperimentalVMOptions flag."); |
|
322 |
} else { |
|
323 |
warning("UseRTMLocking is only available as experimental option on this platform."); |
|
324 |
} |
|
325 |
if (!FLAG_IS_CMDLINE(UseRTMLocking)) { |
|
326 |
// RTM locking should be used only for applications with |
|
327 |
// high lock contention. For now we do not use it by default. |
|
328 |
vm_exit_during_initialization("UseRTMLocking flag should be only set on command line"); |
|
329 |
} |
|
330 |
if (!is_power_of_2(RTMTotalCountIncrRate)) { |
|
331 |
warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64"); |
|
332 |
FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64); |
|
333 |
} |
|
334 |
if (RTMAbortRatio < 0 || RTMAbortRatio > 100) { |
|
335 |
warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50"); |
|
336 |
FLAG_SET_DEFAULT(RTMAbortRatio, 50); |
|
337 |
} |
|
43428
3dccc891c216
8171266: PPC64: Add support to -XX:RTMSpinLoopCount=0
gromero
parents:
42884
diff
changeset
|
338 |
if (RTMSpinLoopCount < 0) { |
3dccc891c216
8171266: PPC64: Add support to -XX:RTMSpinLoopCount=0
gromero
parents:
42884
diff
changeset
|
339 |
warning("RTMSpinLoopCount must not be a negative value, resetting it to 0"); |
3dccc891c216
8171266: PPC64: Add support to -XX:RTMSpinLoopCount=0
gromero
parents:
42884
diff
changeset
|
340 |
FLAG_SET_DEFAULT(RTMSpinLoopCount, 0); |
3dccc891c216
8171266: PPC64: Add support to -XX:RTMSpinLoopCount=0
gromero
parents:
42884
diff
changeset
|
341 |
} |
30303 | 342 |
#else |
343 |
// Only C2 does RTM locking optimization. |
|
344 |
// Can't continue because UseRTMLocking affects UseBiasedLocking flag |
|
345 |
// setting during arguments processing. See use_biased_locking(). |
|
346 |
vm_exit_during_initialization("RTM locking optimization is not supported in this VM"); |
|
347 |
#endif |
|
348 |
} else { // !UseRTMLocking |
|
349 |
if (UseRTMForStackLocks) { |
|
350 |
if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) { |
|
351 |
warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off"); |
|
352 |
} |
|
353 |
FLAG_SET_DEFAULT(UseRTMForStackLocks, false); |
|
354 |
} |
|
355 |
if (UseRTMDeopt) { |
|
356 |
FLAG_SET_DEFAULT(UseRTMDeopt, false); |
|
357 |
} |
|
358 |
if (PrintPreciseRTMLockingStatistics) { |
|
359 |
FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false); |
|
360 |
} |
|
361 |
} |
|
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
25949
diff
changeset
|
362 |
|
35085 | 363 |
// This machine allows unaligned memory accesses |
364 |
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { |
|
365 |
FLAG_SET_DEFAULT(UseUnalignedAccesses, true); |
|
30209
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28187
diff
changeset
|
366 |
} |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
367 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
368 |
|
30303 | 369 |
bool VM_Version::use_biased_locking() { |
370 |
#if INCLUDE_RTM_OPT |
|
371 |
// RTM locking is most useful when there is high lock contention and |
|
372 |
// low data contention. With high lock contention the lock is usually |
|
373 |
// inflated and biased locking is not suitable for that case. |
|
374 |
// RTM locking code requires that biased locking is off. |
|
375 |
// Note: we can't switch off UseBiasedLocking in get_processor_features() |
|
376 |
// because it is used by Thread::allocate() which is called before |
|
377 |
// VM_Version::initialize(). |
|
378 |
if (UseRTMLocking && UseBiasedLocking) { |
|
379 |
if (FLAG_IS_DEFAULT(UseBiasedLocking)) { |
|
380 |
FLAG_SET_DEFAULT(UseBiasedLocking, false); |
|
381 |
} else { |
|
382 |
warning("Biased locking is not supported with RTM locking; ignoring UseBiasedLocking flag." ); |
|
383 |
UseBiasedLocking = false; |
|
384 |
} |
|
385 |
} |
|
386 |
#endif |
|
387 |
return UseBiasedLocking; |
|
388 |
} |
|
389 |
||
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
390 |
void VM_Version::print_features() { |
35148 | 391 |
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
|
392 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
393 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
394 |
#ifdef COMPILER2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
395 |
// 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
|
396 |
// 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
|
397 |
// 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
|
398 |
void VM_Version::determine_section_size() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
399 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
400 |
int unroll = 80; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
401 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
402 |
const int code_size = (2* unroll * 32 + 100)*BytesPerInstWord; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
403 |
|
22861 | 404 |
// Allocate space for the code. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
405 |
ResourceMark rm; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
406 |
CodeBuffer cb("detect_section_size", code_size, 0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
407 |
MacroAssembler* a = new MacroAssembler(&cb); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
408 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
409 |
uint32_t *code = (uint32_t *)a->pc(); |
22861 | 410 |
// Emit code. |
23211 | 411 |
void (*test1)() = (void(*)())(void *)a->function_entry(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
412 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
413 |
Label l1; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
414 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
415 |
a->li(R4, 1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
416 |
a->sldi(R4, R4, 28); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
417 |
a->b(l1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
418 |
a->align(CodeEntryAlignment); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
419 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
420 |
a->bind(l1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
421 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
422 |
for (int i = 0; i < unroll; i++) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
423 |
// Schleife 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
424 |
// ------- sector 0 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
425 |
// ;; 0 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
426 |
a->nop(); // 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
427 |
a->fpnop0(); // 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
428 |
a->fpnop1(); // 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
429 |
a->addi(R4,R4, -1); // 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
430 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
431 |
// ;; 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
432 |
a->nop(); // 5 |
22861 | 433 |
a->fmr(F6, F6); // 6 |
434 |
a->fmr(F7, F7); // 7 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
435 |
a->endgroup(); // 8 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
436 |
// ------- sector 8 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
437 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
438 |
// ;; 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
439 |
a->nop(); // 9 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
440 |
a->nop(); // 10 |
22861 | 441 |
a->fmr(F8, F8); // 11 |
442 |
a->fmr(F9, F9); // 12 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
443 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
444 |
// ;; 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
445 |
a->nop(); // 13 |
22861 | 446 |
a->fmr(F10, F10); // 14 |
447 |
a->fmr(F11, F11); // 15 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
448 |
a->endgroup(); // 16 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
449 |
// -------- sector 16 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
450 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
451 |
// ;; 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
452 |
a->nop(); // 17 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
453 |
a->nop(); // 18 |
22861 | 454 |
a->fmr(F15, F15); // 19 |
455 |
a->fmr(F16, F16); // 20 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
456 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
457 |
// ;; 5 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
458 |
a->nop(); // 21 |
22861 | 459 |
a->fmr(F17, F17); // 22 |
460 |
a->fmr(F18, F18); // 23 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
461 |
a->endgroup(); // 24 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
462 |
// ------- sector 24 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
463 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
464 |
// ;; 6 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
465 |
a->nop(); // 25 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
466 |
a->nop(); // 26 |
22861 | 467 |
a->fmr(F19, F19); // 27 |
468 |
a->fmr(F20, F20); // 28 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
469 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
470 |
// ;; 7 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
471 |
a->nop(); // 29 |
22861 | 472 |
a->fmr(F21, F21); // 30 |
473 |
a->fmr(F22, F22); // 31 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
474 |
a->brnop0(); // 32 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
475 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
476 |
// ------- sector 32 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
477 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
478 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
479 |
// ;; 8 |
22861 | 480 |
a->cmpdi(CCR0, R4, unroll); // 33 |
481 |
a->bge(CCR0, l1); // 34 |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
482 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
483 |
|
22861 | 484 |
// Emit code. |
23211 | 485 |
void (*test2)() = (void(*)())(void *)a->function_entry(); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
486 |
// uint32_t *code = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
487 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
488 |
Label l2; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
489 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
490 |
a->li(R4, 1); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
491 |
a->sldi(R4, R4, 28); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
492 |
a->b(l2); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
493 |
a->align(CodeEntryAlignment); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
494 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
495 |
a->bind(l2); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
496 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
497 |
for (int i = 0; i < unroll; i++) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
498 |
// Schleife 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
499 |
// ------- sector 0 ------------ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
500 |
// ;; 0 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
501 |
a->brnop0(); // 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
502 |
a->nop(); // 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
503 |
//a->cmpdi(CCR0, R4, unroll); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
504 |
a->fpnop0(); // 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
505 |
a->fpnop1(); // 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
506 |
a->addi(R4,R4, -1); // 5 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
507 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
508 |
// ;; 1 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
509 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
510 |
a->nop(); // 6 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
511 |
a->fmr(F6, F6); // 7 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
512 |
a->fmr(F7, F7); // 8 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
513 |
// ------- sector 8 --------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
514 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
515 |
// ;; 2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
516 |
a->endgroup(); // 9 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
517 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
518 |
// ;; 3 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
519 |
a->nop(); // 10 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
520 |
a->nop(); // 11 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
521 |
a->fmr(F8, F8); // 12 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
522 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
523 |
// ;; 4 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
524 |
a->fmr(F9, F9); // 13 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
525 |
a->nop(); // 14 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
526 |
a->fmr(F10, F10); // 15 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
527 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
528 |
// ;; 5 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
529 |
a->fmr(F11, F11); // 16 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
530 |
// -------- sector 16 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
531 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
532 |
// ;; 6 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
533 |
a->endgroup(); // 17 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
534 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
535 |
// ;; 7 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
536 |
a->nop(); // 18 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
537 |
a->nop(); // 19 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
538 |
a->fmr(F15, F15); // 20 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
539 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
540 |
// ;; 8 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
541 |
a->fmr(F16, F16); // 21 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
542 |
a->nop(); // 22 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
543 |
a->fmr(F17, F17); // 23 |
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 |
// ;; 9 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
546 |
a->fmr(F18, F18); // 24 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
547 |
// -------- sector 24 ------------- |
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 |
// ;; 10 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
550 |
a->endgroup(); // 25 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
551 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
552 |
// ;; 11 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
553 |
a->nop(); // 26 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
554 |
a->nop(); // 27 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
555 |
a->fmr(F19, F19); // 28 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
556 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
557 |
// ;; 12 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
558 |
a->fmr(F20, F20); // 29 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
559 |
a->nop(); // 30 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
560 |
a->fmr(F21, F21); // 31 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
561 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
562 |
// ;; 13 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
563 |
a->fmr(F22, F22); // 32 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
564 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
565 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
566 |
// -------- sector 32 ------------- |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
567 |
// ;; 14 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
568 |
a->cmpdi(CCR0, R4, unroll); // 33 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
569 |
a->bge(CCR0, l2); // 34 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
570 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
571 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
572 |
uint32_t *code_end = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
573 |
a->flush(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
574 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
575 |
double loop1_seconds,loop2_seconds, rel_diff; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
576 |
uint64_t start1, stop1; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
577 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
578 |
start1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
579 |
(*test1)(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
580 |
stop1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
581 |
loop1_seconds = (stop1- start1) / (1000 *1000 *1000.0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
582 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
583 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
584 |
start1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
585 |
(*test2)(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
586 |
stop1 = os::current_thread_cpu_time(false); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
587 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
588 |
loop2_seconds = (stop1 - start1) / (1000 *1000 *1000.0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
589 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
590 |
rel_diff = (loop2_seconds - loop1_seconds) / loop1_seconds *100; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
591 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
592 |
if (PrintAssembly) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
593 |
ttyLocker ttyl; |
25374
d7fb2af5d53c
8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents:
24424
diff
changeset
|
594 |
tty->print_cr("Decoding section size 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
|
595 |
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
|
596 |
tty->print_cr("Time loop1 :%f", loop1_seconds); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
597 |
tty->print_cr("Time loop2 :%f", loop2_seconds); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
598 |
tty->print_cr("(time2 - time1) / time1 = %f %%", rel_diff); |
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 |
if (rel_diff > 12.0) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
601 |
tty->print_cr("Section Size 8 Instructions"); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
602 |
} else{ |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
603 |
tty->print_cr("Section Size 32 Instructions or Power5"); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
604 |
} |
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 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
607 |
#if 0 // TODO: PPC port |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
608 |
// Set sector size (if not set explicitly). |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
609 |
if (FLAG_IS_DEFAULT(Power6SectorSize128PPC64)) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
610 |
if (rel_diff > 12.0) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
611 |
PdScheduling::power6SectorSize = 0x20; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
612 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
613 |
PdScheduling::power6SectorSize = 0x80; |
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 |
} else if (Power6SectorSize128PPC64) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
616 |
PdScheduling::power6SectorSize = 0x80; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
617 |
} else { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
618 |
PdScheduling::power6SectorSize = 0x20; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
619 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
620 |
#endif |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
621 |
if (UsePower6SchedulerPPC64) Unimplemented(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
622 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
623 |
#endif // COMPILER2 |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
624 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
625 |
void VM_Version::determine_features() { |
23211 | 626 |
#if defined(ABI_ELFv2) |
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
627 |
// 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
|
628 |
const int code_size = (num_features+1+2*1)*BytesPerInstWord; |
23211 | 629 |
#else |
22861 | 630 |
// 7 InstWords for each call (function descriptor + blr instruction). |
631 |
const int code_size = (num_features+1+2*7)*BytesPerInstWord; |
|
23211 | 632 |
#endif |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
633 |
int features = 0; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
634 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
635 |
// create test area |
22861 | 636 |
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
|
637 |
char test_area[BUFFER_SIZE]; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
638 |
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
|
639 |
|
22861 | 640 |
// Allocate space for the code. |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
641 |
ResourceMark rm; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
642 |
CodeBuffer cb("detect_cpu_features", code_size, 0); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
643 |
MacroAssembler* a = new MacroAssembler(&cb); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
644 |
|
23492 | 645 |
// Must be set to true so we can generate the test code. |
646 |
_features = VM_Version::all_features_m; |
|
647 |
||
22861 | 648 |
// Emit code. |
23211 | 649 |
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
|
650 |
uint32_t *code = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
651 |
// Don't use R0 in ldarx. |
22861 | 652 |
// Keep R3_ARG1 unmodified, it contains &field (see below). |
653 |
// Keep R4_ARG2 unmodified, it contains offset = 0 (see below). |
|
30303 | 654 |
a->fsqrt(F3, F4); // code[0] -> fsqrt_m |
655 |
a->fsqrts(F3, F4); // code[1] -> fsqrts_m |
|
656 |
a->isel(R7, R5, R6, 0); // code[2] -> isel_m |
|
657 |
a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[3] -> lxarx_m |
|
658 |
a->cmpb(R7, R5, R6); // code[4] -> cmpb |
|
659 |
a->popcntb(R7, R5); // code[5] -> popcntb |
|
660 |
a->popcntw(R7, R5); // code[6] -> popcntw |
|
661 |
a->fcfids(F3, F4); // code[7] -> fcfids |
|
662 |
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
|
663 |
// 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
|
664 |
a->lqarx_unchecked(R6, R3_ARG1, R4_ARG2, 1); // code[9] -> lqarx_m |
30303 | 665 |
a->vcipher(VR0, VR1, VR2); // code[10] -> vcipher |
666 |
a->vpmsumb(VR0, VR1, VR2); // code[11] -> vpmsumb |
|
667 |
a->tcheck(0); // code[12] -> tcheck |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
668 |
a->mfdscr(R0); // code[13] -> mfdscr |
42034
f1e6a21095f5
8166684: PPC64: implement intrinsic code with vector instructions for Unsafe.copyMemory()
mdoerr
parents:
41323
diff
changeset
|
669 |
a->lxvd2x(VSR0, R3_ARG1); // code[14] -> vsx |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
670 |
a->ldbrx(R7, R3_ARG1, R4_ARG2); // code[15] -> ldbrx |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
671 |
a->stdbrx(R7, R3_ARG1, R4_ARG2); // code[16] -> stdbrx |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
672 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
673 |
|
22861 | 674 |
// Emit function to set one cache line to zero. Emit function descriptor and get pointer to it. |
23211 | 675 |
void (*zero_cacheline_func_ptr)(char*) = (void(*)(char*))(void *)a->function_entry(); |
22861 | 676 |
a->dcbz(R3_ARG1); // R3_ARG1 = addr |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
677 |
a->blr(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
678 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
679 |
uint32_t *code_end = (uint32_t *)a->pc(); |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
680 |
a->flush(); |
23492 | 681 |
_features = VM_Version::unknown_m; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
682 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
683 |
// Print the detection code. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
684 |
if (PrintAssembly) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
685 |
ttyLocker ttyl; |
25374
d7fb2af5d53c
8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents:
24424
diff
changeset
|
686 |
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
|
687 |
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
|
688 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
689 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
690 |
// Measure cache line size. |
22861 | 691 |
memset(test_area, 0xFF, BUFFER_SIZE); // Fill test area with 0xFF. |
692 |
(*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
|
693 |
int count = 0; // count zeroed bytes |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
694 |
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
|
695 |
guarantee(is_power_of_2(count), "cache line size needs to be a power of 2"); |
35085 | 696 |
_L1_data_cache_line_size = count; |
22824
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 |
// 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
|
699 |
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
|
700 |
// We must align the first argument to 16 bytes because of the lqarx check. |
46619
a3919f5e8d2b
8178499: Remove _ptr_ and _size_ infixes from align functions
stefank
parents:
46618
diff
changeset
|
701 |
(*test)(align_up(mid_of_test_area, 16), (uint64_t)0); |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
702 |
VM_Version::_is_determine_features_test_running = false; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
703 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
704 |
// determine which instructions are legal. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
705 |
int feature_cntr = 0; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
706 |
if (code[feature_cntr++]) features |= fsqrt_m; |
23492 | 707 |
if (code[feature_cntr++]) features |= fsqrts_m; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
708 |
if (code[feature_cntr++]) features |= isel_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
709 |
if (code[feature_cntr++]) features |= lxarxeh_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
710 |
if (code[feature_cntr++]) features |= cmpb_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
711 |
if (code[feature_cntr++]) features |= popcntb_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
712 |
if (code[feature_cntr++]) features |= popcntw_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
713 |
if (code[feature_cntr++]) features |= fcfids_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
714 |
if (code[feature_cntr++]) features |= vand_m; |
30303 | 715 |
if (code[feature_cntr++]) features |= lqarx_m; |
716 |
if (code[feature_cntr++]) features |= vcipher_m; |
|
717 |
if (code[feature_cntr++]) features |= vpmsumb_m; |
|
718 |
if (code[feature_cntr++]) features |= tcheck_m; |
|
36303
6241574f5982
8149655: PPC64: Implement CompactString intrinsics
mdoerr
parents:
35594
diff
changeset
|
719 |
if (code[feature_cntr++]) features |= mfdscr_m; |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
720 |
if (code[feature_cntr++]) features |= vsx_m; |
46521
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
721 |
if (code[feature_cntr++]) features |= ldbrx_m; |
17e8acfe1db8
8179527: Implement intrinsic code for reverseBytes with load/store
mdoerr
parents:
46317
diff
changeset
|
722 |
if (code[feature_cntr++]) features |= stdbrx_m; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
723 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
724 |
// Print the detection code. |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
725 |
if (PrintAssembly) { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
726 |
ttyLocker ttyl; |
25374
d7fb2af5d53c
8048169: Change 8037816 breaks HS build on PPC64 and CPP-Interpreter platforms
coleenp
parents:
24424
diff
changeset
|
727 |
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
|
728 |
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
|
729 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
730 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
731 |
_features = features; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
732 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
733 |
|
30303 | 734 |
// Power 8: Configure Data Stream Control Register. |
735 |
void VM_Version::config_dscr() { |
|
736 |
// 7 InstWords for each call (function descriptor + blr instruction). |
|
737 |
const int code_size = (2+2*7)*BytesPerInstWord; |
|
738 |
||
739 |
// Allocate space for the code. |
|
740 |
ResourceMark rm; |
|
741 |
CodeBuffer cb("config_dscr", code_size, 0); |
|
742 |
MacroAssembler* a = new MacroAssembler(&cb); |
|
743 |
||
744 |
// Emit code. |
|
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
745 |
uint64_t (*get_dscr)() = (uint64_t(*)())(void *)a->function_entry(); |
30303 | 746 |
uint32_t *code = (uint32_t *)a->pc(); |
747 |
a->mfdscr(R3); |
|
748 |
a->blr(); |
|
749 |
||
31333
12ccf8b26eb0
8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"
simonis
parents:
30587
diff
changeset
|
750 |
void (*set_dscr)(long) = (void(*)(long))(void *)a->function_entry(); |
30303 | 751 |
a->mtdscr(R3); |
752 |
a->blr(); |
|
753 |
||
754 |
uint32_t *code_end = (uint32_t *)a->pc(); |
|
755 |
a->flush(); |
|
756 |
||
757 |
// Print the detection code. |
|
758 |
if (PrintAssembly) { |
|
759 |
ttyLocker ttyl; |
|
30587
751a7698b62e
8079280: Fix format warning/error in vm_version_ppc.cpp
simonis
parents:
30303
diff
changeset
|
760 |
tty->print_cr("Decoding dscr configuration stub at " INTPTR_FORMAT " before execution:", p2i(code)); |
30303 | 761 |
Disassembler::decode((u_char*)code, (u_char*)code_end, tty); |
762 |
} |
|
763 |
||
764 |
// Apply the configuration if needed. |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
765 |
_dscr_val = (*get_dscr)(); |
30303 | 766 |
if (Verbose) { |
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
767 |
tty->print_cr("dscr value was 0x%lx" , _dscr_val); |
30303 | 768 |
} |
769 |
bool change_requested = false; |
|
770 |
if (DSCR_PPC64 != (uintx)-1) { |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
771 |
_dscr_val = DSCR_PPC64; |
30303 | 772 |
change_requested = true; |
773 |
} |
|
774 |
if (DSCR_DPFD_PPC64 <= 7) { |
|
775 |
uint64_t mask = 0x7; |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
776 |
if ((_dscr_val & mask) != DSCR_DPFD_PPC64) { |
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
777 |
_dscr_val = (_dscr_val & ~mask) | (DSCR_DPFD_PPC64); |
30303 | 778 |
change_requested = true; |
779 |
} |
|
780 |
} |
|
781 |
if (DSCR_URG_PPC64 <= 7) { |
|
782 |
uint64_t mask = 0x7 << 6; |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
783 |
if ((_dscr_val & mask) != DSCR_DPFD_PPC64 << 6) { |
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
784 |
_dscr_val = (_dscr_val & ~mask) | (DSCR_URG_PPC64 << 6); |
30303 | 785 |
change_requested = true; |
786 |
} |
|
787 |
} |
|
788 |
if (change_requested) { |
|
39236
c9d756fa846e
8154156: PPC64: improve array copy stubs by using vector instructions
mdoerr
parents:
37275
diff
changeset
|
789 |
(*set_dscr)(_dscr_val); |
30303 | 790 |
if (Verbose) { |
791 |
tty->print_cr("dscr was set to 0x%lx" , (*get_dscr)()); |
|
792 |
} |
|
793 |
} |
|
794 |
} |
|
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
795 |
|
35148 | 796 |
static uint64_t saved_features = 0; |
22824
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
797 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
798 |
void VM_Version::allow_all() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
799 |
saved_features = _features; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
800 |
_features = all_features_m; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
801 |
} |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
802 |
|
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
803 |
void VM_Version::revert() { |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
804 |
_features = saved_features; |
28258dd5cb2e
8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff
changeset
|
805 |
} |