Mercurial > hg > truffle
annotate src/cpu/x86/vm/vm_version_x86.cpp @ 21523:4b3b38415adf
make GraalRuntime::parse_argument public to avoid needing the firend declaration
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Thu, 28 May 2015 18:06:26 +0200 |
parents | 2e35a4ea22ac |
children | be896a1983c0 |
rev | line source |
---|---|
585 | 1 /* |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
585 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1060
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1060
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1060
diff
changeset
|
21 * questions. |
585 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
6943
diff
changeset
|
26 #include "asm/macroAssembler.hpp" |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
6943
diff
changeset
|
27 #include "asm/macroAssembler.inline.hpp" |
1972 | 28 #include "memory/resourceArea.hpp" |
29 #include "runtime/java.hpp" | |
30 #include "runtime/stubCodeGenerator.hpp" | |
31 #include "vm_version_x86.hpp" | |
32 #ifdef TARGET_OS_FAMILY_linux | |
33 # include "os_linux.inline.hpp" | |
34 #endif | |
35 #ifdef TARGET_OS_FAMILY_solaris | |
36 # include "os_solaris.inline.hpp" | |
37 #endif | |
38 #ifdef TARGET_OS_FAMILY_windows | |
39 # include "os_windows.inline.hpp" | |
40 #endif | |
3960 | 41 #ifdef TARGET_OS_FAMILY_bsd |
42 # include "os_bsd.inline.hpp" | |
43 #endif | |
585 | 44 |
45 | |
46 int VM_Version::_cpu; | |
47 int VM_Version::_model; | |
48 int VM_Version::_stepping; | |
49 int VM_Version::_cpuFeatures; | |
50 const char* VM_Version::_features_str = ""; | |
51 VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; | |
52 | |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
53 // Address of instruction which causes SEGV |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
54 address VM_Version::_cpuinfo_segv_addr = 0; |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
55 // Address of instruction after the one which causes SEGV |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
56 address VM_Version::_cpuinfo_cont_addr = 0; |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
57 |
585 | 58 static BufferBlob* stub_blob; |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
59 static const int stub_size = 600; |
585 | 60 |
61 extern "C" { | |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
62 typedef void (*get_cpu_info_stub_t)(void*); |
585 | 63 } |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
64 static get_cpu_info_stub_t get_cpu_info_stub = NULL; |
585 | 65 |
66 | |
67 class VM_Version_StubGenerator: public StubCodeGenerator { | |
68 public: | |
69 | |
70 VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {} | |
71 | |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
72 address generate_get_cpu_info() { |
585 | 73 // Flags to test CPU type. |
4961
0368109684cb
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
sla
parents:
4771
diff
changeset
|
74 const uint32_t HS_EFL_AC = 0x40000; |
0368109684cb
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
sla
parents:
4771
diff
changeset
|
75 const uint32_t HS_EFL_ID = 0x200000; |
585 | 76 // Values for when we don't have a CPUID instruction. |
77 const int CPU_FAMILY_SHIFT = 8; | |
78 const uint32_t CPU_FAMILY_386 = (3 << CPU_FAMILY_SHIFT); | |
79 const uint32_t CPU_FAMILY_486 = (4 << CPU_FAMILY_SHIFT); | |
80 | |
1622 | 81 Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4; |
4771 | 82 Label sef_cpuid, ext_cpuid, ext_cpuid1, ext_cpuid5, ext_cpuid7, done; |
585 | 83 |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
84 StubCodeMark mark(this, "VM_Version", "get_cpu_info_stub"); |
585 | 85 # define __ _masm-> |
86 | |
87 address start = __ pc(); | |
88 | |
89 // | |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
90 // void get_cpu_info(VM_Version::CpuidInfo* cpuid_info); |
585 | 91 // |
92 // LP64: rcx and rdx are first and second argument registers on windows | |
93 | |
94 __ push(rbp); | |
95 #ifdef _LP64 | |
96 __ mov(rbp, c_rarg0); // cpuid_info address | |
97 #else | |
98 __ movptr(rbp, Address(rsp, 8)); // cpuid_info address | |
99 #endif | |
100 __ push(rbx); | |
101 __ push(rsi); | |
102 __ pushf(); // preserve rbx, and flags | |
103 __ pop(rax); | |
104 __ push(rax); | |
105 __ mov(rcx, rax); | |
106 // | |
107 // if we are unable to change the AC flag, we have a 386 | |
108 // | |
4961
0368109684cb
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
sla
parents:
4771
diff
changeset
|
109 __ xorl(rax, HS_EFL_AC); |
585 | 110 __ push(rax); |
111 __ popf(); | |
112 __ pushf(); | |
113 __ pop(rax); | |
114 __ cmpptr(rax, rcx); | |
115 __ jccb(Assembler::notEqual, detect_486); | |
116 | |
117 __ movl(rax, CPU_FAMILY_386); | |
118 __ movl(Address(rbp, in_bytes(VM_Version::std_cpuid1_offset())), rax); | |
119 __ jmp(done); | |
120 | |
121 // | |
122 // If we are unable to change the ID flag, we have a 486 which does | |
123 // not support the "cpuid" instruction. | |
124 // | |
125 __ bind(detect_486); | |
126 __ mov(rax, rcx); | |
4961
0368109684cb
7132070: Use a mach_port_t as the OSThread thread_id rather than pthread_t on BSD/OSX
sla
parents:
4771
diff
changeset
|
127 __ xorl(rax, HS_EFL_ID); |
585 | 128 __ push(rax); |
129 __ popf(); | |
130 __ pushf(); | |
131 __ pop(rax); | |
132 __ cmpptr(rcx, rax); | |
133 __ jccb(Assembler::notEqual, detect_586); | |
134 | |
135 __ bind(cpu486); | |
136 __ movl(rax, CPU_FAMILY_486); | |
137 __ movl(Address(rbp, in_bytes(VM_Version::std_cpuid1_offset())), rax); | |
138 __ jmp(done); | |
139 | |
140 // | |
141 // At this point, we have a chip which supports the "cpuid" instruction | |
142 // | |
143 __ bind(detect_586); | |
144 __ xorl(rax, rax); | |
145 __ cpuid(); | |
146 __ orl(rax, rax); | |
147 __ jcc(Assembler::equal, cpu486); // if cpuid doesn't support an input | |
148 // value of at least 1, we give up and | |
149 // assume a 486 | |
150 __ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); | |
151 __ movl(Address(rsi, 0), rax); | |
152 __ movl(Address(rsi, 4), rbx); | |
153 __ movl(Address(rsi, 8), rcx); | |
154 __ movl(Address(rsi,12), rdx); | |
155 | |
1622 | 156 __ cmpl(rax, 0xa); // Is cpuid(0xB) supported? |
157 __ jccb(Assembler::belowEqual, std_cpuid4); | |
158 | |
159 // | |
160 // cpuid(0xB) Processor Topology | |
161 // | |
162 __ movl(rax, 0xb); | |
163 __ xorl(rcx, rcx); // Threads level | |
164 __ cpuid(); | |
165 | |
166 __ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB0_offset()))); | |
167 __ movl(Address(rsi, 0), rax); | |
168 __ movl(Address(rsi, 4), rbx); | |
169 __ movl(Address(rsi, 8), rcx); | |
170 __ movl(Address(rsi,12), rdx); | |
171 | |
172 __ movl(rax, 0xb); | |
173 __ movl(rcx, 1); // Cores level | |
174 __ cpuid(); | |
175 __ push(rax); | |
176 __ andl(rax, 0x1f); // Determine if valid topology level | |
177 __ orl(rax, rbx); // eax[4:0] | ebx[0:15] == 0 indicates invalid level | |
178 __ andl(rax, 0xffff); | |
179 __ pop(rax); | |
180 __ jccb(Assembler::equal, std_cpuid4); | |
181 | |
182 __ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB1_offset()))); | |
183 __ movl(Address(rsi, 0), rax); | |
184 __ movl(Address(rsi, 4), rbx); | |
185 __ movl(Address(rsi, 8), rcx); | |
186 __ movl(Address(rsi,12), rdx); | |
187 | |
188 __ movl(rax, 0xb); | |
189 __ movl(rcx, 2); // Packages level | |
190 __ cpuid(); | |
191 __ push(rax); | |
192 __ andl(rax, 0x1f); // Determine if valid topology level | |
193 __ orl(rax, rbx); // eax[4:0] | ebx[0:15] == 0 indicates invalid level | |
194 __ andl(rax, 0xffff); | |
195 __ pop(rax); | |
196 __ jccb(Assembler::equal, std_cpuid4); | |
197 | |
198 __ lea(rsi, Address(rbp, in_bytes(VM_Version::tpl_cpuidB2_offset()))); | |
199 __ movl(Address(rsi, 0), rax); | |
200 __ movl(Address(rsi, 4), rbx); | |
201 __ movl(Address(rsi, 8), rcx); | |
202 __ movl(Address(rsi,12), rdx); | |
585 | 203 |
204 // | |
205 // cpuid(0x4) Deterministic cache params | |
206 // | |
1622 | 207 __ bind(std_cpuid4); |
585 | 208 __ movl(rax, 4); |
1622 | 209 __ cmpl(rax, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); // Is cpuid(0x4) supported? |
210 __ jccb(Assembler::greater, std_cpuid1); | |
211 | |
585 | 212 __ xorl(rcx, rcx); // L1 cache |
213 __ cpuid(); | |
214 __ push(rax); | |
215 __ andl(rax, 0x1f); // Determine if valid cache parameters used | |
216 __ orl(rax, rax); // eax[4:0] == 0 indicates invalid cache | |
217 __ pop(rax); | |
218 __ jccb(Assembler::equal, std_cpuid1); | |
219 | |
220 __ lea(rsi, Address(rbp, in_bytes(VM_Version::dcp_cpuid4_offset()))); | |
221 __ movl(Address(rsi, 0), rax); | |
222 __ movl(Address(rsi, 4), rbx); | |
223 __ movl(Address(rsi, 8), rcx); | |
224 __ movl(Address(rsi,12), rdx); | |
225 | |
226 // | |
227 // Standard cpuid(0x1) | |
228 // | |
229 __ bind(std_cpuid1); | |
230 __ movl(rax, 1); | |
231 __ cpuid(); | |
232 __ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid1_offset()))); | |
233 __ movl(Address(rsi, 0), rax); | |
234 __ movl(Address(rsi, 4), rbx); | |
235 __ movl(Address(rsi, 8), rcx); | |
236 __ movl(Address(rsi,12), rdx); | |
237 | |
4759 | 238 // |
239 // Check if OS has enabled XGETBV instruction to access XCR0 | |
240 // (OSXSAVE feature flag) and CPU supports AVX | |
241 // | |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
242 __ andl(rcx, 0x18000000); // cpuid1 bits osxsave | avx |
4759 | 243 __ cmpl(rcx, 0x18000000); |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
244 __ jccb(Assembler::notEqual, sef_cpuid); // jump if AVX is not supported |
4759 | 245 |
246 // | |
247 // XCR0, XFEATURE_ENABLED_MASK register | |
248 // | |
249 __ xorl(rcx, rcx); // zero for XCR0 register | |
250 __ xgetbv(); | |
251 __ lea(rsi, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); | |
252 __ movl(Address(rsi, 0), rax); | |
253 __ movl(Address(rsi, 4), rdx); | |
254 | |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
255 __ andl(rax, 0x6); // xcr0 bits sse | ymm |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
256 __ cmpl(rax, 0x6); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
257 __ jccb(Assembler::notEqual, sef_cpuid); // jump if AVX is not supported |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
258 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
259 // |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
260 // Some OSs have a bug when upper 128bits of YMM |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
261 // registers are not restored after a signal processing. |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
262 // Generate SEGV here (reference through NULL) |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
263 // and check upper YMM bits after it. |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
264 // |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
265 VM_Version::set_avx_cpuFeatures(); // Enable temporary to pass asserts |
17913 | 266 intx saved_useavx = UseAVX; |
267 intx saved_usesse = UseSSE; | |
268 UseAVX = 1; | |
269 UseSSE = 2; | |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
270 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
271 // load value into all 32 bytes of ymm7 register |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
272 __ movl(rcx, VM_Version::ymm_test_value()); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
273 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
274 __ movdl(xmm0, rcx); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
275 __ pshufd(xmm0, xmm0, 0x00); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
276 __ vinsertf128h(xmm0, xmm0, xmm0); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
277 __ vmovdqu(xmm7, xmm0); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
278 #ifdef _LP64 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
279 __ vmovdqu(xmm8, xmm0); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
280 __ vmovdqu(xmm15, xmm0); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
281 #endif |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
282 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
283 __ xorl(rsi, rsi); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
284 VM_Version::set_cpuinfo_segv_addr( __ pc() ); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
285 // Generate SEGV |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
286 __ movl(rax, Address(rsi, 0)); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
287 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
288 VM_Version::set_cpuinfo_cont_addr( __ pc() ); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
289 // Returns here after signal. Save xmm0 to check it later. |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
290 __ lea(rsi, Address(rbp, in_bytes(VM_Version::ymm_save_offset()))); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
291 __ vmovdqu(Address(rsi, 0), xmm0); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
292 __ vmovdqu(Address(rsi, 32), xmm7); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
293 #ifdef _LP64 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
294 __ vmovdqu(Address(rsi, 64), xmm8); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
295 __ vmovdqu(Address(rsi, 96), xmm15); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
296 #endif |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
297 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
298 VM_Version::clean_cpuFeatures(); |
17913 | 299 UseAVX = saved_useavx; |
300 UseSSE = saved_usesse; | |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
301 |
4759 | 302 // |
303 // cpuid(0x7) Structured Extended Features | |
304 // | |
305 __ bind(sef_cpuid); | |
306 __ movl(rax, 7); | |
307 __ cmpl(rax, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset()))); // Is cpuid(0x7) supported? | |
308 __ jccb(Assembler::greater, ext_cpuid); | |
309 | |
310 __ xorl(rcx, rcx); | |
311 __ cpuid(); | |
312 __ lea(rsi, Address(rbp, in_bytes(VM_Version::sef_cpuid7_offset()))); | |
313 __ movl(Address(rsi, 0), rax); | |
314 __ movl(Address(rsi, 4), rbx); | |
315 | |
316 // | |
317 // Extended cpuid(0x80000000) | |
318 // | |
319 __ bind(ext_cpuid); | |
585 | 320 __ movl(rax, 0x80000000); |
321 __ cpuid(); | |
322 __ cmpl(rax, 0x80000000); // Is cpuid(0x80000001) supported? | |
323 __ jcc(Assembler::belowEqual, done); | |
324 __ cmpl(rax, 0x80000004); // Is cpuid(0x80000005) supported? | |
325 __ jccb(Assembler::belowEqual, ext_cpuid1); | |
4749
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
326 __ cmpl(rax, 0x80000006); // Is cpuid(0x80000007) supported? |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
327 __ jccb(Assembler::belowEqual, ext_cpuid5); |
585 | 328 __ cmpl(rax, 0x80000007); // Is cpuid(0x80000008) supported? |
4749
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
329 __ jccb(Assembler::belowEqual, ext_cpuid7); |
585 | 330 // |
331 // Extended cpuid(0x80000008) | |
332 // | |
333 __ movl(rax, 0x80000008); | |
334 __ cpuid(); | |
335 __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid8_offset()))); | |
336 __ movl(Address(rsi, 0), rax); | |
337 __ movl(Address(rsi, 4), rbx); | |
338 __ movl(Address(rsi, 8), rcx); | |
339 __ movl(Address(rsi,12), rdx); | |
340 | |
341 // | |
4749
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
342 // Extended cpuid(0x80000007) |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
343 // |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
344 __ bind(ext_cpuid7); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
345 __ movl(rax, 0x80000007); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
346 __ cpuid(); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
347 __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid7_offset()))); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
348 __ movl(Address(rsi, 0), rax); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
349 __ movl(Address(rsi, 4), rbx); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
350 __ movl(Address(rsi, 8), rcx); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
351 __ movl(Address(rsi,12), rdx); |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
352 |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
353 // |
585 | 354 // Extended cpuid(0x80000005) |
355 // | |
356 __ bind(ext_cpuid5); | |
357 __ movl(rax, 0x80000005); | |
358 __ cpuid(); | |
359 __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid5_offset()))); | |
360 __ movl(Address(rsi, 0), rax); | |
361 __ movl(Address(rsi, 4), rbx); | |
362 __ movl(Address(rsi, 8), rcx); | |
363 __ movl(Address(rsi,12), rdx); | |
364 | |
365 // | |
366 // Extended cpuid(0x80000001) | |
367 // | |
368 __ bind(ext_cpuid1); | |
369 __ movl(rax, 0x80000001); | |
370 __ cpuid(); | |
371 __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid1_offset()))); | |
372 __ movl(Address(rsi, 0), rax); | |
373 __ movl(Address(rsi, 4), rbx); | |
374 __ movl(Address(rsi, 8), rcx); | |
375 __ movl(Address(rsi,12), rdx); | |
376 | |
377 // | |
378 // return | |
379 // | |
380 __ bind(done); | |
381 __ popf(); | |
382 __ pop(rsi); | |
383 __ pop(rbx); | |
384 __ pop(rbp); | |
385 __ ret(0); | |
386 | |
387 # undef __ | |
388 | |
389 return start; | |
390 }; | |
391 }; | |
392 | |
393 | |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
394 void VM_Version::get_cpu_info_wrapper() { |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
395 get_cpu_info_stub(&_cpuid_info); |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
396 } |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
397 |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
398 #ifndef CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
399 #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) f() |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
400 #endif |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
401 |
585 | 402 void VM_Version::get_processor_features() { |
403 | |
404 _cpu = 4; // 486 by default | |
405 _model = 0; | |
406 _stepping = 0; | |
407 _cpuFeatures = 0; | |
408 _logical_processors_per_package = 1; | |
409 | |
410 if (!Use486InstrsOnly) { | |
411 // Get raw processor info | |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
412 |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
413 // Some platforms (like Win*) need a wrapper around here |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
414 // in order to properly handle SEGV for YMM registers test. |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
415 CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(get_cpu_info_wrapper); |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
416 |
585 | 417 assert_is_initialized(); |
418 _cpu = extended_cpu_family(); | |
419 _model = extended_cpu_model(); | |
420 _stepping = cpu_stepping(); | |
421 | |
422 if (cpu_family() > 4) { // it supports CPUID | |
423 _cpuFeatures = feature_flags(); | |
424 // Logical processors are only available on P4s and above, | |
425 // and only if hyperthreading is available. | |
426 _logical_processors_per_package = logical_processor_count(); | |
427 } | |
428 } | |
429 | |
430 _supports_cx8 = supports_cmpxchg8(); | |
6795
7eca5de9e0b6
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
6794
diff
changeset
|
431 // xchg and xadd instructions |
7eca5de9e0b6
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
6794
diff
changeset
|
432 _supports_atomic_getset4 = true; |
7eca5de9e0b6
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
6794
diff
changeset
|
433 _supports_atomic_getadd4 = true; |
7eca5de9e0b6
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
6794
diff
changeset
|
434 LP64_ONLY(_supports_atomic_getset8 = true); |
7eca5de9e0b6
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
6794
diff
changeset
|
435 LP64_ONLY(_supports_atomic_getadd8 = true); |
585 | 436 |
437 #ifdef _LP64 | |
438 // OS should support SSE for x64 and hardware should support at least SSE2. | |
439 if (!VM_Version::supports_sse2()) { | |
440 vm_exit_during_initialization("Unknown x64 processor: SSE2 not supported"); | |
441 } | |
1060 | 442 // in 64 bit the use of SSE2 is the minimum |
443 if (UseSSE < 2) UseSSE = 2; | |
585 | 444 #endif |
445 | |
3787
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
446 #ifdef AMD64 |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
447 // flush_icache_stub have to be generated first. |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
448 // That is why Icache line size is hard coded in ICache class, |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
449 // see icache_x86.hpp. It is also the reason why we can't use |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
450 // clflush instruction in 32-bit VM since it could be running |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
451 // on CPU which does not support it. |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
452 // |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
453 // The only thing we can do is to verify that flushed |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
454 // ICache::line_size has correct value. |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
455 guarantee(_cpuid_info.std_cpuid1_edx.bits.clflush != 0, "clflush is not supported"); |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
456 // clflush_size is size in quadwords (8 bytes). |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
457 guarantee(_cpuid_info.std_cpuid1_ebx.bits.clflush_size == 8, "such clflush size is not supported"); |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
458 #endif |
6ae7a1561b53
6990015: Incorrect Icache line size is used for 64 bit x86
kvn
parents:
3276
diff
changeset
|
459 |
585 | 460 // If the OS doesn't support SSE, we can't use this feature even if the HW does |
461 if (!os::supports_sse()) | |
462 _cpuFeatures &= ~(CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE4A|CPU_SSE4_1|CPU_SSE4_2); | |
463 | |
464 if (UseSSE < 4) { | |
465 _cpuFeatures &= ~CPU_SSE4_1; | |
466 _cpuFeatures &= ~CPU_SSE4_2; | |
467 } | |
468 | |
469 if (UseSSE < 3) { | |
470 _cpuFeatures &= ~CPU_SSE3; | |
471 _cpuFeatures &= ~CPU_SSSE3; | |
472 _cpuFeatures &= ~CPU_SSE4A; | |
473 } | |
474 | |
475 if (UseSSE < 2) | |
476 _cpuFeatures &= ~CPU_SSE2; | |
477 | |
478 if (UseSSE < 1) | |
479 _cpuFeatures &= ~CPU_SSE; | |
480 | |
4759 | 481 if (UseAVX < 2) |
482 _cpuFeatures &= ~CPU_AVX2; | |
483 | |
484 if (UseAVX < 1) | |
485 _cpuFeatures &= ~CPU_AVX; | |
486 | |
6894 | 487 if (!UseAES && !FLAG_IS_DEFAULT(UseAES)) |
488 _cpuFeatures &= ~CPU_AES; | |
489 | |
585 | 490 if (logical_processors_per_package() == 1) { |
491 // HT processor could be installed on a system which doesn't support HT. | |
492 _cpuFeatures &= ~CPU_HT; | |
493 } | |
494 | |
495 char buf[256]; | |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
496 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", |
585 | 497 cores_per_cpu(), threads_per_core(), |
498 cpu_family(), _model, _stepping, | |
499 (supports_cmov() ? ", cmov" : ""), | |
500 (supports_cmpxchg8() ? ", cx8" : ""), | |
501 (supports_fxsr() ? ", fxsr" : ""), | |
502 (supports_mmx() ? ", mmx" : ""), | |
503 (supports_sse() ? ", sse" : ""), | |
504 (supports_sse2() ? ", sse2" : ""), | |
505 (supports_sse3() ? ", sse3" : ""), | |
506 (supports_ssse3()? ", ssse3": ""), | |
507 (supports_sse4_1() ? ", sse4.1" : ""), | |
508 (supports_sse4_2() ? ", sse4.2" : ""), | |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
509 (supports_popcnt() ? ", popcnt" : ""), |
4759 | 510 (supports_avx() ? ", avx" : ""), |
511 (supports_avx2() ? ", avx2" : ""), | |
6894 | 512 (supports_aes() ? ", aes" : ""), |
17780 | 513 (supports_clmul() ? ", clmul" : ""), |
7474
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
514 (supports_erms() ? ", erms" : ""), |
17780 | 515 (supports_rtm() ? ", rtm" : ""), |
585 | 516 (supports_mmx_ext() ? ", mmxext" : ""), |
2479 | 517 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""), |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
681
diff
changeset
|
518 (supports_lzcnt() ? ", lzcnt": ""), |
585 | 519 (supports_sse4a() ? ", sse4a": ""), |
4749
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
520 (supports_ht() ? ", ht": ""), |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
521 (supports_tsc() ? ", tsc": ""), |
7ab5f6318694
7125934: Add a fast unordered timestamp capability to Hotspot on x86/x64
phh
parents:
3960
diff
changeset
|
522 (supports_tscinv_bit() ? ", tscinvbit": ""), |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
523 (supports_tscinv() ? ", tscinv": ""), |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
524 (supports_bmi1() ? ", bmi1" : ""), |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
525 (supports_bmi2() ? ", bmi2" : ""), |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
526 (supports_adx() ? ", adx" : "")); |
585 | 527 _features_str = strdup(buf); |
528 | |
529 // UseSSE is set to the smaller of what hardware supports and what | |
530 // the command line requires. I.e., you cannot set UseSSE to 2 on | |
531 // older Pentiums which do not support it. | |
4759 | 532 if (UseSSE > 4) UseSSE=4; |
533 if (UseSSE < 0) UseSSE=0; | |
534 if (!supports_sse4_1()) // Drop to 3 if no SSE4 support | |
585 | 535 UseSSE = MIN2((intx)3,UseSSE); |
4759 | 536 if (!supports_sse3()) // Drop to 2 if no SSE3 support |
585 | 537 UseSSE = MIN2((intx)2,UseSSE); |
4759 | 538 if (!supports_sse2()) // Drop to 1 if no SSE2 support |
585 | 539 UseSSE = MIN2((intx)1,UseSSE); |
4759 | 540 if (!supports_sse ()) // Drop to 0 if no SSE support |
585 | 541 UseSSE = 0; |
542 | |
4759 | 543 if (UseAVX > 2) UseAVX=2; |
544 if (UseAVX < 0) UseAVX=0; | |
545 if (!supports_avx2()) // Drop to 1 if no AVX2 support | |
546 UseAVX = MIN2((intx)1,UseAVX); | |
547 if (!supports_avx ()) // Drop to 0 if no AVX support | |
548 UseAVX = 0; | |
549 | |
6894 | 550 // Use AES instructions if available. |
551 if (supports_aes()) { | |
552 if (FLAG_IS_DEFAULT(UseAES)) { | |
553 UseAES = true; | |
554 } | |
555 } else if (UseAES) { | |
556 if (!FLAG_IS_DEFAULT(UseAES)) | |
17780 | 557 warning("AES instructions are not available on this CPU"); |
6894 | 558 FLAG_SET_DEFAULT(UseAES, false); |
559 } | |
560 | |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
561 // Use CLMUL instructions if available. |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
562 if (supports_clmul()) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
563 if (FLAG_IS_DEFAULT(UseCLMUL)) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
564 UseCLMUL = true; |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
565 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
566 } else if (UseCLMUL) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
567 if (!FLAG_IS_DEFAULT(UseCLMUL)) |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
568 warning("CLMUL instructions not available on this CPU (AVX may also be required)"); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
569 FLAG_SET_DEFAULT(UseCLMUL, false); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
570 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
571 |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
572 if (UseCLMUL && (UseSSE > 2)) { |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
573 if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
574 UseCRC32Intrinsics = true; |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
575 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
576 } else if (UseCRC32Intrinsics) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
577 if (!FLAG_IS_DEFAULT(UseCRC32Intrinsics)) |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
578 warning("CRC32 Intrinsics requires CLMUL instructions (not available on this CPU)"); |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
579 FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
580 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
7638
diff
changeset
|
581 |
6894 | 582 // The AES intrinsic stubs require AES instruction support (of course) |
7427 | 583 // but also require sse3 mode for instructions it use. |
584 if (UseAES && (UseSSE > 2)) { | |
6894 | 585 if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { |
586 UseAESIntrinsics = true; | |
587 } | |
588 } else if (UseAESIntrinsics) { | |
589 if (!FLAG_IS_DEFAULT(UseAESIntrinsics)) | |
17780 | 590 warning("AES intrinsics are not available on this CPU"); |
6894 | 591 FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
592 } | |
593 | |
20313
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
594 if (UseSHA) { |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
595 warning("SHA instructions are not available on this CPU"); |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
596 FLAG_SET_DEFAULT(UseSHA, false); |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
597 } |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
598 if (UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics) { |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
599 warning("SHA intrinsics are not available on this CPU"); |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
600 FLAG_SET_DEFAULT(UseSHA1Intrinsics, false); |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
601 FLAG_SET_DEFAULT(UseSHA256Intrinsics, false); |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
602 FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
603 } |
b20a35eae442
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
20311
diff
changeset
|
604 |
17780 | 605 // Adjust RTM (Restricted Transactional Memory) flags |
606 if (!supports_rtm() && UseRTMLocking) { | |
607 // Can't continue because UseRTMLocking affects UseBiasedLocking flag | |
608 // setting during arguments processing. See use_biased_locking(). | |
609 // VM_Version_init() is executed after UseBiasedLocking is used | |
610 // in Thread::allocate(). | |
611 vm_exit_during_initialization("RTM instructions are not available on this CPU"); | |
612 } | |
613 | |
614 #if INCLUDE_RTM_OPT | |
615 if (UseRTMLocking) { | |
20374
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
616 if (is_intel_family_core()) { |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
617 if ((_model == CPU_MODEL_HASWELL_E3) || |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
618 (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) || |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
619 (_model == CPU_MODEL_BROADWELL && _stepping < 4)) { |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
620 if (!UnlockExperimentalVMOptions) { |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
621 vm_exit_during_initialization("UseRTMLocking is only available as experimental option on this platform. It must be enabled via -XX:+UnlockExperimentalVMOptions flag."); |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
622 } else { |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
623 warning("UseRTMLocking is only available as experimental option on this platform."); |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
624 } |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
625 } |
999824269b71
8055069: TSX and RTM should be deprecated more strongly until hardware is corrected
kvn
parents:
20313
diff
changeset
|
626 } |
17780 | 627 if (!FLAG_IS_CMDLINE(UseRTMLocking)) { |
628 // RTM locking should be used only for applications with | |
629 // high lock contention. For now we do not use it by default. | |
630 vm_exit_during_initialization("UseRTMLocking flag should be only set on command line"); | |
631 } | |
632 if (!is_power_of_2(RTMTotalCountIncrRate)) { | |
633 warning("RTMTotalCountIncrRate must be a power of 2, resetting it to 64"); | |
634 FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64); | |
635 } | |
636 if (RTMAbortRatio < 0 || RTMAbortRatio > 100) { | |
637 warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50"); | |
638 FLAG_SET_DEFAULT(RTMAbortRatio, 50); | |
639 } | |
640 } else { // !UseRTMLocking | |
641 if (UseRTMForStackLocks) { | |
642 if (!FLAG_IS_DEFAULT(UseRTMForStackLocks)) { | |
643 warning("UseRTMForStackLocks flag should be off when UseRTMLocking flag is off"); | |
644 } | |
645 FLAG_SET_DEFAULT(UseRTMForStackLocks, false); | |
646 } | |
647 if (UseRTMDeopt) { | |
648 FLAG_SET_DEFAULT(UseRTMDeopt, false); | |
649 } | |
650 if (PrintPreciseRTMLockingStatistics) { | |
651 FLAG_SET_DEFAULT(PrintPreciseRTMLockingStatistics, false); | |
652 } | |
653 } | |
654 #else | |
655 if (UseRTMLocking) { | |
656 // Only C2 does RTM locking optimization. | |
657 // Can't continue because UseRTMLocking affects UseBiasedLocking flag | |
658 // setting during arguments processing. See use_biased_locking(). | |
659 vm_exit_during_initialization("RTM locking optimization is not supported in this VM"); | |
660 } | |
661 #endif | |
662 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
663 #ifdef COMPILER2 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
664 if (UseFPUForSpilling) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
665 if (UseSSE < 2) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
666 // Only supported with SSE2+ |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
667 FLAG_SET_DEFAULT(UseFPUForSpilling, false); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
668 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
669 } |
21074
2e35a4ea22ac
Add MaxVectorSize to Graal globals
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
670 #endif |
2e35a4ea22ac
Add MaxVectorSize to Graal globals
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
671 #if defined(COMPILER2) || defined(GRAAL) |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
672 if (MaxVectorSize > 0) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
673 if (!is_power_of_2(MaxVectorSize)) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
674 warning("MaxVectorSize must be a power of 2"); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
675 FLAG_SET_DEFAULT(MaxVectorSize, 32); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
676 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
677 if (MaxVectorSize > 32) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
678 FLAG_SET_DEFAULT(MaxVectorSize, 32); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
679 } |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
680 if (MaxVectorSize > 16 && (UseAVX == 0 || !os_supports_avx_vectors())) { |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
681 // 32 bytes vectors (in YMM) are only supported with AVX+ |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
682 FLAG_SET_DEFAULT(MaxVectorSize, 16); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
683 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
684 if (UseSSE < 2) { |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
685 // Vectors (in XMM) are only supported with SSE2+ |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
686 FLAG_SET_DEFAULT(MaxVectorSize, 0); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
687 } |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
688 #ifdef ASSERT |
21074
2e35a4ea22ac
Add MaxVectorSize to Graal globals
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
689 if (supports_avx() && PrintMiscellaneous && Verbose) { |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
690 tty->print_cr("State of YMM registers after signal handle:"); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
691 int nreg = 2 LP64_ONLY(+2); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
692 const char* ymm_name[4] = {"0", "7", "8", "15"}; |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
693 for (int i = 0; i < nreg; i++) { |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
694 tty->print("YMM%s:", ymm_name[i]); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
695 for (int j = 7; j >=0; j--) { |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
696 tty->print(" %x", _cpuid_info.ymm_save[i*8 + j]); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
697 } |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
698 tty->cr(); |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
699 } |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
700 } |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
701 #endif |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
702 } |
21074
2e35a4ea22ac
Add MaxVectorSize to Graal globals
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
703 #endif |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
704 |
21074
2e35a4ea22ac
Add MaxVectorSize to Graal globals
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
705 #ifdef COMPILER2 |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
706 #ifdef _LP64 |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
707 if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
708 UseMultiplyToLenIntrinsic = true; |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
709 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
710 #else |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
711 if (UseMultiplyToLenIntrinsic) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
712 if (!FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
713 warning("multiplyToLen intrinsic is not available in 32-bit VM"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
714 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
715 FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, false); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
716 } |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
717 #endif |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
718 #endif // COMPILER2 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
719 |
585 | 720 // On new cpus instructions which update whole XMM register should be used |
721 // to prevent partial register stall due to dependencies on high half. | |
722 // | |
723 // UseXmmLoadAndClearUpper == true --> movsd(xmm, mem) | |
724 // UseXmmLoadAndClearUpper == false --> movlpd(xmm, mem) | |
725 // UseXmmRegToRegMoveAll == true --> movaps(xmm, xmm), movapd(xmm, xmm). | |
726 // UseXmmRegToRegMoveAll == false --> movss(xmm, xmm), movsd(xmm, xmm). | |
727 | |
728 if( is_amd() ) { // AMD cpus specific settings | |
729 if( supports_sse2() && FLAG_IS_DEFAULT(UseAddressNop) ) { | |
730 // Use it on new AMD cpus starting from Opteron. | |
731 UseAddressNop = true; | |
732 } | |
733 if( supports_sse2() && FLAG_IS_DEFAULT(UseNewLongLShift) ) { | |
734 // Use it on new AMD cpus starting from Opteron. | |
735 UseNewLongLShift = true; | |
736 } | |
737 if( FLAG_IS_DEFAULT(UseXmmLoadAndClearUpper) ) { | |
738 if( supports_sse4a() ) { | |
739 UseXmmLoadAndClearUpper = true; // use movsd only on '10h' Opteron | |
740 } else { | |
741 UseXmmLoadAndClearUpper = false; | |
742 } | |
743 } | |
744 if( FLAG_IS_DEFAULT(UseXmmRegToRegMoveAll) ) { | |
745 if( supports_sse4a() ) { | |
746 UseXmmRegToRegMoveAll = true; // use movaps, movapd only on '10h' | |
747 } else { | |
748 UseXmmRegToRegMoveAll = false; | |
749 } | |
750 } | |
751 if( FLAG_IS_DEFAULT(UseXmmI2F) ) { | |
752 if( supports_sse4a() ) { | |
753 UseXmmI2F = true; | |
754 } else { | |
755 UseXmmI2F = false; | |
756 } | |
757 } | |
758 if( FLAG_IS_DEFAULT(UseXmmI2D) ) { | |
759 if( supports_sse4a() ) { | |
760 UseXmmI2D = true; | |
761 } else { | |
762 UseXmmI2D = false; | |
763 } | |
764 } | |
2406 | 765 if( FLAG_IS_DEFAULT(UseSSE42Intrinsics) ) { |
766 if( supports_sse4_2() && UseSSE >= 4 ) { | |
767 UseSSE42Intrinsics = true; | |
768 } | |
769 } | |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
681
diff
changeset
|
770 |
3276
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
771 // some defaults for AMD family 15h |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
772 if ( cpu_family() == 0x15 ) { |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
773 // On family 15h processors default is no sw prefetch |
2358 | 774 if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { |
775 AllocatePrefetchStyle = 0; | |
776 } | |
3276
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
777 // Also, if some other prefetch style is specified, default instruction type is PREFETCHW |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
778 if (FLAG_IS_DEFAULT(AllocatePrefetchInstr)) { |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
779 AllocatePrefetchInstr = 3; |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
780 } |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
781 // On family 15h processors use XMM and UnalignedLoadStores for Array Copy |
6794 | 782 if (supports_sse2() && FLAG_IS_DEFAULT(UseXMMForArrayCopy)) { |
3276
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
783 UseXMMForArrayCopy = true; |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
784 } |
6794 | 785 if (supports_sse2() && FLAG_IS_DEFAULT(UseUnalignedLoadStores)) { |
3276
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
786 UseUnalignedLoadStores = true; |
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
787 } |
2358 | 788 } |
3276
2a34a4fbc52c
7037812: few more defaults changes for new AMD processors
kvn
parents:
2479
diff
changeset
|
789 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
790 #ifdef COMPILER2 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
791 if (MaxVectorSize > 16) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
792 // Limit vectors size to 16 bytes on current AMD cpus. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
793 FLAG_SET_DEFAULT(MaxVectorSize, 16); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
794 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
4961
diff
changeset
|
795 #endif // COMPILER2 |
585 | 796 } |
797 | |
798 if( is_intel() ) { // Intel cpus specific settings | |
799 if( FLAG_IS_DEFAULT(UseStoreImmI16) ) { | |
800 UseStoreImmI16 = false; // don't use it on Intel cpus | |
801 } | |
802 if( cpu_family() == 6 || cpu_family() == 15 ) { | |
803 if( FLAG_IS_DEFAULT(UseAddressNop) ) { | |
804 // Use it on all Intel cpus starting from PentiumPro | |
805 UseAddressNop = true; | |
806 } | |
807 } | |
808 if( FLAG_IS_DEFAULT(UseXmmLoadAndClearUpper) ) { | |
809 UseXmmLoadAndClearUpper = true; // use movsd on all Intel cpus | |
810 } | |
811 if( FLAG_IS_DEFAULT(UseXmmRegToRegMoveAll) ) { | |
812 if( supports_sse3() ) { | |
813 UseXmmRegToRegMoveAll = true; // use movaps, movapd on new Intel cpus | |
814 } else { | |
815 UseXmmRegToRegMoveAll = false; | |
816 } | |
817 } | |
818 if( cpu_family() == 6 && supports_sse3() ) { // New Intel cpus | |
819 #ifdef COMPILER2 | |
820 if( FLAG_IS_DEFAULT(MaxLoopPad) ) { | |
821 // For new Intel cpus do the next optimization: | |
822 // don't align the beginning of a loop if there are enough instructions | |
823 // left (NumberOfLoopInstrToAlign defined in c2_globals.hpp) | |
824 // in current fetch line (OptoLoopAlignment) or the padding | |
825 // is big (> MaxLoopPad). | |
826 // Set MaxLoopPad to 11 for new Intel cpus to reduce number of | |
827 // generated NOP instructions. 11 is the largest size of one | |
828 // address NOP instruction '0F 1F' (see Assembler::nop(i)). | |
829 MaxLoopPad = 11; | |
830 } | |
831 #endif // COMPILER2 | |
6794 | 832 if (FLAG_IS_DEFAULT(UseXMMForArrayCopy)) { |
585 | 833 UseXMMForArrayCopy = true; // use SSE2 movq on new Intel cpus |
834 } | |
6794 | 835 if (supports_sse4_2() && supports_ht()) { // Newest Intel cpus |
836 if (FLAG_IS_DEFAULT(UseUnalignedLoadStores)) { | |
585 | 837 UseUnalignedLoadStores = true; // use movdqu on newest Intel cpus |
838 } | |
839 } | |
6794 | 840 if (supports_sse4_2() && UseSSE >= 4) { |
841 if (FLAG_IS_DEFAULT(UseSSE42Intrinsics)) { | |
681 | 842 UseSSE42Intrinsics = true; |
843 } | |
844 } | |
585 | 845 } |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
846 if ((cpu_family() == 0x06) && |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
847 ((extended_cpu_model() == 0x36) || // Centerton |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
848 (extended_cpu_model() == 0x37) || // Silvermont |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
849 (extended_cpu_model() == 0x4D))) { |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
850 #ifdef COMPILER2 |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
851 if (FLAG_IS_DEFAULT(OptoScheduling)) { |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
852 OptoScheduling = true; |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
853 } |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
854 #endif |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
855 if (supports_sse4_2()) { // Silvermont |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
856 if (FLAG_IS_DEFAULT(UseUnalignedLoadStores)) { |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
857 UseUnalignedLoadStores = true; // use movdqu on newest Intel cpus |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
858 } |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
859 } |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
860 } |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
861 if(FLAG_IS_DEFAULT(AllocatePrefetchInstr) && supports_3dnow_prefetch()) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
862 AllocatePrefetchInstr = 3; |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
863 } |
585 | 864 } |
865 | |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
866 // Use count leading zeros count instruction if available. |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
867 if (supports_lzcnt()) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
868 if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
869 UseCountLeadingZerosInstruction = true; |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
870 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
871 } else if (UseCountLeadingZerosInstruction) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
872 warning("lzcnt instruction is not available on this CPU"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
873 FLAG_SET_DEFAULT(UseCountLeadingZerosInstruction, false); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
874 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
875 |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
876 // Use count trailing zeros instruction if available |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
877 if (supports_bmi1()) { |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
878 // tzcnt does not require VEX prefix |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
879 if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) { |
20555
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
880 if (!UseBMI1Instructions && !FLAG_IS_DEFAULT(UseBMI1Instructions)) { |
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
881 // Don't use tzcnt if BMI1 is switched off on command line. |
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
882 UseCountTrailingZerosInstruction = false; |
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
883 } else { |
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
884 UseCountTrailingZerosInstruction = true; |
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
885 } |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
886 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
887 } else if (UseCountTrailingZerosInstruction) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
888 warning("tzcnt instruction is not available on this CPU"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
889 FLAG_SET_DEFAULT(UseCountTrailingZerosInstruction, false); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
890 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
891 |
20555
e48395e6a91b
8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
kvn
parents:
20438
diff
changeset
|
892 // BMI instructions (except tzcnt) use an encoding with VEX prefix. |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
893 // VEX prefix is generated only when AVX > 0. |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
894 if (supports_bmi1() && supports_avx()) { |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
895 if (FLAG_IS_DEFAULT(UseBMI1Instructions)) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
896 UseBMI1Instructions = true; |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
897 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
898 } else if (UseBMI1Instructions) { |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
899 warning("BMI1 instructions are not available on this CPU (AVX is also required)"); |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
900 FLAG_SET_DEFAULT(UseBMI1Instructions, false); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
901 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
902 |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
903 if (supports_bmi2() && supports_avx()) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
904 if (FLAG_IS_DEFAULT(UseBMI2Instructions)) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
905 UseBMI2Instructions = true; |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
906 } |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
907 } else if (UseBMI2Instructions) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
908 warning("BMI2 instructions are not available on this CPU (AVX is also required)"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20374
diff
changeset
|
909 FLAG_SET_DEFAULT(UseBMI2Instructions, false); |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
910 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
11080
diff
changeset
|
911 |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
912 // Use population count instruction if available. |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
913 if (supports_popcnt()) { |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
914 if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
915 UsePopCountInstruction = true; |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
916 } |
4759 | 917 } else if (UsePopCountInstruction) { |
918 warning("POPCNT instruction is not available on this CPU"); | |
919 FLAG_SET_DEFAULT(UsePopCountInstruction, false); | |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
920 } |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
585
diff
changeset
|
921 |
7474
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
922 // Use fast-string operations if available. |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
923 if (supports_erms()) { |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
924 if (FLAG_IS_DEFAULT(UseFastStosb)) { |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
925 UseFastStosb = true; |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
926 } |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
927 } else if (UseFastStosb) { |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
928 warning("fast-string operations are not available on this CPU"); |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
929 FLAG_SET_DEFAULT(UseFastStosb, false); |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
930 } |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7427
diff
changeset
|
931 |
6794 | 932 #ifdef COMPILER2 |
933 if (FLAG_IS_DEFAULT(AlignVector)) { | |
934 // Modern processors allow misaligned memory operations for vectors. | |
935 AlignVector = !UseUnalignedLoadStores; | |
936 } | |
937 #endif // COMPILER2 | |
938 | |
585 | 939 assert(0 <= ReadPrefetchInstr && ReadPrefetchInstr <= 3, "invalid value"); |
940 assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 3, "invalid value"); | |
941 | |
942 // set valid Prefetch instruction | |
943 if( ReadPrefetchInstr < 0 ) ReadPrefetchInstr = 0; | |
944 if( ReadPrefetchInstr > 3 ) ReadPrefetchInstr = 3; | |
2479 | 945 if( ReadPrefetchInstr == 3 && !supports_3dnow_prefetch() ) ReadPrefetchInstr = 0; |
946 if( !supports_sse() && supports_3dnow_prefetch() ) ReadPrefetchInstr = 3; | |
585 | 947 |
948 if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0; | |
949 if( AllocatePrefetchInstr > 3 ) AllocatePrefetchInstr = 3; | |
2479 | 950 if( AllocatePrefetchInstr == 3 && !supports_3dnow_prefetch() ) AllocatePrefetchInstr=0; |
951 if( !supports_sse() && supports_3dnow_prefetch() ) AllocatePrefetchInstr = 3; | |
585 | 952 |
953 // Allocation prefetch settings | |
3854 | 954 intx cache_line_size = prefetch_data_size(); |
585 | 955 if( cache_line_size > AllocatePrefetchStepSize ) |
956 AllocatePrefetchStepSize = cache_line_size; | |
3854 | 957 |
585 | 958 assert(AllocatePrefetchLines > 0, "invalid value"); |
3854 | 959 if( AllocatePrefetchLines < 1 ) // set valid value in product VM |
960 AllocatePrefetchLines = 3; | |
961 assert(AllocateInstancePrefetchLines > 0, "invalid value"); | |
962 if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM | |
963 AllocateInstancePrefetchLines = 1; | |
585 | 964 |
965 AllocatePrefetchDistance = allocate_prefetch_distance(); | |
966 AllocatePrefetchStyle = allocate_prefetch_style(); | |
967 | |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
968 if (is_intel() && cpu_family() == 6 && supports_sse3()) { |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
969 if (AllocatePrefetchStyle == 2) { // watermark prefetching on Core |
585 | 970 #ifdef _LP64 |
1622 | 971 AllocatePrefetchDistance = 384; |
585 | 972 #else |
1622 | 973 AllocatePrefetchDistance = 320; |
585 | 974 #endif |
1622 | 975 } |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
976 if (supports_sse4_2() && supports_ht()) { // Nehalem based cpus |
1622 | 977 AllocatePrefetchDistance = 192; |
978 AllocatePrefetchLines = 4; | |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
979 } |
1730
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1622
diff
changeset
|
980 #ifdef COMPILER2 |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
981 if (supports_sse4_2()) { |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
982 if (FLAG_IS_DEFAULT(UseFPUForSpilling)) { |
1730
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1622
diff
changeset
|
983 FLAG_SET_DEFAULT(UseFPUForSpilling, true); |
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1622
diff
changeset
|
984 } |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
985 } |
1730
f55c4f82ab9d
6978249: spill between cpu and fpu registers when those moves are fast
never
parents:
1622
diff
changeset
|
986 #endif |
585 | 987 } |
988 assert(AllocatePrefetchDistance % AllocatePrefetchStepSize == 0, "invalid value"); | |
989 | |
990 #ifdef _LP64 | |
991 // Prefetch settings | |
992 PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); | |
993 PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes(); | |
994 PrefetchFieldsAhead = prefetch_fields_ahead(); | |
995 #endif | |
996 | |
7587 | 997 if (FLAG_IS_DEFAULT(ContendedPaddingWidth) && |
998 (cache_line_size > ContendedPaddingWidth)) | |
999 ContendedPaddingWidth = cache_line_size; | |
1000 | |
585 | 1001 #ifndef PRODUCT |
1002 if (PrintMiscellaneous && Verbose) { | |
1003 tty->print_cr("Logical CPUs per core: %u", | |
1004 logical_processors_per_package()); | |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1005 tty->print("UseSSE=%d", (int) UseSSE); |
4759 | 1006 if (UseAVX > 0) { |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1007 tty->print(" UseAVX=%d", (int) UseAVX); |
4759 | 1008 } |
6894 | 1009 if (UseAES) { |
1010 tty->print(" UseAES=1"); | |
1011 } | |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
1012 #ifdef COMPILER2 |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
1013 if (MaxVectorSize > 0) { |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1014 tty->print(" MaxVectorSize=%d", (int) MaxVectorSize); |
17739
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
1015 } |
98af1e198e73
8037226: compiler/7196199/Test7196199.java fails on 32-bit linux with MaxVectorSize > 16
kvn
parents:
14693
diff
changeset
|
1016 #endif |
4759 | 1017 tty->cr(); |
3854 | 1018 tty->print("Allocation"); |
2479 | 1019 if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow_prefetch()) { |
3854 | 1020 tty->print_cr(": no prefetching"); |
585 | 1021 } else { |
3854 | 1022 tty->print(" prefetching: "); |
2479 | 1023 if (UseSSE == 0 && supports_3dnow_prefetch()) { |
585 | 1024 tty->print("PREFETCHW"); |
1025 } else if (UseSSE >= 1) { | |
1026 if (AllocatePrefetchInstr == 0) { | |
1027 tty->print("PREFETCHNTA"); | |
1028 } else if (AllocatePrefetchInstr == 1) { | |
1029 tty->print("PREFETCHT0"); | |
1030 } else if (AllocatePrefetchInstr == 2) { | |
1031 tty->print("PREFETCHT2"); | |
1032 } else if (AllocatePrefetchInstr == 3) { | |
1033 tty->print("PREFETCHW"); | |
1034 } | |
1035 } | |
1036 if (AllocatePrefetchLines > 1) { | |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1037 tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); |
585 | 1038 } else { |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1039 tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); |
585 | 1040 } |
1041 } | |
1042 | |
1043 if (PrefetchCopyIntervalInBytes > 0) { | |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1044 tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes); |
585 | 1045 } |
1046 if (PrefetchScanIntervalInBytes > 0) { | |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1047 tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes); |
585 | 1048 } |
1049 if (PrefetchFieldsAhead > 0) { | |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1050 tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead); |
585 | 1051 } |
7587 | 1052 if (ContendedPaddingWidth > 0) { |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
1053 tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth); |
7587 | 1054 } |
585 | 1055 } |
1056 #endif // !PRODUCT | |
1057 } | |
1058 | |
17780 | 1059 bool VM_Version::use_biased_locking() { |
1060 #if INCLUDE_RTM_OPT | |
1061 // RTM locking is most useful when there is high lock contention and | |
1062 // low data contention. With high lock contention the lock is usually | |
1063 // inflated and biased locking is not suitable for that case. | |
1064 // RTM locking code requires that biased locking is off. | |
1065 // Note: we can't switch off UseBiasedLocking in get_processor_features() | |
1066 // because it is used by Thread::allocate() which is called before | |
1067 // VM_Version::initialize(). | |
1068 if (UseRTMLocking && UseBiasedLocking) { | |
1069 if (FLAG_IS_DEFAULT(UseBiasedLocking)) { | |
1070 FLAG_SET_DEFAULT(UseBiasedLocking, false); | |
1071 } else { | |
1072 warning("Biased locking is not supported with RTM locking; ignoring UseBiasedLocking flag." ); | |
1073 UseBiasedLocking = false; | |
1074 } | |
1075 } | |
1076 #endif | |
1077 return UseBiasedLocking; | |
1078 } | |
1079 | |
585 | 1080 void VM_Version::initialize() { |
1081 ResourceMark rm; | |
1082 // Making this stub must be FIRST use of assembler | |
1083 | |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
1084 stub_blob = BufferBlob::create("get_cpu_info_stub", stub_size); |
585 | 1085 if (stub_blob == NULL) { |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
1086 vm_exit_during_initialization("Unable to allocate get_cpu_info_stub"); |
585 | 1087 } |
1748 | 1088 CodeBuffer c(stub_blob); |
585 | 1089 VM_Version_StubGenerator g(&c); |
17829
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
1090 get_cpu_info_stub = CAST_TO_FN_PTR(get_cpu_info_stub_t, |
0118c8c7b80f
8038633: crash in VM_Version::get_processor_features() on startup
kvn
parents:
17780
diff
changeset
|
1091 g.generate_get_cpu_info()); |
585 | 1092 |
1093 get_processor_features(); | |
1094 } |