author | twisti |
Fri, 18 Dec 2015 12:39:02 -0800 | |
changeset 35135 | dd2ce9021031 |
parent 35111 | d72f2f2e084e |
child 35148 | 5cfafc99d791 |
permissions | -rw-r--r-- |
2111 | 1 |
/* |
28954
7dda6c26cc98
8068977: Remove unused sun.misc.Unsafe prefetch intrinsic support
psandoz
parents:
27414
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
2111 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4430
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4430
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4430
diff
changeset
|
21 |
* questions. |
2111 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14394
diff
changeset
|
26 |
#include "asm/macroAssembler.hpp" |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14394
diff
changeset
|
27 |
#include "asm/macroAssembler.inline.hpp" |
7397 | 28 |
#include "memory/resourceArea.hpp" |
29 |
#include "runtime/java.hpp" |
|
25949 | 30 |
#include "runtime/os.hpp" |
7397 | 31 |
#include "runtime/stubCodeGenerator.hpp" |
32 |
#include "vm_version_x86.hpp" |
|
2111 | 33 |
|
34 |
||
35 |
int VM_Version::_cpu; |
|
36 |
int VM_Version::_model; |
|
37 |
int VM_Version::_stepping; |
|
30624 | 38 |
uint64_t VM_Version::_cpuFeatures; |
2111 | 39 |
const char* VM_Version::_features_str = ""; |
40 |
VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; |
|
41 |
||
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
42 |
// Address of instruction which causes SEGV |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
43 |
address VM_Version::_cpuinfo_segv_addr = 0; |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
44 |
// Address of instruction after the one which causes SEGV |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
45 |
address VM_Version::_cpuinfo_cont_addr = 0; |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
46 |
|
2111 | 47 |
static BufferBlob* stub_blob; |
30624 | 48 |
static const int stub_size = 1000; |
2111 | 49 |
|
50 |
extern "C" { |
|
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
51 |
typedef void (*get_cpu_info_stub_t)(void*); |
2111 | 52 |
} |
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
53 |
static get_cpu_info_stub_t get_cpu_info_stub = NULL; |
2111 | 54 |
|
55 |
||
56 |
class VM_Version_StubGenerator: public StubCodeGenerator { |
|
57 |
public: |
|
58 |
||
59 |
VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {} |
|
60 |
||
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
61 |
address generate_get_cpu_info() { |
2111 | 62 |
// Flags to test CPU type. |
30624 | 63 |
const uint32_t HS_EFL_AC = 0x40000; |
64 |
const uint32_t HS_EFL_ID = 0x200000; |
|
2111 | 65 |
// Values for when we don't have a CPUID instruction. |
66 |
const int CPU_FAMILY_SHIFT = 8; |
|
30624 | 67 |
const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); |
68 |
const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT); |
|
2111 | 69 |
|
5902 | 70 |
Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4; |
30624 | 71 |
Label sef_cpuid, ext_cpuid, ext_cpuid1, ext_cpuid5, ext_cpuid7, done, wrapup; |
72 |
Label legacy_setup, save_restore_except, legacy_save_restore, start_simd_check; |
|
2111 | 73 |
|
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
74 |
StubCodeMark mark(this, "VM_Version", "get_cpu_info_stub"); |
2111 | 75 |
# define __ _masm-> |
76 |
||
77 |
address start = __ pc(); |
|
78 |
||
79 |
// |
|
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
80 |
// void get_cpu_info(VM_Version::CpuidInfo* cpuid_info); |
2111 | 81 |
// |
82 |
// LP64: rcx and rdx are first and second argument registers on windows |
|
83 |
||
84 |
__ push(rbp); |
|
85 |
#ifdef _LP64 |
|
86 |
__ mov(rbp, c_rarg0); // cpuid_info address |
|
87 |
#else |
|
88 |
__ movptr(rbp, Address(rsp, 8)); // cpuid_info address |
|
89 |
#endif |
|
90 |
__ push(rbx); |
|
91 |
__ push(rsi); |
|
92 |
__ pushf(); // preserve rbx, and flags |
|
93 |
__ pop(rax); |
|
94 |
__ push(rax); |
|
95 |
__ mov(rcx, rax); |
|
96 |
// |
|
97 |
// if we are unable to change the AC flag, we have a 386 |
|
98 |
// |
|
11881
9642744ae9a5
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
sla
parents:
11439
diff
changeset
|
99 |
__ xorl(rax, HS_EFL_AC); |
2111 | 100 |
__ push(rax); |
101 |
__ popf(); |
|
102 |
__ pushf(); |
|
103 |
__ pop(rax); |
|
104 |
__ cmpptr(rax, rcx); |
|
105 |
__ jccb(Assembler::notEqual, detect_486); |
|
106 |
||
107 |
__ movl(rax, CPU_FAMILY_386); |
|
108 |
__ movl(Address(rbp, in_bytes(VM_Version::std_cpuid1_offset())), rax); |
|
109 |
__ jmp(done); |
|
110 |
||
111 |
// |
|
112 |
// If we are unable to change the ID flag, we have a 486 which does |
|
113 |
// not support the "cpuid" instruction. |
|
114 |
// |
|
115 |
__ bind(detect_486); |
|
116 |
__ mov(rax, rcx); |
|
11881
9642744ae9a5
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
sla
parents:
11439
diff
changeset
|
117 |
__ xorl(rax, HS_EFL_ID); |
2111 | 118 |
__ push(rax); |
119 |
__ popf(); |
|
120 |
__ pushf(); |
|
121 |
__ pop(rax); |
|
122 |
__ cmpptr(rcx, rax); |
|
123 |
__ jccb(Assembler::notEqual, detect_586); |
|
124 |
||
125 |
__ bind(cpu486); |
|
126 |
__ movl(rax, CPU_FAMILY_486); |
|
127 |
__ movl(Address(rbp, in_bytes(VM_Version::std_cpuid1_offset())), rax); |
|
128 |
__ jmp(done); |
|
129 |
||
130 |
// |
|
131 |
// At this point, we have a chip which supports the "cpuid" instruction |
|
132 |
// |
|
133 |
__ bind(detect_586); |
|
134 |
__ xorl(rax, rax); |
|
135 |
__ cpuid(); |
|
136 |
__ orl(rax, rax); |
|
137 |
__ jcc(Assembler::equal, cpu486); // if cpuid doesn't support an input |
|
138 |
// value of at least 1, we give up and |
|
139 |
// assume a 486 |
|
140 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); |
|
141 |
__ movl(Address(rsi, 0), rax); |
|
142 |
__ movl(Address(rsi, 4), rbx); |
|
143 |
__ movl(Address(rsi, 8), rcx); |
|
144 |
__ movl(Address(rsi,12), rdx); |
|
145 |
||
5902 | 146 |
__ cmpl(rax, 0xa); // Is cpuid(0xB) supported? |
147 |
__ jccb(Assembler::belowEqual, std_cpuid4); |
|
148 |
||
149 |
// |
|
150 |
// cpuid(0xB) Processor Topology |
|
151 |
// |
|
152 |
__ movl(rax, 0xb); |
|
153 |
__ xorl(rcx, rcx); // Threads level |
|
154 |
__ cpuid(); |
|
155 |
||
156 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB0_offset()))); |
|
157 |
__ movl(Address(rsi, 0), rax); |
|
158 |
__ movl(Address(rsi, 4), rbx); |
|
159 |
__ movl(Address(rsi, 8), rcx); |
|
160 |
__ movl(Address(rsi,12), rdx); |
|
161 |
||
162 |
__ movl(rax, 0xb); |
|
163 |
__ movl(rcx, 1); // Cores level |
|
164 |
__ cpuid(); |
|
165 |
__ push(rax); |
|
166 |
__ andl(rax, 0x1f); // Determine if valid topology level |
|
167 |
__ orl(rax, rbx); // eax[4:0] | ebx[0:15] == 0 indicates invalid level |
|
168 |
__ andl(rax, 0xffff); |
|
169 |
__ pop(rax); |
|
170 |
__ jccb(Assembler::equal, std_cpuid4); |
|
171 |
||
172 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB1_offset()))); |
|
173 |
__ movl(Address(rsi, 0), rax); |
|
174 |
__ movl(Address(rsi, 4), rbx); |
|
175 |
__ movl(Address(rsi, 8), rcx); |
|
176 |
__ movl(Address(rsi,12), rdx); |
|
177 |
||
178 |
__ movl(rax, 0xb); |
|
179 |
__ movl(rcx, 2); // Packages level |
|
180 |
__ cpuid(); |
|
181 |
__ push(rax); |
|
182 |
__ andl(rax, 0x1f); // Determine if valid topology level |
|
183 |
__ orl(rax, rbx); // eax[4:0] | ebx[0:15] == 0 indicates invalid level |
|
184 |
__ andl(rax, 0xffff); |
|
185 |
__ pop(rax); |
|
186 |
__ jccb(Assembler::equal, std_cpuid4); |
|
187 |
||
188 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB2_offset()))); |
|
189 |
__ movl(Address(rsi, 0), rax); |
|
190 |
__ movl(Address(rsi, 4), rbx); |
|
191 |
__ movl(Address(rsi, 8), rcx); |
|
192 |
__ movl(Address(rsi,12), rdx); |
|
2111 | 193 |
|
194 |
// |
|
195 |
// cpuid(0x4) Deterministic cache params |
|
196 |
// |
|
5902 | 197 |
__ bind(std_cpuid4); |
2111 | 198 |
__ movl(rax, 4); |
5902 | 199 |
__ cmpl(rax, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); // Is cpuid(0x4) supported? |
200 |
__ jccb(Assembler::greater, std_cpuid1); |
|
201 |
||
2111 | 202 |
__ xorl(rcx, rcx); // L1 cache |
203 |
__ cpuid(); |
|
204 |
__ push(rax); |
|
205 |
__ andl(rax, 0x1f); // Determine if valid cache parameters used |
|
206 |
__ orl(rax, rax); // eax[4:0] == 0 indicates invalid cache |
|
207 |
__ pop(rax); |
|
208 |
__ jccb(Assembler::equal, std_cpuid1); |
|
209 |
||
210 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::dcp_cpuid4_offset()))); |
|
211 |
__ movl(Address(rsi, 0), rax); |
|
212 |
__ movl(Address(rsi, 4), rbx); |
|
213 |
__ movl(Address(rsi, 8), rcx); |
|
214 |
__ movl(Address(rsi,12), rdx); |
|
215 |
||
216 |
// |
|
217 |
// Standard cpuid(0x1) |
|
218 |
// |
|
219 |
__ bind(std_cpuid1); |
|
220 |
__ movl(rax, 1); |
|
221 |
__ cpuid(); |
|
222 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid1_offset()))); |
|
223 |
__ movl(Address(rsi, 0), rax); |
|
224 |
__ movl(Address(rsi, 4), rbx); |
|
225 |
__ movl(Address(rsi, 8), rcx); |
|
226 |
__ movl(Address(rsi,12), rdx); |
|
227 |
||
11427 | 228 |
// |
229 |
// Check if OS has enabled XGETBV instruction to access XCR0 |
|
230 |
// (OSXSAVE feature flag) and CPU supports AVX |
|
231 |
// |
|
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
232 |
__ andl(rcx, 0x18000000); // cpuid1 bits osxsave | avx |
11427 | 233 |
__ cmpl(rcx, 0x18000000); |
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
234 |
__ jccb(Assembler::notEqual, sef_cpuid); // jump if AVX is not supported |
11427 | 235 |
|
236 |
// |
|
237 |
// XCR0, XFEATURE_ENABLED_MASK register |
|
238 |
// |
|
239 |
__ xorl(rcx, rcx); // zero for XCR0 register |
|
240 |
__ xgetbv(); |
|
241 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); |
|
242 |
__ movl(Address(rsi, 0), rax); |
|
243 |
__ movl(Address(rsi, 4), rdx); |
|
244 |
||
245 |
// |
|
246 |
// cpuid(0x7) Structured Extended Features |
|
247 |
// |
|
248 |
__ bind(sef_cpuid); |
|
249 |
__ movl(rax, 7); |
|
250 |
__ cmpl(rax, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); // Is cpuid(0x7) supported? |
|
251 |
__ jccb(Assembler::greater, ext_cpuid); |
|
252 |
||
253 |
__ xorl(rcx, rcx); |
|
254 |
__ cpuid(); |
|
255 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::sef_cpuid7_offset()))); |
|
256 |
__ movl(Address(rsi, 0), rax); |
|
257 |
__ movl(Address(rsi, 4), rbx); |
|
258 |
||
259 |
// |
|
260 |
// Extended cpuid(0x80000000) |
|
261 |
// |
|
262 |
__ bind(ext_cpuid); |
|
2111 | 263 |
__ movl(rax, 0x80000000); |
264 |
__ cpuid(); |
|
265 |
__ cmpl(rax, 0x80000000); // Is cpuid(0x80000001) supported? |
|
266 |
__ jcc(Assembler::belowEqual, done); |
|
267 |
__ cmpl(rax, 0x80000004); // Is cpuid(0x80000005) supported? |
|
268 |
__ jccb(Assembler::belowEqual, ext_cpuid1); |
|
11417
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
269 |
__ cmpl(rax, 0x80000006); // Is cpuid(0x80000007) supported? |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
270 |
__ jccb(Assembler::belowEqual, ext_cpuid5); |
2111 | 271 |
__ cmpl(rax, 0x80000007); // Is cpuid(0x80000008) supported? |
11417
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
272 |
__ jccb(Assembler::belowEqual, ext_cpuid7); |
2111 | 273 |
// |
274 |
// Extended cpuid(0x80000008) |
|
275 |
// |
|
276 |
__ movl(rax, 0x80000008); |
|
277 |
__ cpuid(); |
|
278 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid8_offset()))); |
|
279 |
__ movl(Address(rsi, 0), rax); |
|
280 |
__ movl(Address(rsi, 4), rbx); |
|
281 |
__ movl(Address(rsi, 8), rcx); |
|
282 |
__ movl(Address(rsi,12), rdx); |
|
283 |
||
284 |
// |
|
11417
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
285 |
// Extended cpuid(0x80000007) |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
286 |
// |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
287 |
__ bind(ext_cpuid7); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
288 |
__ movl(rax, 0x80000007); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
289 |
__ cpuid(); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
290 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid7_offset()))); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
291 |
__ movl(Address(rsi, 0), rax); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
292 |
__ movl(Address(rsi, 4), rbx); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
293 |
__ movl(Address(rsi, 8), rcx); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
294 |
__ movl(Address(rsi,12), rdx); |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
295 |
|
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
296 |
// |
2111 | 297 |
// Extended cpuid(0x80000005) |
298 |
// |
|
299 |
__ bind(ext_cpuid5); |
|
300 |
__ movl(rax, 0x80000005); |
|
301 |
__ cpuid(); |
|
302 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid5_offset()))); |
|
303 |
__ movl(Address(rsi, 0), rax); |
|
304 |
__ movl(Address(rsi, 4), rbx); |
|
305 |
__ movl(Address(rsi, 8), rcx); |
|
306 |
__ movl(Address(rsi,12), rdx); |
|
307 |
||
308 |
// |
|
309 |
// Extended cpuid(0x80000001) |
|
310 |
// |
|
311 |
__ bind(ext_cpuid1); |
|
312 |
__ movl(rax, 0x80000001); |
|
313 |
__ cpuid(); |
|
314 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid1_offset()))); |
|
315 |
__ movl(Address(rsi, 0), rax); |
|
316 |
__ movl(Address(rsi, 4), rbx); |
|
317 |
__ movl(Address(rsi, 8), rcx); |
|
318 |
__ movl(Address(rsi,12), rdx); |
|
319 |
||
320 |
// |
|
30624 | 321 |
// Check if OS has enabled XGETBV instruction to access XCR0 |
322 |
// (OSXSAVE feature flag) and CPU supports AVX |
|
323 |
// |
|
324 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid1_offset()))); |
|
325 |
__ movl(rcx, 0x18000000); // cpuid1 bits osxsave | avx |
|
326 |
__ andl(rcx, Address(rsi, 8)); // cpuid1 bits osxsave | avx |
|
327 |
__ cmpl(rcx, 0x18000000); |
|
328 |
__ jccb(Assembler::notEqual, done); // jump if AVX is not supported |
|
329 |
||
330 |
__ movl(rax, 0x6); |
|
331 |
__ andl(rax, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); // xcr0 bits sse | ymm |
|
332 |
__ cmpl(rax, 0x6); |
|
333 |
__ jccb(Assembler::equal, start_simd_check); // return if AVX is not supported |
|
334 |
||
335 |
// we need to bridge farther than imm8, so we use this island as a thunk |
|
336 |
__ bind(done); |
|
337 |
__ jmp(wrapup); |
|
338 |
||
339 |
__ bind(start_simd_check); |
|
340 |
// |
|
341 |
// Some OSs have a bug when upper 128/256bits of YMM/ZMM |
|
342 |
// registers are not restored after a signal processing. |
|
343 |
// Generate SEGV here (reference through NULL) |
|
344 |
// and check upper YMM/ZMM bits after it. |
|
2111 | 345 |
// |
30624 | 346 |
intx saved_useavx = UseAVX; |
347 |
intx saved_usesse = UseSSE; |
|
348 |
// check _cpuid_info.sef_cpuid7_ebx.bits.avx512f |
|
349 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::sef_cpuid7_offset()))); |
|
350 |
__ movl(rax, 0x10000); |
|
351 |
__ andl(rax, Address(rsi, 4)); // xcr0 bits sse | ymm |
|
352 |
__ cmpl(rax, 0x10000); |
|
353 |
__ jccb(Assembler::notEqual, legacy_setup); // jump if EVEX is not supported |
|
354 |
// check _cpuid_info.xem_xcr0_eax.bits.opmask |
|
355 |
// check _cpuid_info.xem_xcr0_eax.bits.zmm512 |
|
356 |
// check _cpuid_info.xem_xcr0_eax.bits.zmm32 |
|
357 |
__ movl(rax, 0xE0); |
|
358 |
__ andl(rax, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); // xcr0 bits sse | ymm |
|
359 |
__ cmpl(rax, 0xE0); |
|
360 |
__ jccb(Assembler::notEqual, legacy_setup); // jump if EVEX is not supported |
|
361 |
||
362 |
// EVEX setup: run in lowest evex mode |
|
363 |
VM_Version::set_evex_cpuFeatures(); // Enable temporary to pass asserts |
|
364 |
UseAVX = 3; |
|
365 |
UseSSE = 2; |
|
366 |
// load value into all 64 bytes of zmm7 register |
|
367 |
__ movl(rcx, VM_Version::ymm_test_value()); |
|
368 |
__ movdl(xmm0, rcx); |
|
369 |
__ movl(rcx, 0xffff); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
370 |
__ kmovwl(k1, rcx); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
371 |
__ evpbroadcastd(xmm0, xmm0, Assembler::AVX_512bit); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
372 |
__ evmovdqul(xmm7, xmm0, Assembler::AVX_512bit); |
30624 | 373 |
#ifdef _LP64 |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
374 |
__ evmovdqul(xmm8, xmm0, Assembler::AVX_512bit); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
375 |
__ evmovdqul(xmm31, xmm0, Assembler::AVX_512bit); |
30624 | 376 |
#endif |
377 |
VM_Version::clean_cpuFeatures(); |
|
378 |
__ jmp(save_restore_except); |
|
379 |
||
380 |
__ bind(legacy_setup); |
|
381 |
// AVX setup |
|
382 |
VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts |
|
383 |
UseAVX = 1; |
|
384 |
UseSSE = 2; |
|
385 |
// load value into all 32 bytes of ymm7 register |
|
386 |
__ movl(rcx, VM_Version::ymm_test_value()); |
|
387 |
||
388 |
__ movdl(xmm0, rcx); |
|
389 |
__ pshufd(xmm0, xmm0, 0x00); |
|
390 |
__ vinsertf128h(xmm0, xmm0, xmm0); |
|
391 |
__ vmovdqu(xmm7, xmm0); |
|
392 |
#ifdef _LP64 |
|
393 |
__ vmovdqu(xmm8, xmm0); |
|
394 |
__ vmovdqu(xmm15, xmm0); |
|
395 |
#endif |
|
396 |
VM_Version::clean_cpuFeatures(); |
|
397 |
||
398 |
__ bind(save_restore_except); |
|
399 |
__ xorl(rsi, rsi); |
|
400 |
VM_Version::set_cpuinfo_segv_addr(__ pc()); |
|
401 |
// Generate SEGV |
|
402 |
__ movl(rax, Address(rsi, 0)); |
|
403 |
||
404 |
VM_Version::set_cpuinfo_cont_addr(__ pc()); |
|
405 |
// Returns here after signal. Save xmm0 to check it later. |
|
406 |
||
407 |
// check _cpuid_info.sef_cpuid7_ebx.bits.avx512f |
|
408 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::sef_cpuid7_offset()))); |
|
409 |
__ movl(rax, 0x10000); |
|
410 |
__ andl(rax, Address(rsi, 4)); |
|
411 |
__ cmpl(rax, 0x10000); |
|
412 |
__ jccb(Assembler::notEqual, legacy_save_restore); |
|
413 |
// check _cpuid_info.xem_xcr0_eax.bits.opmask |
|
414 |
// check _cpuid_info.xem_xcr0_eax.bits.zmm512 |
|
415 |
// check _cpuid_info.xem_xcr0_eax.bits.zmm32 |
|
416 |
__ movl(rax, 0xE0); |
|
417 |
__ andl(rax, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); // xcr0 bits sse | ymm |
|
418 |
__ cmpl(rax, 0xE0); |
|
419 |
__ jccb(Assembler::notEqual, legacy_save_restore); |
|
420 |
||
421 |
// EVEX check: run in lowest evex mode |
|
422 |
VM_Version::set_evex_cpuFeatures(); // Enable temporary to pass asserts |
|
423 |
UseAVX = 3; |
|
424 |
UseSSE = 2; |
|
425 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::zmm_save_offset()))); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
426 |
__ evmovdqul(Address(rsi, 0), xmm0, Assembler::AVX_512bit); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
427 |
__ evmovdqul(Address(rsi, 64), xmm7, Assembler::AVX_512bit); |
30624 | 428 |
#ifdef _LP64 |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
429 |
__ evmovdqul(Address(rsi, 128), xmm8, Assembler::AVX_512bit); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32581
diff
changeset
|
430 |
__ evmovdqul(Address(rsi, 192), xmm31, Assembler::AVX_512bit); |
30624 | 431 |
#endif |
432 |
VM_Version::clean_cpuFeatures(); |
|
433 |
UseAVX = saved_useavx; |
|
434 |
UseSSE = saved_usesse; |
|
435 |
__ jmp(wrapup); |
|
436 |
||
437 |
__ bind(legacy_save_restore); |
|
438 |
// AVX check |
|
439 |
VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts |
|
440 |
UseAVX = 1; |
|
441 |
UseSSE = 2; |
|
442 |
__ lea(rsi, Address(rbp, in_bytes(VM_Version::ymm_save_offset()))); |
|
443 |
__ vmovdqu(Address(rsi, 0), xmm0); |
|
444 |
__ vmovdqu(Address(rsi, 32), xmm7); |
|
445 |
#ifdef _LP64 |
|
446 |
__ vmovdqu(Address(rsi, 64), xmm8); |
|
447 |
__ vmovdqu(Address(rsi, 96), xmm15); |
|
448 |
#endif |
|
449 |
VM_Version::clean_cpuFeatures(); |
|
450 |
UseAVX = saved_useavx; |
|
451 |
UseSSE = saved_usesse; |
|
452 |
||
453 |
__ bind(wrapup); |
|
2111 | 454 |
__ popf(); |
455 |
__ pop(rsi); |
|
456 |
__ pop(rbx); |
|
457 |
__ pop(rbp); |
|
458 |
__ ret(0); |
|
459 |
||
460 |
# undef __ |
|
461 |
||
462 |
return start; |
|
463 |
}; |
|
464 |
}; |
|
465 |
||
466 |
void VM_Version::get_processor_features() { |
|
467 |
||
468 |
_cpu = 4; // 486 by default |
|
469 |
_model = 0; |
|
470 |
_stepping = 0; |
|
471 |
_cpuFeatures = 0; |
|
472 |
_logical_processors_per_package = 1; |
|
25633
4cd9c4622c8c
8049717: expose L1_data_cache_line_size for diagnostic/sanity checks
dcubed
parents:
25468
diff
changeset
|
473 |
// i486 internal cache is both I&D and has a 16-byte line size |
4cd9c4622c8c
8049717: expose L1_data_cache_line_size for diagnostic/sanity checks
dcubed
parents:
25468
diff
changeset
|
474 |
_L1_data_cache_line_size = 16; |
2111 | 475 |
|
35102 | 476 |
// Get raw processor info |
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
477 |
|
35102 | 478 |
get_cpu_info_stub(&_cpuid_info); |
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
479 |
|
35102 | 480 |
assert_is_initialized(); |
481 |
_cpu = extended_cpu_family(); |
|
482 |
_model = extended_cpu_model(); |
|
483 |
_stepping = cpu_stepping(); |
|
2111 | 484 |
|
35102 | 485 |
if (cpu_family() > 4) { // it supports CPUID |
486 |
_cpuFeatures = feature_flags(); |
|
487 |
// Logical processors are only available on P4s and above, |
|
488 |
// and only if hyperthreading is available. |
|
489 |
_logical_processors_per_package = logical_processor_count(); |
|
490 |
_L1_data_cache_line_size = L1_line_size(); |
|
2111 | 491 |
} |
492 |
||
493 |
_supports_cx8 = supports_cmpxchg8(); |
|
13886
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13885
diff
changeset
|
494 |
// xchg and xadd instructions |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13885
diff
changeset
|
495 |
_supports_atomic_getset4 = true; |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13885
diff
changeset
|
496 |
_supports_atomic_getadd4 = true; |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13885
diff
changeset
|
497 |
LP64_ONLY(_supports_atomic_getset8 = true); |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13885
diff
changeset
|
498 |
LP64_ONLY(_supports_atomic_getadd8 = true); |
2111 | 499 |
|
500 |
#ifdef _LP64 |
|
501 |
// OS should support SSE for x64 and hardware should support at least SSE2. |
|
502 |
if (!VM_Version::supports_sse2()) { |
|
503 |
vm_exit_during_initialization("Unknown x64 processor: SSE2 not supported"); |
|
504 |
} |
|
4430 | 505 |
// in 64 bit the use of SSE2 is the minimum |
506 |
if (UseSSE < 2) UseSSE = 2; |
|
2111 | 507 |
#endif |
508 |
||
10010
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
509 |
#ifdef AMD64 |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
510 |
// flush_icache_stub have to be generated first. |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
511 |
// That is why Icache line size is hard coded in ICache class, |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
512 |
// see icache_x86.hpp. It is also the reason why we can't use |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
513 |
// clflush instruction in 32-bit VM since it could be running |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
514 |
// on CPU which does not support it. |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
515 |
// |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
516 |
// The only thing we can do is to verify that flushed |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
517 |
// ICache::line_size has correct value. |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
518 |
guarantee(_cpuid_info.std_cpuid1_edx.bits.clflush != 0, "clflush is not supported"); |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
519 |
// clflush_size is size in quadwords (8 bytes). |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
520 |
guarantee(_cpuid_info.std_cpuid1_ebx.bits.clflush_size == 8, "such clflush size is not supported"); |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
521 |
#endif |
72de7c910672
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
9325
diff
changeset
|
522 |
|
2111 | 523 |
// If the OS doesn't support SSE, we can't use this feature even if the HW does |
524 |
if (!os::supports_sse()) |
|
525 |
_cpuFeatures &= ~(CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE4A|CPU_SSE4_1|CPU_SSE4_2); |
|
526 |
||
527 |
if (UseSSE < 4) { |
|
528 |
_cpuFeatures &= ~CPU_SSE4_1; |
|
529 |
_cpuFeatures &= ~CPU_SSE4_2; |
|
530 |
} |
|
531 |
||
532 |
if (UseSSE < 3) { |
|
533 |
_cpuFeatures &= ~CPU_SSE3; |
|
534 |
_cpuFeatures &= ~CPU_SSSE3; |
|
535 |
_cpuFeatures &= ~CPU_SSE4A; |
|
536 |
} |
|
537 |
||
538 |
if (UseSSE < 2) |
|
539 |
_cpuFeatures &= ~CPU_SSE2; |
|
540 |
||
541 |
if (UseSSE < 1) |
|
542 |
_cpuFeatures &= ~CPU_SSE; |
|
543 |
||
30624 | 544 |
// first try initial setting and detect what we can support |
545 |
if (UseAVX > 0) { |
|
546 |
if (UseAVX > 2 && supports_evex()) { |
|
547 |
UseAVX = 3; |
|
548 |
} else if (UseAVX > 1 && supports_avx2()) { |
|
549 |
UseAVX = 2; |
|
550 |
} else if (UseAVX > 0 && supports_avx()) { |
|
551 |
UseAVX = 1; |
|
552 |
} else { |
|
553 |
UseAVX = 0; |
|
554 |
} |
|
555 |
} else if (UseAVX < 0) { |
|
556 |
UseAVX = 0; |
|
557 |
} |
|
558 |
||
559 |
if (UseAVX < 3) { |
|
560 |
_cpuFeatures &= ~CPU_AVX512F; |
|
561 |
_cpuFeatures &= ~CPU_AVX512DQ; |
|
562 |
_cpuFeatures &= ~CPU_AVX512CD; |
|
563 |
_cpuFeatures &= ~CPU_AVX512BW; |
|
564 |
_cpuFeatures &= ~CPU_AVX512VL; |
|
565 |
} |
|
566 |
||
11427 | 567 |
if (UseAVX < 2) |
568 |
_cpuFeatures &= ~CPU_AVX2; |
|
569 |
||
570 |
if (UseAVX < 1) |
|
571 |
_cpuFeatures &= ~CPU_AVX; |
|
572 |
||
14132 | 573 |
if (!UseAES && !FLAG_IS_DEFAULT(UseAES)) |
574 |
_cpuFeatures &= ~CPU_AES; |
|
575 |
||
2111 | 576 |
if (logical_processors_per_package() == 1) { |
577 |
// HT processor could be installed on a system which doesn't support HT. |
|
578 |
_cpuFeatures &= ~CPU_HT; |
|
579 |
} |
|
580 |
||
581 |
char buf[256]; |
|
30624 | 582 |
jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", |
2111 | 583 |
cores_per_cpu(), threads_per_core(), |
584 |
cpu_family(), _model, _stepping, |
|
585 |
(supports_cmov() ? ", cmov" : ""), |
|
586 |
(supports_cmpxchg8() ? ", cx8" : ""), |
|
587 |
(supports_fxsr() ? ", fxsr" : ""), |
|
588 |
(supports_mmx() ? ", mmx" : ""), |
|
589 |
(supports_sse() ? ", sse" : ""), |
|
590 |
(supports_sse2() ? ", sse2" : ""), |
|
591 |
(supports_sse3() ? ", sse3" : ""), |
|
592 |
(supports_ssse3()? ", ssse3": ""), |
|
593 |
(supports_sse4_1() ? ", sse4.1" : ""), |
|
594 |
(supports_sse4_2() ? ", sse4.2" : ""), |
|
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
595 |
(supports_popcnt() ? ", popcnt" : ""), |
11427 | 596 |
(supports_avx() ? ", avx" : ""), |
597 |
(supports_avx2() ? ", avx2" : ""), |
|
14132 | 598 |
(supports_aes() ? ", aes" : ""), |
23491 | 599 |
(supports_clmul() ? ", clmul" : ""), |
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
600 |
(supports_erms() ? ", erms" : ""), |
23491 | 601 |
(supports_rtm() ? ", rtm" : ""), |
2111 | 602 |
(supports_mmx_ext() ? ", mmxext" : ""), |
9135 | 603 |
(supports_3dnow_prefetch() ? ", 3dnowpref" : ""), |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2348
diff
changeset
|
604 |
(supports_lzcnt() ? ", lzcnt": ""), |
2111 | 605 |
(supports_sse4a() ? ", sse4a": ""), |
11417
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
606 |
(supports_ht() ? ", ht": ""), |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
607 |
(supports_tsc() ? ", tsc": ""), |
4ecc3253bec4
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
10565
diff
changeset
|
608 |
(supports_tscinv_bit() ? ", tscinvbit": ""), |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
609 |
(supports_tscinv() ? ", tscinv": ""), |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
610 |
(supports_bmi1() ? ", bmi1" : ""), |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
611 |
(supports_bmi2() ? ", bmi2" : ""), |
30624 | 612 |
(supports_adx() ? ", adx" : ""), |
613 |
(supports_evex() ? ", evex" : "")); |
|
25949 | 614 |
_features_str = os::strdup(buf); |
2111 | 615 |
|
616 |
// UseSSE is set to the smaller of what hardware supports and what |
|
617 |
// the command line requires. I.e., you cannot set UseSSE to 2 on |
|
618 |
// older Pentiums which do not support it. |
|
11427 | 619 |
if (UseSSE > 4) UseSSE=4; |
620 |
if (UseSSE < 0) UseSSE=0; |
|
621 |
if (!supports_sse4_1()) // Drop to 3 if no SSE4 support |
|
2111 | 622 |
UseSSE = MIN2((intx)3,UseSSE); |
11427 | 623 |
if (!supports_sse3()) // Drop to 2 if no SSE3 support |
2111 | 624 |
UseSSE = MIN2((intx)2,UseSSE); |
11427 | 625 |
if (!supports_sse2()) // Drop to 1 if no SSE2 support |
2111 | 626 |
UseSSE = MIN2((intx)1,UseSSE); |
11427 | 627 |
if (!supports_sse ()) // Drop to 0 if no SSE support |
2111 | 628 |
UseSSE = 0; |
629 |
||
14132 | 630 |
// Use AES instructions if available. |
631 |
if (supports_aes()) { |
|
632 |
if (FLAG_IS_DEFAULT(UseAES)) { |
|
34176
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
633 |
FLAG_SET_DEFAULT(UseAES, true); |
14132 | 634 |
} |
34176
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
635 |
if (!UseAES) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
636 |
if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
637 |
warning("AES intrinsics require UseAES flag to be enabled. Intrinsics will be disabled."); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
638 |
} |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
639 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
640 |
} else { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
641 |
if (UseSSE > 2) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
642 |
if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
643 |
FLAG_SET_DEFAULT(UseAESIntrinsics, true); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
644 |
} |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
645 |
} else { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
646 |
// The AES intrinsic stubs require AES instruction support (of course) |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
647 |
// but also require sse3 mode or higher for instructions it use. |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
648 |
if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
649 |
warning("X86 AES intrinsics require SSE3 instructions or higher. Intrinsics will be disabled."); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
650 |
} |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
651 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
652 |
} |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
653 |
} |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
654 |
} else if (UseAES || UseAESIntrinsics) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
655 |
if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { |
23491 | 656 |
warning("AES instructions are not available on this CPU"); |
34176
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
657 |
FLAG_SET_DEFAULT(UseAES, false); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
658 |
} |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
659 |
if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
660 |
warning("AES intrinsics are not available on this CPU"); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
661 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
c1b52e665b47
8131778: java disables UseAES flag when using VIS=2 on sparc
kshefov
parents:
34162
diff
changeset
|
662 |
} |
14132 | 663 |
} |
664 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
665 |
// Use CLMUL instructions if available. |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
666 |
if (supports_clmul()) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
667 |
if (FLAG_IS_DEFAULT(UseCLMUL)) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
668 |
UseCLMUL = true; |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
669 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
670 |
} else if (UseCLMUL) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
671 |
if (!FLAG_IS_DEFAULT(UseCLMUL)) |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
672 |
warning("CLMUL instructions not available on this CPU (AVX may also be required)"); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
673 |
FLAG_SET_DEFAULT(UseCLMUL, false); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
674 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
675 |
|
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
676 |
if (UseCLMUL && (UseSSE > 2)) { |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
677 |
if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
678 |
UseCRC32Intrinsics = true; |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
679 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
680 |
} else if (UseCRC32Intrinsics) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
681 |
if (!FLAG_IS_DEFAULT(UseCRC32Intrinsics)) |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
682 |
warning("CRC32 Intrinsics requires CLMUL instructions (not available on this CPU)"); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
683 |
FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
684 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15243
diff
changeset
|
685 |
|
33066 | 686 |
if (supports_sse4_2()) { |
687 |
if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { |
|
688 |
UseCRC32CIntrinsics = true; |
|
689 |
} |
|
690 |
} |
|
691 |
else if (UseCRC32CIntrinsics) { |
|
692 |
if (!FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { |
|
693 |
warning("CRC32C intrinsics are not available on this CPU"); |
|
694 |
} |
|
695 |
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false); |
|
696 |
} |
|
697 |
||
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
698 |
// GHASH/GCM intrinsics |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
699 |
if (UseCLMUL && (UseSSE > 2)) { |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
700 |
if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) { |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
701 |
UseGHASHIntrinsics = true; |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
702 |
} |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
703 |
} else if (UseGHASHIntrinsics) { |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
704 |
if (!FLAG_IS_DEFAULT(UseGHASHIntrinsics)) |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
705 |
warning("GHASH intrinsic requires CLMUL and SSE2 instructions on this CPU"); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
706 |
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
707 |
} |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
708 |
|
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
709 |
if (UseSHA) { |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
710 |
warning("SHA instructions are not available on this CPU"); |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
711 |
FLAG_SET_DEFAULT(UseSHA, false); |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
712 |
} |
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
713 |
|
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
714 |
if (UseSHA1Intrinsics) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
715 |
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU."); |
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
716 |
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false); |
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
717 |
} |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
718 |
|
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
719 |
if (UseSHA256Intrinsics) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
720 |
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU."); |
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
721 |
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false); |
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
722 |
} |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
723 |
|
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
724 |
if (UseSHA512Intrinsics) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31584
diff
changeset
|
725 |
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU."); |
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
726 |
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
727 |
} |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
24424
diff
changeset
|
728 |
|
32581 | 729 |
if (UseAdler32Intrinsics) { |
730 |
warning("Adler32Intrinsics not available on this CPU."); |
|
731 |
FLAG_SET_DEFAULT(UseAdler32Intrinsics, false); |
|
732 |
} |
|
733 |
||
23491 | 734 |
// Adjust RTM (Restricted Transactional Memory) flags |
735 |
if (!supports_rtm() && UseRTMLocking) { |
|
736 |
// Can't continue because UseRTMLocking affects UseBiasedLocking flag |
|
737 |
// setting during arguments processing. See use_biased_locking(). |
|
738 |
// VM_Version_init() is executed after UseBiasedLocking is used |
|
739 |
// in Thread::allocate(). |
|
740 |
vm_exit_during_initialization("RTM instructions are not available on this CPU"); |
|
741 |
} |
|
742 |
||
743 |
#if INCLUDE_RTM_OPT |
|
744 |
if (UseRTMLocking) { |
|
26306
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
745 |
if (is_intel_family_core()) { |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
746 |
if ((_model == CPU_MODEL_HASWELL_E3) || |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
747 |
(_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) || |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
748 |
(_model == CPU_MODEL_BROADWELL && _stepping < 4)) { |
30624 | 749 |
// currently a collision between SKL and HSW_E3 |
750 |
if (!UnlockExperimentalVMOptions && UseAVX < 3) { |
|
26306
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
751 |
vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag."); |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
752 |
} else { |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
753 |
warning("UseRTMLocking is only available as experimental option on this platform."); |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
754 |
} |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
755 |
} |
2b4cf8eb3de7
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
25949
diff
changeset
|
756 |
} |
23491 | 757 |
if (!FLAG_IS_CMDLINE(UseRTMLocking)) { |
758 |
// RTM locking should be used only for applications with |
|
759 |
// high lock contention. For now we do not use it by default. |
|
760 |
vm_exit_during_initialization("UseRTMLocking flag should be only set on command line"); |
|
761 |
} |
|
762 |
if (!is_power_of_2(RTMTotalCountIncrRate)) { |
|
763 |
warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64"); |
|
764 |
FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64); |
|
765 |
} |
|
766 |
if (RTMAbortRatio < 0 || RTMAbortRatio > 100) { |
|
767 |
warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50"); |
|
768 |
FLAG_SET_DEFAULT(RTMAbortRatio, 50); |
|
769 |
} |
|
770 |
} else { // !UseRTMLocking |
|
771 |
if (UseRTMForStackLocks) { |
|
772 |
if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) { |
|
773 |
warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off"); |
|
774 |
} |
|
775 |
FLAG_SET_DEFAULT(UseRTMForStackLocks, false); |
|
776 |
} |
|
777 |
if (UseRTMDeopt) { |
|
778 |
FLAG_SET_DEFAULT(UseRTMDeopt, false); |
|
779 |
} |
|
780 |
if (PrintPreciseRTMLockingStatistics) { |
|
781 |
FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false); |
|
782 |
} |
|
783 |
} |
|
784 |
#else |
|
785 |
if (UseRTMLocking) { |
|
786 |
// Only C2 does RTM locking optimization. |
|
787 |
// Can't continue because UseRTMLocking affects UseBiasedLocking flag |
|
788 |
// setting during arguments processing. See use_biased_locking(). |
|
789 |
vm_exit_during_initialization("RTM locking optimization is not supported in this VM"); |
|
790 |
} |
|
791 |
#endif |
|
792 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
793 |
#ifdef COMPILER2 |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
794 |
if (UseFPUForSpilling) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
795 |
if (UseSSE < 2) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
796 |
// Only supported with SSE2+ |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
797 |
FLAG_SET_DEFAULT(UseFPUForSpilling, false); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
798 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
799 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33066
diff
changeset
|
800 |
#endif |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33066
diff
changeset
|
801 |
#if defined(COMPILER2) || INCLUDE_JVMCI |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
802 |
if (MaxVectorSize > 0) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
803 |
if (!is_power_of_2(MaxVectorSize)) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
804 |
warning("MaxVectorSize must be a power of 2"); |
30624 | 805 |
FLAG_SET_DEFAULT(MaxVectorSize, 64); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
806 |
} |
30624 | 807 |
if (MaxVectorSize > 64) { |
808 |
FLAG_SET_DEFAULT(MaxVectorSize, 64); |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
809 |
} |
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
810 |
if (MaxVectorSize > 16 && (UseAVX == 0 || !os_supports_avx_vectors())) { |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
811 |
// 32 bytes vectors (in YMM) are only supported with AVX+ |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
812 |
FLAG_SET_DEFAULT(MaxVectorSize, 16); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
813 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
814 |
if (UseSSE < 2) { |
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
815 |
// Vectors (in XMM) are only supported with SSE2+ |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
816 |
FLAG_SET_DEFAULT(MaxVectorSize, 0); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
817 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33066
diff
changeset
|
818 |
#if defined(COMPILER2) && defined(ASSERT) |
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
819 |
if (supports_avx() && PrintMiscellaneous && Verbose && TraceNewVectors) { |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
820 |
tty->print_cr("State of YMM registers after signal handle:"); |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
821 |
int nreg = 2 LP64_ONLY(+2); |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
822 |
const char* ymm_name[4] = {"0", "7", "8", "15"}; |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
823 |
for (int i = 0; i < nreg; i++) { |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
824 |
tty->print("YMM%s:", ymm_name[i]); |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
825 |
for (int j = 7; j >=0; j--) { |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
826 |
tty->print(" %x", _cpuid_info.ymm_save[i*8 + j]); |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
827 |
} |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
828 |
tty->cr(); |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
829 |
} |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
830 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33066
diff
changeset
|
831 |
#endif // COMPILER2 && ASSERT |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
832 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33066
diff
changeset
|
833 |
#endif // COMPILER2 || INCLUDE_JVMCI |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
834 |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33066
diff
changeset
|
835 |
#ifdef COMPILER2 |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
836 |
#ifdef _LP64 |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
837 |
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
838 |
UseMultiplyToLenIntrinsic = true; |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
839 |
} |
31129
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
840 |
if (FLAG_IS_DEFAULT(UseSquareToLenIntrinsic)) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
841 |
UseSquareToLenIntrinsic = true; |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
842 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
843 |
if (FLAG_IS_DEFAULT(UseMulAddIntrinsic)) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
844 |
UseMulAddIntrinsic = true; |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
845 |
} |
31583
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
846 |
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
847 |
UseMontgomeryMultiplyIntrinsic = true; |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
848 |
} |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
849 |
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
850 |
UseMontgomerySquareIntrinsic = true; |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
851 |
} |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
852 |
#else |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
853 |
if (UseMultiplyToLenIntrinsic) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
854 |
if (!FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
855 |
warning("multiplyToLen intrinsic is not available in 32-bit VM"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
856 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
857 |
FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, false); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
858 |
} |
31583
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
859 |
if (UseMontgomeryMultiplyIntrinsic) { |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
860 |
if (!FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
861 |
warning("montgomeryMultiply intrinsic is not available in 32-bit VM"); |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
862 |
} |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
863 |
FLAG_SET_DEFAULT(UseMontgomeryMultiplyIntrinsic, false); |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
864 |
} |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
865 |
if (UseMontgomerySquareIntrinsic) { |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
866 |
if (!FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
867 |
warning("montgomerySquare intrinsic is not available in 32-bit VM"); |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
868 |
} |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
869 |
FLAG_SET_DEFAULT(UseMontgomerySquareIntrinsic, false); |
eb5bea7b4835
8130150: Implement BigInteger.montgomeryMultiply intrinsic
aph
parents:
31129
diff
changeset
|
870 |
} |
31129
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
871 |
if (UseSquareToLenIntrinsic) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
872 |
if (!FLAG_IS_DEFAULT(UseSquareToLenIntrinsic)) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
873 |
warning("squareToLen intrinsic is not available in 32-bit VM"); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
874 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
875 |
FLAG_SET_DEFAULT(UseSquareToLenIntrinsic, false); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
876 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
877 |
if (UseMulAddIntrinsic) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
878 |
if (!FLAG_IS_DEFAULT(UseMulAddIntrinsic)) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
879 |
warning("mulAdd intrinsic is not available in 32-bit VM"); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
880 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
881 |
FLAG_SET_DEFAULT(UseMulAddIntrinsic, false); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30624
diff
changeset
|
882 |
} |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
883 |
#endif |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
884 |
#endif // COMPILER2 |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
885 |
|
2111 | 886 |
// On new cpus instructions which update whole XMM register should be used |
887 |
// to prevent partial register stall due to dependencies on high half. |
|
888 |
// |
|
889 |
// UseXmmLoadAndClearUpper == true --> movsd(xmm, mem) |
|
890 |
// UseXmmLoadAndClearUpper == false --> movlpd(xmm, mem) |
|
891 |
// UseXmmRegToRegMoveAll == true --> movaps(xmm, xmm), movapd(xmm, xmm). |
|
892 |
// UseXmmRegToRegMoveAll == false --> movss(xmm, xmm), movsd(xmm, xmm). |
|
893 |
||
894 |
if( is_amd() ) { // AMD cpus specific settings |
|
895 |
if( supports_sse2() && FLAG_IS_DEFAULT(UseAddressNop) ) { |
|
896 |
// Use it on new AMD cpus starting from Opteron. |
|
897 |
UseAddressNop = true; |
|
898 |
} |
|
899 |
if( supports_sse2() && FLAG_IS_DEFAULT(UseNewLongLShift) ) { |
|
900 |
// Use it on new AMD cpus starting from Opteron. |
|
901 |
UseNewLongLShift = true; |
|
902 |
} |
|
903 |
if( FLAG_IS_DEFAULT(UseXmmLoadAndClearUpper) ) { |
|
34162 | 904 |
if (supports_sse4a()) { |
2111 | 905 |
UseXmmLoadAndClearUpper = true; // use movsd only on '10h' Opteron |
906 |
} else { |
|
907 |
UseXmmLoadAndClearUpper = false; |
|
908 |
} |
|
909 |
} |
|
910 |
if( FLAG_IS_DEFAULT(UseXmmRegToRegMoveAll) ) { |
|
911 |
if( supports_sse4a() ) { |
|
912 |
UseXmmRegToRegMoveAll = true; // use movaps, movapd only on '10h' |
|
913 |
} else { |
|
914 |
UseXmmRegToRegMoveAll = false; |
|
915 |
} |
|
916 |
} |
|
917 |
if( FLAG_IS_DEFAULT(UseXmmI2F) ) { |
|
918 |
if( supports_sse4a() ) { |
|
919 |
UseXmmI2F = true; |
|
920 |
} else { |
|
921 |
UseXmmI2F = false; |
|
922 |
} |
|
923 |
} |
|
924 |
if( FLAG_IS_DEFAULT(UseXmmI2D) ) { |
|
925 |
if( supports_sse4a() ) { |
|
926 |
UseXmmI2D = true; |
|
927 |
} else { |
|
928 |
UseXmmI2D = false; |
|
929 |
} |
|
930 |
} |
|
34207
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
931 |
if (supports_sse4_2() && UseSSE >= 4) { |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
932 |
if (FLAG_IS_DEFAULT(UseSSE42Intrinsics)) { |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
933 |
FLAG_SET_DEFAULT(UseSSE42Intrinsics, true); |
8873 | 934 |
} |
34207
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
935 |
} else { |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
936 |
if (UseSSE42Intrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
937 |
warning("SSE4.2 intrinsics require SSE4.2 instructions or higher. Intrinsics will be disabled."); |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
938 |
} |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
939 |
FLAG_SET_DEFAULT(UseSSE42Intrinsics, false); |
8873 | 940 |
} |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2348
diff
changeset
|
941 |
|
9325
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
942 |
// some defaults for AMD family 15h |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
943 |
if ( cpu_family() == 0x15 ) { |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
944 |
// On family 15h processors default is no sw prefetch |
8677 | 945 |
if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { |
946 |
AllocatePrefetchStyle = 0; |
|
947 |
} |
|
9325
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
948 |
// Also, if some other prefetch style is specified, default instruction type is PREFETCHW |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
949 |
if (FLAG_IS_DEFAULT(AllocatePrefetchInstr)) { |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
950 |
AllocatePrefetchInstr = 3; |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
951 |
} |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
952 |
// On family 15h processors use XMM and UnalignedLoadStores for Array Copy |
13885 | 953 |
if (supports_sse2() && FLAG_IS_DEFAULT(UseXMMForArrayCopy)) { |
9325
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
954 |
UseXMMForArrayCopy = true; |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
955 |
} |
13885 | 956 |
if (supports_sse2() && FLAG_IS_DEFAULT(UseUnalignedLoadStores)) { |
9325
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
957 |
UseUnalignedLoadStores = true; |
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
958 |
} |
8677 | 959 |
} |
9325
2b95b2b2b60f
7037812: few more defaults changes for new AMD processors
kvn
parents:
9135
diff
changeset
|
960 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
961 |
#ifdef COMPILER2 |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
962 |
if (MaxVectorSize > 16) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
963 |
// Limit vectors size to 16 bytes on current AMD cpus. |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
964 |
FLAG_SET_DEFAULT(MaxVectorSize, 16); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
965 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
11881
diff
changeset
|
966 |
#endif // COMPILER2 |
2111 | 967 |
} |
968 |
||
969 |
if( is_intel() ) { // Intel cpus specific settings |
|
970 |
if( FLAG_IS_DEFAULT(UseStoreImmI16) ) { |
|
971 |
UseStoreImmI16 = false; // don't use it on Intel cpus |
|
972 |
} |
|
973 |
if( cpu_family() == 6 || cpu_family() == 15 ) { |
|
974 |
if( FLAG_IS_DEFAULT(UseAddressNop) ) { |
|
975 |
// Use it on all Intel cpus starting from PentiumPro |
|
976 |
UseAddressNop = true; |
|
977 |
} |
|
978 |
} |
|
979 |
if( FLAG_IS_DEFAULT(UseXmmLoadAndClearUpper) ) { |
|
980 |
UseXmmLoadAndClearUpper = true; // use movsd on all Intel cpus |
|
981 |
} |
|
982 |
if( FLAG_IS_DEFAULT(UseXmmRegToRegMoveAll) ) { |
|
983 |
if( supports_sse3() ) { |
|
984 |
UseXmmRegToRegMoveAll = true; // use movaps, movapd on new Intel cpus |
|
985 |
} else { |
|
986 |
UseXmmRegToRegMoveAll = false; |
|
987 |
} |
|
988 |
} |
|
989 |
if( cpu_family() == 6 && supports_sse3() ) { // New Intel cpus |
|
990 |
#ifdef COMPILER2 |
|
991 |
if( FLAG_IS_DEFAULT(MaxLoopPad) ) { |
|
992 |
// For new Intel cpus do the next optimization: |
|
993 |
// don't align the beginning of a loop if there are enough instructions |
|
994 |
// left (NumberOfLoopInstrToAlign defined in c2_globals.hpp) |
|
995 |
// in current fetch line (OptoLoopAlignment) or the padding |
|
996 |
// is big (> MaxLoopPad). |
|
997 |
// Set MaxLoopPad to 11 for new Intel cpus to reduce number of |
|
998 |
// generated NOP instructions. 11 is the largest size of one |
|
999 |
// address NOP instruction '0F 1F' (see Assembler::nop(i)). |
|
1000 |
MaxLoopPad = 11; |
|
1001 |
} |
|
1002 |
#endif // COMPILER2 |
|
13885 | 1003 |
if (FLAG_IS_DEFAULT(UseXMMForArrayCopy)) { |
2111 | 1004 |
UseXMMForArrayCopy = true; // use SSE2 movq on new Intel cpus |
1005 |
} |
|
13885 | 1006 |
if (supports_sse4_2() && supports_ht()) { // Newest Intel cpus |
1007 |
if (FLAG_IS_DEFAULT(UseUnalignedLoadStores)) { |
|
2111 | 1008 |
UseUnalignedLoadStores = true; // use movdqu on newest Intel cpus |
1009 |
} |
|
1010 |
} |
|
13885 | 1011 |
if (supports_sse4_2() && UseSSE >= 4) { |
1012 |
if (FLAG_IS_DEFAULT(UseSSE42Intrinsics)) { |
|
34207
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
1013 |
FLAG_SET_DEFAULT(UseSSE42Intrinsics, true); |
2348 | 1014 |
} |
34207
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
1015 |
} else { |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
1016 |
if (UseSSE42Intrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
1017 |
warning("SSE4.2 intrinsics require SSE4.2 instructions or higher. Intrinsics will be disabled."); |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
1018 |
} |
a5f1c458b56e
8143208: compiler/c1/6855215/Test6855215.java supports_sse2() failed
zmajo
parents:
34176
diff
changeset
|
1019 |
FLAG_SET_DEFAULT(UseSSE42Intrinsics, false); |
2348 | 1020 |
} |
2111 | 1021 |
} |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1022 |
if ((cpu_family() == 0x06) && |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1023 |
((extended_cpu_model() == 0x36) || // Centerton |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1024 |
(extended_cpu_model() == 0x37) || // Silvermont |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1025 |
(extended_cpu_model() == 0x4D))) { |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1026 |
#ifdef COMPILER2 |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1027 |
if (FLAG_IS_DEFAULT(OptoScheduling)) { |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1028 |
OptoScheduling = true; |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1029 |
} |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1030 |
#endif |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1031 |
if (supports_sse4_2()) { // Silvermont |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1032 |
if (FLAG_IS_DEFAULT(UseUnalignedLoadStores)) { |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1033 |
UseUnalignedLoadStores = true; // use movdqu on newest Intel cpus |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1034 |
} |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1035 |
} |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1036 |
} |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1037 |
if(FLAG_IS_DEFAULT(AllocatePrefetchInstr) && supports_3dnow_prefetch()) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1038 |
AllocatePrefetchInstr = 3; |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1039 |
} |
2111 | 1040 |
} |
1041 |
||
35110
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1042 |
#ifdef _LP64 |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1043 |
if (UseSSE42Intrinsics) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1044 |
if (FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1045 |
UseVectorizedMismatchIntrinsic = true; |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1046 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1047 |
} else if (UseVectorizedMismatchIntrinsic) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1048 |
if (!FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1049 |
warning("vectorizedMismatch intrinsics are not available on this CPU"); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1050 |
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1051 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1052 |
#else |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1053 |
if (UseVectorizedMismatchIntrinsic) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1054 |
if (!FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1055 |
warning("vectorizedMismatch intrinsic is not available in 32-bit VM"); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1056 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1057 |
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1058 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1059 |
#endif // _LP64 |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
34207
diff
changeset
|
1060 |
|
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1061 |
// Use count leading zeros count instruction if available. |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1062 |
if (supports_lzcnt()) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1063 |
if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1064 |
UseCountLeadingZerosInstruction = true; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1065 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1066 |
} else if (UseCountLeadingZerosInstruction) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1067 |
warning("lzcnt instruction is not available on this CPU"); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1068 |
FLAG_SET_DEFAULT(UseCountLeadingZerosInstruction, false); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1069 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1070 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1071 |
// Use count trailing zeros instruction if available |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1072 |
if (supports_bmi1()) { |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1073 |
// tzcnt does not require VEX prefix |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1074 |
if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) { |
27414
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1075 |
if (!UseBMI1Instructions && !FLAG_IS_DEFAULT(UseBMI1Instructions)) { |
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1076 |
// Don't use tzcnt if BMI1 is switched off on command line. |
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1077 |
UseCountTrailingZerosInstruction = false; |
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1078 |
} else { |
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1079 |
UseCountTrailingZerosInstruction = true; |
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1080 |
} |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1081 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1082 |
} else if (UseCountTrailingZerosInstruction) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1083 |
warning("tzcnt instruction is not available on this CPU"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1084 |
FLAG_SET_DEFAULT(UseCountTrailingZerosInstruction, false); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1085 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1086 |
|
27414
39d976b80fb4
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
26434
diff
changeset
|
1087 |
// BMI instructions (except tzcnt) use an encoding with VEX prefix. |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1088 |
// VEX prefix is generated only when AVX > 0. |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1089 |
if (supports_bmi1() && supports_avx()) { |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1090 |
if (FLAG_IS_DEFAULT(UseBMI1Instructions)) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1091 |
UseBMI1Instructions = true; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1092 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1093 |
} else if (UseBMI1Instructions) { |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1094 |
warning("BMI1 instructions are not available on this CPU (AVX is also required)"); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1095 |
FLAG_SET_DEFAULT(UseBMI1Instructions, false); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1096 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1097 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1098 |
if (supports_bmi2() && supports_avx()) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1099 |
if (FLAG_IS_DEFAULT(UseBMI2Instructions)) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1100 |
UseBMI2Instructions = true; |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1101 |
} |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1102 |
} else if (UseBMI2Instructions) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1103 |
warning("BMI2 instructions are not available on this CPU (AVX is also required)"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
26306
diff
changeset
|
1104 |
FLAG_SET_DEFAULT(UseBMI2Instructions, false); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1105 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
18507
diff
changeset
|
1106 |
|
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1107 |
// Use population count instruction if available. |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1108 |
if (supports_popcnt()) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1109 |
if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1110 |
UsePopCountInstruction = true; |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1111 |
} |
11427 | 1112 |
} else if (UsePopCountInstruction) { |
1113 |
warning("POPCNT instruction is not available on this CPU"); |
|
1114 |
FLAG_SET_DEFAULT(UsePopCountInstruction, false); |
|
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1115 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2111
diff
changeset
|
1116 |
|
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1117 |
// Use fast-string operations if available. |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1118 |
if (supports_erms()) { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1119 |
if (FLAG_IS_DEFAULT(UseFastStosb)) { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1120 |
UseFastStosb = true; |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1121 |
} |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1122 |
} else if (UseFastStosb) { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1123 |
warning("fast-string operations are not available on this CPU"); |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1124 |
FLAG_SET_DEFAULT(UseFastStosb, false); |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1125 |
} |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14834
diff
changeset
|
1126 |
|
13885 | 1127 |
#ifdef COMPILER2 |
1128 |
if (FLAG_IS_DEFAULT(AlignVector)) { |
|
1129 |
// Modern processors allow misaligned memory operations for vectors. |
|
1130 |
AlignVector = !UseUnalignedLoadStores; |
|
1131 |
} |
|
1132 |
#endif // COMPILER2 |
|
1133 |
||
9135 | 1134 |
if( AllocatePrefetchInstr == 3 && !supports_3dnow_prefetch() ) AllocatePrefetchInstr=0; |
1135 |
if( !supports_sse() && supports_3dnow_prefetch() ) AllocatePrefetchInstr = 3; |
|
2111 | 1136 |
|
1137 |
// Allocation prefetch settings |
|
10267 | 1138 |
intx cache_line_size = prefetch_data_size(); |
2111 | 1139 |
if( cache_line_size > AllocatePrefetchStepSize ) |
1140 |
AllocatePrefetchStepSize = cache_line_size; |
|
10267 | 1141 |
|
2111 | 1142 |
assert(AllocatePrefetchLines > 0, "invalid value"); |
10267 | 1143 |
if( AllocatePrefetchLines < 1 ) // set valid value in product VM |
1144 |
AllocatePrefetchLines = 3; |
|
1145 |
assert(AllocateInstancePrefetchLines > 0, "invalid value"); |
|
1146 |
if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM |
|
1147 |
AllocateInstancePrefetchLines = 1; |
|
2111 | 1148 |
|
1149 |
AllocatePrefetchDistance = allocate_prefetch_distance(); |
|
1150 |
AllocatePrefetchStyle = allocate_prefetch_style(); |
|
1151 |
||
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1152 |
if (is_intel() && cpu_family() == 6 && supports_sse3()) { |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1153 |
if (AllocatePrefetchStyle == 2) { // watermark prefetching on Core |
2111 | 1154 |
#ifdef _LP64 |
5902 | 1155 |
AllocatePrefetchDistance = 384; |
2111 | 1156 |
#else |
5902 | 1157 |
AllocatePrefetchDistance = 320; |
2111 | 1158 |
#endif |
5902 | 1159 |
} |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1160 |
if (supports_sse4_2() && supports_ht()) { // Nehalem based cpus |
5902 | 1161 |
AllocatePrefetchDistance = 192; |
1162 |
AllocatePrefetchLines = 4; |
|
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1163 |
} |
6272
94a20ad0e9de
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
5902
diff
changeset
|
1164 |
#ifdef COMPILER2 |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1165 |
if (supports_sse4_2()) { |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1166 |
if (FLAG_IS_DEFAULT(UseFPUForSpilling)) { |
6272
94a20ad0e9de
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
5902
diff
changeset
|
1167 |
FLAG_SET_DEFAULT(UseFPUForSpilling, true); |
94a20ad0e9de
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
5902
diff
changeset
|
1168 |
} |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
25633
diff
changeset
|
1169 |
} |
6272
94a20ad0e9de
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
5902
diff
changeset
|
1170 |
#endif |
2111 | 1171 |
} |
1172 |
||
1173 |
#ifdef _LP64 |
|
1174 |
// Prefetch settings |
|
1175 |
PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); |
|
1176 |
PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes(); |
|
1177 |
PrefetchFieldsAhead = prefetch_fields_ahead(); |
|
1178 |
#endif |
|
1179 |
||
15193
8e6b5694267f
8003985: Support @Contended Annotation - JEP 142
jwilhelm
parents:
14834
diff
changeset
|
1180 |
if (FLAG_IS_DEFAULT(ContendedPaddingWidth) && |
8e6b5694267f
8003985: Support @Contended Annotation - JEP 142
jwilhelm
parents:
14834
diff
changeset
|
1181 |
(cache_line_size > ContendedPaddingWidth)) |
8e6b5694267f
8003985: Support @Contended Annotation - JEP 142
jwilhelm
parents:
14834
diff
changeset
|
1182 |
ContendedPaddingWidth = cache_line_size; |
8e6b5694267f
8003985: Support @Contended Annotation - JEP 142
jwilhelm
parents:
14834
diff
changeset
|
1183 |
|
30209
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28954
diff
changeset
|
1184 |
// This machine allows unaligned memory accesses |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28954
diff
changeset
|
1185 |
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28954
diff
changeset
|
1186 |
FLAG_SET_DEFAULT(UseUnalignedAccesses, true); |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28954
diff
changeset
|
1187 |
} |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
28954
diff
changeset
|
1188 |
|
2111 | 1189 |
#ifndef PRODUCT |
1190 |
if (PrintMiscellaneous && Verbose) { |
|
1191 |
tty->print_cr("Logical CPUs per core: %u", |
|
1192 |
logical_processors_per_package()); |
|
25633
4cd9c4622c8c
8049717: expose L1_data_cache_line_size for diagnostic/sanity checks
dcubed
parents:
25468
diff
changeset
|
1193 |
tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1194 |
tty->print("UseSSE=%d", (int) UseSSE); |
11427 | 1195 |
if (UseAVX > 0) { |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1196 |
tty->print(" UseAVX=%d", (int) UseAVX); |
11427 | 1197 |
} |
14132 | 1198 |
if (UseAES) { |
1199 |
tty->print(" UseAES=1"); |
|
1200 |
} |
|
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
1201 |
#ifdef COMPILER2 |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
1202 |
if (MaxVectorSize > 0) { |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1203 |
tty->print(" MaxVectorSize=%d", (int) MaxVectorSize); |
23487
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
1204 |
} |
0f7e268cd9e3
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
23220
diff
changeset
|
1205 |
#endif |
11427 | 1206 |
tty->cr(); |
10267 | 1207 |
tty->print("Allocation"); |
9135 | 1208 |
if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow_prefetch()) { |
10267 | 1209 |
tty->print_cr(": no prefetching"); |
2111 | 1210 |
} else { |
10267 | 1211 |
tty->print(" prefetching: "); |
9135 | 1212 |
if (UseSSE == 0 && supports_3dnow_prefetch()) { |
2111 | 1213 |
tty->print("PREFETCHW"); |
1214 |
} else if (UseSSE >= 1) { |
|
1215 |
if (AllocatePrefetchInstr == 0) { |
|
1216 |
tty->print("PREFETCHNTA"); |
|
1217 |
} else if (AllocatePrefetchInstr == 1) { |
|
1218 |
tty->print("PREFETCHT0"); |
|
1219 |
} else if (AllocatePrefetchInstr == 2) { |
|
1220 |
tty->print("PREFETCHT2"); |
|
1221 |
} else if (AllocatePrefetchInstr == 3) { |
|
1222 |
tty->print("PREFETCHW"); |
|
1223 |
} |
|
1224 |
} |
|
1225 |
if (AllocatePrefetchLines > 1) { |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1226 |
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); |
2111 | 1227 |
} else { |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1228 |
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); |
2111 | 1229 |
} |
1230 |
} |
|
1231 |
||
1232 |
if (PrefetchCopyIntervalInBytes > 0) { |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1233 |
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes); |
2111 | 1234 |
} |
1235 |
if (PrefetchScanIntervalInBytes > 0) { |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1236 |
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes); |
2111 | 1237 |
} |
1238 |
if (PrefetchFieldsAhead > 0) { |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1239 |
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead); |
2111 | 1240 |
} |
15193
8e6b5694267f
8003985: Support @Contended Annotation - JEP 142
jwilhelm
parents:
14834
diff
changeset
|
1241 |
if (ContendedPaddingWidth > 0) { |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24325
diff
changeset
|
1242 |
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth); |
15193
8e6b5694267f
8003985: Support @Contended Annotation - JEP 142
jwilhelm
parents:
14834
diff
changeset
|
1243 |
} |
2111 | 1244 |
} |
1245 |
#endif // !PRODUCT |
|
1246 |
} |
|
1247 |
||
23491 | 1248 |
bool VM_Version::use_biased_locking() { |
1249 |
#if INCLUDE_RTM_OPT |
|
1250 |
// RTM locking is most useful when there is high lock contention and |
|
1251 |
// low data contention. With high lock contention the lock is usually |
|
1252 |
// inflated and biased locking is not suitable for that case. |
|
1253 |
// RTM locking code requires that biased locking is off. |
|
1254 |
// Note: we can't switch off UseBiasedLocking in get_processor_features() |
|
1255 |
// because it is used by Thread::allocate() which is called before |
|
1256 |
// VM_Version::initialize(). |
|
1257 |
if (UseRTMLocking && UseBiasedLocking) { |
|
1258 |
if (FLAG_IS_DEFAULT(UseBiasedLocking)) { |
|
1259 |
FLAG_SET_DEFAULT(UseBiasedLocking, false); |
|
1260 |
} else { |
|
1261 |
warning("Biased locking is not supported with RTM locking; ignoring UseBiasedLocking flag." ); |
|
1262 |
UseBiasedLocking = false; |
|
1263 |
} |
|
1264 |
} |
|
1265 |
#endif |
|
1266 |
return UseBiasedLocking; |
|
1267 |
} |
|
1268 |
||
2111 | 1269 |
void VM_Version::initialize() { |
1270 |
ResourceMark rm; |
|
1271 |
// Making this stub must be FIRST use of assembler |
|
1272 |
||
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
1273 |
stub_blob = BufferBlob::create("get_cpu_info_stub", stub_size); |
2111 | 1274 |
if (stub_blob == NULL) { |
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
1275 |
vm_exit_during_initialization("Unable to allocate get_cpu_info_stub"); |
2111 | 1276 |
} |
6418 | 1277 |
CodeBuffer c(stub_blob); |
2111 | 1278 |
VM_Version_StubGenerator g(&c); |
23527
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
1279 |
get_cpu_info_stub = CAST_TO_FN_PTR(get_cpu_info_stub_t, |
397b6816032d
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
23491
diff
changeset
|
1280 |
g.generate_get_cpu_info()); |
2111 | 1281 |
|
1282 |
get_processor_features(); |
|
1283 |
} |