26
#include "precompiled.hpp"
27
#include "asm/assembler.inline.hpp"
28
#include "memory/resourceArea.hpp"
29
#include "runtime/arguments.hpp"
30
#include "runtime/globals_extension.hpp"
31
#include "runtime/java.hpp"
32
#include "runtime/stubCodeGenerator.hpp"
33
#include "runtime/vm_version.hpp"
36
void VM_Version::initialize() {
38
if (! FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
39
warning("Unaligned memory access is not available on this CPU");
40
FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
43
if (! FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
44
warning("Prefetching is not available for a Zero VM");
46
FLAG_SET_DEFAULT(AllocatePrefetchDistance, 0);
49
if (DiagnoseSyncOnValueBasedClasses != 0) {
50
warning("Lock diagnostics is not available for a Zero VM");
51
FLAG_SET_DEFAULT(DiagnoseSyncOnValueBasedClasses, 0);
54
if (UseAESIntrinsics) {
55
warning("AES intrinsics are not available on this CPU");
56
FLAG_SET_DEFAULT(UseAESIntrinsics, false);
60
warning("AES instructions are not available on this CPU");
61
FLAG_SET_DEFAULT(UseAES, false);
64
if (UseAESCTRIntrinsics) {
65
warning("AES/CTR intrinsics are not available on this CPU");
66
FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
70
warning("FMA instructions are not available on this CPU");
71
FLAG_SET_DEFAULT(UseFMA, false);
74
if (UseMD5Intrinsics) {
75
warning("MD5 intrinsics are not available on this CPU");
76
FLAG_SET_DEFAULT(UseMD5Intrinsics, false);
80
warning("SHA instructions are not available on this CPU");
81
FLAG_SET_DEFAULT(UseSHA, false);
84
if (UseSHA1Intrinsics) {
85
warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU.");
86
FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
89
if (UseSHA256Intrinsics) {
90
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.");
91
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
94
if (UseSHA512Intrinsics) {
95
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
96
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
99
if (UseSHA3Intrinsics) {
100
warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
101
FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
104
if (UseCRC32Intrinsics) {
105
warning("CRC32 intrinsics are not available on this CPU");
106
FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
109
if (UseAdler32Intrinsics) {
110
warning("Adler32 intrinsics are not available on this CPU");
111
FLAG_SET_DEFAULT(UseAdler32Intrinsics, false);
114
if (UseVectorizedMismatchIntrinsic) {
115
warning("vectorizedMismatch intrinsic is not available on this CPU.");
116
FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
119
if ((LockingMode != LM_LEGACY) && (LockingMode != LM_MONITOR)) {
120
warning("Unsupported locking mode for this CPU.");
121
FLAG_SET_DEFAULT(LockingMode, LM_LEGACY);
125
#if defined(IA32) || defined(AMD64) || defined(ARM) || \
126
defined(AARCH64) || defined(PPC) || defined(RISCV) || \
128
if (FLAG_IS_DEFAULT(DecodeErrorContext)) {
129
FLAG_SET_DEFAULT(DecodeErrorContext, true);
132
UNSUPPORTED_OPTION(DecodeErrorContext);
136
UNSUPPORTED_OPTION(UseCompiler);
138
UNSUPPORTED_OPTION(CountCompiledCalls);
141
#ifndef SUPPORTS_NATIVE_CX8
146
_supports_cx8 = true;
150
void VM_Version::initialize_cpu_information(void) {
156
_no_of_cores = os::processor_count();
157
_no_of_threads = _no_of_cores;
158
_no_of_sockets = _no_of_cores;
159
snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "Zero VM");
160
snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string);