author | zgu |
Thu, 07 Nov 2019 09:41:22 -0500 | |
changeset 58964 | 029d941c2e35 |
parent 57804 | 9b7b9f16dfd9 |
child 58679 | 9c3209ff7550 |
child 59122 | 5d73255c2d52 |
permissions | -rw-r--r-- |
29183 | 1 |
/* |
57804 | 2 |
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
3 |
* Copyright (c) 2015, 2019, Red Hat Inc. All rights reserved. |
|
29183 | 4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 |
* |
|
6 |
* This code is free software; you can redistribute it and/or modify it |
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
|
8 |
* published by the Free Software Foundation. |
|
9 |
* |
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
* accompanied this code). |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License version |
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
* |
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
21 |
* or visit www.oracle.com if you need additional information or have any |
|
22 |
* questions. |
|
23 |
* |
|
24 |
*/ |
|
25 |
||
26 |
#include "precompiled.hpp" |
|
27 |
#include "asm/macroAssembler.hpp" |
|
28 |
#include "asm/macroAssembler.inline.hpp" |
|
29 |
#include "memory/resourceArea.hpp" |
|
30 |
#include "runtime/java.hpp" |
|
57804 | 31 |
#include "runtime/os.hpp" |
29183 | 32 |
#include "runtime/stubCodeGenerator.hpp" |
40010 | 33 |
#include "utilities/macros.hpp" |
29183 | 34 |
#include "vm_version_aarch64.hpp" |
40010 | 35 |
|
36 |
#include OS_HEADER_INLINE(os) |
|
29183 | 37 |
|
38 |
#include <sys/auxv.h> |
|
39 |
#include <asm/hwcap.h> |
|
40 |
||
41 |
#ifndef HWCAP_AES |
|
42 |
#define HWCAP_AES (1<<3) |
|
43 |
#endif |
|
44 |
||
31961
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
45 |
#ifndef HWCAP_PMULL |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
46 |
#define HWCAP_PMULL (1<<4) |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
47 |
#endif |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
48 |
|
29183 | 49 |
#ifndef HWCAP_SHA1 |
50 |
#define HWCAP_SHA1 (1<<5) |
|
51 |
#endif |
|
52 |
||
53 |
#ifndef HWCAP_SHA2 |
|
54 |
#define HWCAP_SHA2 (1<<6) |
|
55 |
#endif |
|
56 |
||
57 |
#ifndef HWCAP_CRC32 |
|
58 |
#define HWCAP_CRC32 (1<<7) |
|
59 |
#endif |
|
60 |
||
36562
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
61 |
#ifndef HWCAP_ATOMICS |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
62 |
#define HWCAP_ATOMICS (1<<8) |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
63 |
#endif |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
64 |
|
29183 | 65 |
int VM_Version::_cpu; |
66 |
int VM_Version::_model; |
|
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
67 |
int VM_Version::_model2; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
68 |
int VM_Version::_variant; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
69 |
int VM_Version::_revision; |
29183 | 70 |
int VM_Version::_stepping; |
57804 | 71 |
bool VM_Version::_dcpop; |
38143 | 72 |
VM_Version::PsrInfo VM_Version::_psr_info = { 0, }; |
29183 | 73 |
|
74 |
static BufferBlob* stub_blob; |
|
75 |
static const int stub_size = 550; |
|
76 |
||
77 |
extern "C" { |
|
78 |
typedef void (*getPsrInfo_stub_t)(void*); |
|
79 |
} |
|
80 |
static getPsrInfo_stub_t getPsrInfo_stub = NULL; |
|
81 |
||
82 |
||
83 |
class VM_Version_StubGenerator: public StubCodeGenerator { |
|
84 |
public: |
|
85 |
||
86 |
VM_Version_StubGenerator(CodeBuffer *c) : StubCodeGenerator(c) {} |
|
87 |
||
88 |
address generate_getPsrInfo() { |
|
89 |
StubCodeMark mark(this, "VM_Version", "getPsrInfo_stub"); |
|
90 |
# define __ _masm-> |
|
91 |
address start = __ pc(); |
|
92 |
||
38143 | 93 |
// void getPsrInfo(VM_Version::PsrInfo* psr_info); |
29183 | 94 |
|
95 |
address entry = __ pc(); |
|
96 |
||
38143 | 97 |
__ enter(); |
29183 | 98 |
|
38143 | 99 |
__ get_dczid_el0(rscratch1); |
100 |
__ strw(rscratch1, Address(c_rarg0, in_bytes(VM_Version::dczid_el0_offset()))); |
|
101 |
||
38714
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
102 |
__ get_ctr_el0(rscratch1); |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
103 |
__ strw(rscratch1, Address(c_rarg0, in_bytes(VM_Version::ctr_el0_offset()))); |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
104 |
|
38143 | 105 |
__ leave(); |
29183 | 106 |
__ ret(lr); |
107 |
||
108 |
# undef __ |
|
109 |
||
110 |
return start; |
|
111 |
} |
|
112 |
}; |
|
113 |
||
114 |
||
115 |
void VM_Version::get_processor_features() { |
|
116 |
_supports_cx8 = true; |
|
117 |
_supports_atomic_getset4 = true; |
|
118 |
_supports_atomic_getadd4 = true; |
|
119 |
_supports_atomic_getset8 = true; |
|
120 |
_supports_atomic_getadd8 = true; |
|
121 |
||
38143 | 122 |
getPsrInfo_stub(&_psr_info); |
123 |
||
38714
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
124 |
int dcache_line = VM_Version::dcache_line_size(); |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
125 |
|
55058
30094911fffd
8224880: AArch64: java/javac error with AllocatePrefetchDistance
aph
parents:
54117
diff
changeset
|
126 |
// Limit AllocatePrefetchDistance so that it does not exceed the |
30094911fffd
8224880: AArch64: java/javac error with AllocatePrefetchDistance
aph
parents:
54117
diff
changeset
|
127 |
// constraint in AllocatePrefetchDistanceConstraintFunc. |
29183 | 128 |
if (FLAG_IS_DEFAULT(AllocatePrefetchDistance)) |
55058
30094911fffd
8224880: AArch64: java/javac error with AllocatePrefetchDistance
aph
parents:
54117
diff
changeset
|
129 |
FLAG_SET_DEFAULT(AllocatePrefetchDistance, MIN2(512, 3*dcache_line)); |
30094911fffd
8224880: AArch64: java/javac error with AllocatePrefetchDistance
aph
parents:
54117
diff
changeset
|
130 |
|
29183 | 131 |
if (FLAG_IS_DEFAULT(AllocatePrefetchStepSize)) |
38714
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
132 |
FLAG_SET_DEFAULT(AllocatePrefetchStepSize, dcache_line); |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
133 |
if (FLAG_IS_DEFAULT(PrefetchScanIntervalInBytes)) |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
134 |
FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 3*dcache_line); |
35841
39f8dc1df42b
8149365: aarch64: memory copy does not prefetch on backwards copy
enevill
parents:
35581
diff
changeset
|
135 |
if (FLAG_IS_DEFAULT(PrefetchCopyIntervalInBytes)) |
38714
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
136 |
FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 3*dcache_line); |
46814 | 137 |
if (FLAG_IS_DEFAULT(SoftwarePrefetchHintDistance)) |
138 |
FLAG_SET_DEFAULT(SoftwarePrefetchHintDistance, 3*dcache_line); |
|
38714
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
139 |
|
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
140 |
if (PrefetchCopyIntervalInBytes != -1 && |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
141 |
((PrefetchCopyIntervalInBytes & 7) || (PrefetchCopyIntervalInBytes >= 32768))) { |
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
142 |
warning("PrefetchCopyIntervalInBytes must be -1, or a multiple of 8 and < 32768"); |
35841
39f8dc1df42b
8149365: aarch64: memory copy does not prefetch on backwards copy
enevill
parents:
35581
diff
changeset
|
143 |
PrefetchCopyIntervalInBytes &= ~7; |
39f8dc1df42b
8149365: aarch64: memory copy does not prefetch on backwards copy
enevill
parents:
35581
diff
changeset
|
144 |
if (PrefetchCopyIntervalInBytes >= 32768) |
39f8dc1df42b
8149365: aarch64: memory copy does not prefetch on backwards copy
enevill
parents:
35581
diff
changeset
|
145 |
PrefetchCopyIntervalInBytes = 32760; |
39f8dc1df42b
8149365: aarch64: memory copy does not prefetch on backwards copy
enevill
parents:
35581
diff
changeset
|
146 |
} |
29183 | 147 |
|
48052
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
148 |
if (AllocatePrefetchDistance !=-1 && (AllocatePrefetchDistance & 7)) { |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
149 |
warning("AllocatePrefetchDistance must be multiple of 8"); |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
150 |
AllocatePrefetchDistance &= ~7; |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
151 |
} |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
152 |
|
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
153 |
if (AllocatePrefetchStepSize & 7) { |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
154 |
warning("AllocatePrefetchStepSize must be multiple of 8"); |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
155 |
AllocatePrefetchStepSize &= ~7; |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
156 |
} |
8fe17f886663
8191955: AArch64: incorrect prefetch distance causes an internal error
njian
parents:
47571
diff
changeset
|
157 |
|
46814 | 158 |
if (SoftwarePrefetchHintDistance != -1 && |
159 |
(SoftwarePrefetchHintDistance & 7)) { |
|
160 |
warning("SoftwarePrefetchHintDistance must be -1, or a multiple of 8"); |
|
161 |
SoftwarePrefetchHintDistance &= ~7; |
|
162 |
} |
|
163 |
||
29183 | 164 |
unsigned long auxv = getauxval(AT_HWCAP); |
165 |
||
166 |
char buf[512]; |
|
167 |
||
35148 | 168 |
_features = auxv; |
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
169 |
|
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
170 |
int cpu_lines = 0; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
171 |
if (FILE *f = fopen("/proc/cpuinfo", "r")) { |
57804 | 172 |
// need a large buffer as the flags line may include lots of text |
173 |
char buf[1024], *p; |
|
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
174 |
while (fgets(buf, sizeof (buf), f) != NULL) { |
55398
e53ec3b362f4
8224851: AArch64: fix warnings and errors with Clang and GCC 8.3
ngasson
parents:
55058
diff
changeset
|
175 |
if ((p = strchr(buf, ':')) != NULL) { |
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
176 |
long v = strtol(p+1, NULL, 0); |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
177 |
if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) { |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
178 |
_cpu = v; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
179 |
cpu_lines++; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
180 |
} else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) { |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
181 |
_variant = v; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
182 |
} else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) { |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
183 |
if (_model != v) _model2 = _model; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
184 |
_model = v; |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
185 |
} else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) { |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
186 |
_revision = v; |
57804 | 187 |
} else if (strncmp(buf, "flags", sizeof("flags") - 1) == 0) { |
188 |
if (strstr(p+1, "dcpop")) { |
|
189 |
_dcpop = true; |
|
190 |
} |
|
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
191 |
} |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
192 |
} |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
193 |
} |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
194 |
fclose(f); |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
195 |
} |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
196 |
|
57804 | 197 |
if (os::supports_map_sync()) { |
198 |
// if dcpop is available publish data cache line flush size via |
|
199 |
// generic field, otherwise let if default to zero thereby |
|
200 |
// disabling writeback |
|
201 |
if (_dcpop) { |
|
202 |
_data_cache_line_flush_size = dcache_line; |
|
203 |
} |
|
204 |
} |
|
205 |
||
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
206 |
// Enable vendor specific features |
49173
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
207 |
|
54117
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
208 |
// Ampere eMAG |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
209 |
if (_cpu == CPU_AMCC && (_model == 0) && (_variant == 0x3)) { |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
210 |
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
211 |
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
212 |
} |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
213 |
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) { |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
214 |
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true); |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
215 |
} |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
216 |
if (FLAG_IS_DEFAULT(UseSIMDForArrayEquals)) { |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
217 |
FLAG_SET_DEFAULT(UseSIMDForArrayEquals, !(_revision == 1 || _revision == 2)); |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
218 |
} |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
219 |
} |
a6221f993616
8220566: AArch64: Set default vm features for Ampere eMAG CPUs
pzhang
parents:
53989
diff
changeset
|
220 |
|
49173
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
221 |
// ThunderX |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
222 |
if (_cpu == CPU_CAVIUM && (_model == 0xA1)) { |
40023
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
223 |
if (_variant == 0) _features |= CPU_DMB_ATOMICS; |
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
224 |
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { |
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
225 |
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); |
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
226 |
} |
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
227 |
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) { |
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
228 |
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, (_variant > 0)); |
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
229 |
} |
49724
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
230 |
if (FLAG_IS_DEFAULT(UseSIMDForArrayEquals)) { |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
231 |
FLAG_SET_DEFAULT(UseSIMDForArrayEquals, false); |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
232 |
} |
40023
49d647eeb7f0
8159063: aarch64: optimise unaligned array copy long
enevill
parents:
38714
diff
changeset
|
233 |
} |
49724
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
234 |
|
49173
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
235 |
// ThunderX2 |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
236 |
if ((_cpu == CPU_CAVIUM && (_model == 0xAF)) || |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
237 |
(_cpu == CPU_BROADCOM && (_model == 0x516))) { |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
238 |
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
239 |
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
240 |
} |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
241 |
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) { |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
242 |
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true); |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
243 |
} |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
244 |
} |
cf4562e8a3f9
8198293: AARCH64 - Add CPU detection code for Cavium Thunder X2
dchuyko
parents:
48196
diff
changeset
|
245 |
|
53989
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
246 |
// HiSilicon TSV110 |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
247 |
if (_cpu == CPU_HISILICON && _model == 0xd01) { |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
248 |
if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
249 |
FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
250 |
} |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
251 |
if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) { |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
252 |
FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true); |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
253 |
} |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
254 |
} |
247f1a85d736
8219888: aarch64: add CPU detection code for HiSilicon TSV110
fyang
parents:
53943
diff
changeset
|
255 |
|
49724
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
256 |
// Cortex A53 |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
257 |
if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) { |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
258 |
_features |= CPU_A53MAC; |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
259 |
if (FLAG_IS_DEFAULT(UseSIMDForArrayEquals)) { |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
260 |
FLAG_SET_DEFAULT(UseSIMDForArrayEquals, false); |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
261 |
} |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
262 |
} |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
263 |
|
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
264 |
// Cortex A73 |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
265 |
if (_cpu == CPU_ARM && (_model == 0xd09 || _model2 == 0xd09)) { |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
266 |
if (FLAG_IS_DEFAULT(SoftwarePrefetchHintDistance)) { |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
267 |
FLAG_SET_DEFAULT(SoftwarePrefetchHintDistance, -1); |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
268 |
} |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
269 |
// A73 is faster with short-and-easy-for-speculative-execution-loop |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
270 |
if (FLAG_IS_DEFAULT(UseSimpleArrayEquals)) { |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
271 |
FLAG_SET_DEFAULT(UseSimpleArrayEquals, true); |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
272 |
} |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
273 |
} |
bf7f42f2f025
8187472: AARCH64: array_equals intrinsic doesn't use prefetch for large arrays
dpochepk
parents:
49173
diff
changeset
|
274 |
|
38714
170464570e45
8157841: aarch64: prefetch ignores cache line size
enevill
parents:
38143
diff
changeset
|
275 |
if (_cpu == CPU_ARM && (_model == 0xd07 || _model2 == 0xd07)) _features |= CPU_STXR_PREFETCH; |
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
276 |
// If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07) |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
277 |
// we assume the worst and assume we could be on a big little system and have |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
278 |
// undisclosed A53 cores which we could be swapped to at any stage |
35148 | 279 |
if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _features |= CPU_A53MAC; |
30429
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
280 |
|
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
281 |
sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision); |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
282 |
if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2); |
c980154ed1a3
8079203: AARCH64: Need to cater for different partner implementations
enevill
parents:
30225
diff
changeset
|
283 |
if (auxv & HWCAP_ASIMD) strcat(buf, ", simd"); |
29183 | 284 |
if (auxv & HWCAP_CRC32) strcat(buf, ", crc"); |
285 |
if (auxv & HWCAP_AES) strcat(buf, ", aes"); |
|
286 |
if (auxv & HWCAP_SHA1) strcat(buf, ", sha1"); |
|
287 |
if (auxv & HWCAP_SHA2) strcat(buf, ", sha256"); |
|
36562
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
288 |
if (auxv & HWCAP_ATOMICS) strcat(buf, ", lse"); |
29183 | 289 |
|
35148 | 290 |
_features_string = os::strdup(buf); |
29183 | 291 |
|
292 |
if (FLAG_IS_DEFAULT(UseCRC32)) { |
|
293 |
UseCRC32 = (auxv & HWCAP_CRC32) != 0; |
|
294 |
} |
|
53943
72ce7dd54939
8219698: aarch64: SIGILL triggered when specifying unsupported hardware features
fyang
parents:
52425
diff
changeset
|
295 |
|
29183 | 296 |
if (UseCRC32 && (auxv & HWCAP_CRC32) == 0) { |
297 |
warning("UseCRC32 specified, but not supported on this CPU"); |
|
53943
72ce7dd54939
8219698: aarch64: SIGILL triggered when specifying unsupported hardware features
fyang
parents:
52425
diff
changeset
|
298 |
FLAG_SET_DEFAULT(UseCRC32, false); |
29183 | 299 |
} |
32581 | 300 |
|
33176
54393049bf1e
8139043: aarch64: add support for adler32 intrinsic
enevill
parents:
32581
diff
changeset
|
301 |
if (FLAG_IS_DEFAULT(UseAdler32Intrinsics)) { |
54393049bf1e
8139043: aarch64: add support for adler32 intrinsic
enevill
parents:
32581
diff
changeset
|
302 |
FLAG_SET_DEFAULT(UseAdler32Intrinsics, true); |
32581 | 303 |
} |
304 |
||
35110
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
33176
diff
changeset
|
305 |
if (UseVectorizedMismatchIntrinsic) { |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
33176
diff
changeset
|
306 |
warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
33176
diff
changeset
|
307 |
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
33176
diff
changeset
|
308 |
} |
f19bcdf40799
8143355: Update for addition of vectorizedMismatch intrinsic for x86
kvn
parents:
33176
diff
changeset
|
309 |
|
36562
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
310 |
if (auxv & HWCAP_ATOMICS) { |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
311 |
if (FLAG_IS_DEFAULT(UseLSE)) |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
312 |
FLAG_SET_DEFAULT(UseLSE, true); |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
313 |
} else { |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
314 |
if (UseLSE) { |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
315 |
warning("UseLSE specified, but not supported on this CPU"); |
53943
72ce7dd54939
8219698: aarch64: SIGILL triggered when specifying unsupported hardware features
fyang
parents:
52425
diff
changeset
|
316 |
FLAG_SET_DEFAULT(UseLSE, false); |
36562
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
317 |
} |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
318 |
} |
4d1e93624d6a
8150394: aarch64: add support for 8.1 LSE CAS instructions
enevill
parents:
35841
diff
changeset
|
319 |
|
29183 | 320 |
if (auxv & HWCAP_AES) { |
321 |
UseAES = UseAES || FLAG_IS_DEFAULT(UseAES); |
|
322 |
UseAESIntrinsics = |
|
323 |
UseAESIntrinsics || (UseAES && FLAG_IS_DEFAULT(UseAESIntrinsics)); |
|
324 |
if (UseAESIntrinsics && !UseAES) { |
|
325 |
warning("UseAESIntrinsics enabled, but UseAES not, enabling"); |
|
326 |
UseAES = true; |
|
327 |
} |
|
328 |
} else { |
|
329 |
if (UseAES) { |
|
330 |
warning("UseAES specified, but not supported on this CPU"); |
|
53943
72ce7dd54939
8219698: aarch64: SIGILL triggered when specifying unsupported hardware features
fyang
parents:
52425
diff
changeset
|
331 |
FLAG_SET_DEFAULT(UseAES, false); |
29183 | 332 |
} |
333 |
if (UseAESIntrinsics) { |
|
334 |
warning("UseAESIntrinsics specified, but not supported on this CPU"); |
|
53943
72ce7dd54939
8219698: aarch64: SIGILL triggered when specifying unsupported hardware features
fyang
parents:
52425
diff
changeset
|
335 |
FLAG_SET_DEFAULT(UseAESIntrinsics, false); |
29183 | 336 |
} |
337 |
} |
|
338 |
||
35154 | 339 |
if (UseAESCTRIntrinsics) { |
340 |
warning("AES/CTR intrinsics are not available on this CPU"); |
|
341 |
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); |
|
342 |
} |
|
343 |
||
29183 | 344 |
if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { |
345 |
UseCRC32Intrinsics = true; |
|
346 |
} |
|
347 |
||
31591
82134a118aea
8130687: aarch64: add support for hardware crc32c
enevill
parents:
31588
diff
changeset
|
348 |
if (auxv & HWCAP_CRC32) { |
82134a118aea
8130687: aarch64: add support for hardware crc32c
enevill
parents:
31588
diff
changeset
|
349 |
if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { |
82134a118aea
8130687: aarch64: add support for hardware crc32c
enevill
parents:
31588
diff
changeset
|
350 |
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, true); |
82134a118aea
8130687: aarch64: add support for hardware crc32c
enevill
parents:
31588
diff
changeset
|
351 |
} |
82134a118aea
8130687: aarch64: add support for hardware crc32c
enevill
parents:
31588
diff
changeset
|
352 |
} else if (UseCRC32CIntrinsics) { |
82134a118aea
8130687: aarch64: add support for hardware crc32c
enevill
parents:
31588
diff
changeset
|
353 |
warning("CRC32C is not available on the CPU"); |
31515 | 354 |
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false); |
355 |
} |
|
356 |
||
42653 | 357 |
if (FLAG_IS_DEFAULT(UseFMA)) { |
358 |
FLAG_SET_DEFAULT(UseFMA, true); |
|
41323 | 359 |
} |
360 |
||
29183 | 361 |
if (auxv & (HWCAP_SHA1 | HWCAP_SHA2)) { |
362 |
if (FLAG_IS_DEFAULT(UseSHA)) { |
|
363 |
FLAG_SET_DEFAULT(UseSHA, true); |
|
364 |
} |
|
365 |
} else if (UseSHA) { |
|
366 |
warning("SHA instructions are not available on this CPU"); |
|
367 |
FLAG_SET_DEFAULT(UseSHA, false); |
|
368 |
} |
|
369 |
||
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
370 |
if (UseSHA && (auxv & HWCAP_SHA1)) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
371 |
if (FLAG_IS_DEFAULT(UseSHA1Intrinsics)) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
372 |
FLAG_SET_DEFAULT(UseSHA1Intrinsics, true); |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
373 |
} |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
374 |
} else if (UseSHA1Intrinsics) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
375 |
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU."); |
29183 | 376 |
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false); |
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
377 |
} |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
378 |
|
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
379 |
if (UseSHA && (auxv & HWCAP_SHA2)) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
380 |
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
381 |
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true); |
29183 | 382 |
} |
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
383 |
} else if (UseSHA256Intrinsics) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
384 |
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU."); |
31960
4e66771a3e0a
8132010: aarch64: regression test fails compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java
enevill
parents:
31955
diff
changeset
|
385 |
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false); |
31588
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
386 |
} |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
387 |
|
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
388 |
if (UseSHA512Intrinsics) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
389 |
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU."); |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
390 |
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
391 |
} |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
392 |
|
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
393 |
if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics)) { |
2a864a4a414c
8130120: Handling of SHA intrinsics inconsistent across platforms
zmajo
parents:
31517
diff
changeset
|
394 |
FLAG_SET_DEFAULT(UseSHA, false); |
29183 | 395 |
} |
396 |
||
31961
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
397 |
if (auxv & HWCAP_PMULL) { |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
398 |
if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) { |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
399 |
FLAG_SET_DEFAULT(UseGHASHIntrinsics, true); |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
400 |
} |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
401 |
} else if (UseGHASHIntrinsics) { |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
402 |
warning("GHASH intrinsics are not available on this CPU"); |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
403 |
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
404 |
} |
70adcff5840c
8131062: aarch64: add support for GHASH acceleration
enevill
parents:
31960
diff
changeset
|
405 |
|
38143 | 406 |
if (is_zva_enabled()) { |
407 |
if (FLAG_IS_DEFAULT(UseBlockZeroing)) { |
|
408 |
FLAG_SET_DEFAULT(UseBlockZeroing, true); |
|
409 |
} |
|
410 |
if (FLAG_IS_DEFAULT(BlockZeroingLowLimit)) { |
|
411 |
FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * VM_Version::zva_length()); |
|
412 |
} |
|
413 |
} else if (UseBlockZeroing) { |
|
414 |
warning("DC ZVA is not available on this CPU"); |
|
415 |
FLAG_SET_DEFAULT(UseBlockZeroing, false); |
|
416 |
} |
|
417 |
||
30209
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
29183
diff
changeset
|
418 |
// This machine allows unaligned memory accesses |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
29183
diff
changeset
|
419 |
if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
29183
diff
changeset
|
420 |
FLAG_SET_DEFAULT(UseUnalignedAccesses, true); |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
29183
diff
changeset
|
421 |
} |
8ea30dc99369
8026049: (bf) Intrinsify ByteBuffer.put{Int, Double, Float, ...} methods
aph
parents:
29183
diff
changeset
|
422 |
|
51619
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
423 |
if (FLAG_IS_DEFAULT(UseBarriersForVolatile)) { |
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
424 |
UseBarriersForVolatile = (_features & CPU_DMB_ATOMICS) != 0; |
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
425 |
} |
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
426 |
|
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
427 |
if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { |
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
428 |
UsePopCountInstruction = true; |
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
429 |
} |
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
430 |
|
dca697c71e5d
8207247: AARCH64: Enable Minimal and Client VM builds
avoitylov
parents:
49724
diff
changeset
|
431 |
#ifdef COMPILER2 |
30225
e9722ea461d4
8077615: AARCH64: Add C2 intrinsic for BigInteger::multiplyToLen() method
aph
parents:
30209
diff
changeset
|
432 |
if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { |
e9722ea461d4
8077615: AARCH64: Add C2 intrinsic for BigInteger::multiplyToLen() method
aph
parents:
30209
diff
changeset
|
433 |
UseMultiplyToLenIntrinsic = true; |
e9722ea461d4
8077615: AARCH64: Add C2 intrinsic for BigInteger::multiplyToLen() method
aph
parents:
30209
diff
changeset
|
434 |
} |
e9722ea461d4
8077615: AARCH64: Add C2 intrinsic for BigInteger::multiplyToLen() method
aph
parents:
30209
diff
changeset
|
435 |
|
47571
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
436 |
if (FLAG_IS_DEFAULT(UseSquareToLenIntrinsic)) { |
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
437 |
UseSquareToLenIntrinsic = true; |
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
438 |
} |
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
439 |
|
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
440 |
if (FLAG_IS_DEFAULT(UseMulAddIntrinsic)) { |
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
441 |
UseMulAddIntrinsic = true; |
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
442 |
} |
c19054f06c14
8186915: AARCH64: Intrinsify squareToLen and mulAdd
dpochepk
parents:
47216
diff
changeset
|
443 |
|
31955 | 444 |
if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { |
445 |
UseMontgomeryMultiplyIntrinsic = true; |
|
446 |
} |
|
447 |
if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { |
|
448 |
UseMontgomerySquareIntrinsic = true; |
|
449 |
} |
|
450 |
||
29183 | 451 |
if (FLAG_IS_DEFAULT(OptoScheduling)) { |
452 |
OptoScheduling = true; |
|
453 |
} |
|
454 |
#endif |
|
455 |
} |
|
456 |
||
457 |
void VM_Version::initialize() { |
|
458 |
ResourceMark rm; |
|
459 |
||
460 |
stub_blob = BufferBlob::create("getPsrInfo_stub", stub_size); |
|
461 |
if (stub_blob == NULL) { |
|
462 |
vm_exit_during_initialization("Unable to allocate getPsrInfo_stub"); |
|
463 |
} |
|
464 |
||
465 |
CodeBuffer c(stub_blob); |
|
466 |
VM_Version_StubGenerator g(&c); |
|
467 |
getPsrInfo_stub = CAST_TO_FN_PTR(getPsrInfo_stub_t, |
|
468 |
g.generate_getPsrInfo()); |
|
469 |
||
470 |
get_processor_features(); |
|
48182
5fb0f3f24f6b
8191129: AARCH64: Invalid value passed to critical JNI function
dchuyko
parents:
47571
diff
changeset
|
471 |
|
5fb0f3f24f6b
8191129: AARCH64: Invalid value passed to critical JNI function
dchuyko
parents:
47571
diff
changeset
|
472 |
UNSUPPORTED_OPTION(CriticalJNINatives); |
29183 | 473 |
} |