1 /*
2 * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
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.
151 static int cpu_model2() { return _model2; }
152 static int cpu_variant() { return _variant; }
153 static int cpu_revision() { return _revision; }
154
155 static bool model_is(int cpu_model) {
156 return _model == cpu_model || _model2 == cpu_model;
157 }
158
159 static bool is_zva_enabled() { return 0 <= _zva_length; }
160 static int zva_length() {
161 assert(is_zva_enabled(), "ZVA not available");
162 return _zva_length;
163 }
164
165 static int icache_line_size() { return _icache_line_size; }
166 static int dcache_line_size() { return _dcache_line_size; }
167 static int get_initial_sve_vector_length() { return _initial_sve_vector_length; };
168
169 static bool supports_fast_class_init_checks() { return true; }
170 constexpr static bool supports_stack_watermark_barrier() { return true; }
171
172 static void get_compatible_board(char *buf, int buflen);
173
174 static const SpinWait& spin_wait_desc() { return _spin_wait; }
175
176 static bool supports_on_spin_wait() { return _spin_wait.inst() != SpinWait::NONE; }
177
178 static bool supports_float16() { return true; }
179
180 #ifdef __APPLE__
181 // Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64)
182 static bool is_cpu_emulated();
183 #endif
184
185 static void initialize_cpu_information(void);
186
187 static bool use_rop_protection() { return _rop_protection; }
188
189 // For common 64/128-bit unpredicated vector operations, we may prefer
190 // emitting NEON instructions rather than the corresponding SVE instructions.
|
1 /*
2 * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
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.
151 static int cpu_model2() { return _model2; }
152 static int cpu_variant() { return _variant; }
153 static int cpu_revision() { return _revision; }
154
155 static bool model_is(int cpu_model) {
156 return _model == cpu_model || _model2 == cpu_model;
157 }
158
159 static bool is_zva_enabled() { return 0 <= _zva_length; }
160 static int zva_length() {
161 assert(is_zva_enabled(), "ZVA not available");
162 return _zva_length;
163 }
164
165 static int icache_line_size() { return _icache_line_size; }
166 static int dcache_line_size() { return _dcache_line_size; }
167 static int get_initial_sve_vector_length() { return _initial_sve_vector_length; };
168
169 static bool supports_fast_class_init_checks() { return true; }
170 constexpr static bool supports_stack_watermark_barrier() { return true; }
171 constexpr static bool supports_recursive_lightweight_locking() { return true; }
172
173 static void get_compatible_board(char *buf, int buflen);
174
175 static const SpinWait& spin_wait_desc() { return _spin_wait; }
176
177 static bool supports_on_spin_wait() { return _spin_wait.inst() != SpinWait::NONE; }
178
179 static bool supports_float16() { return true; }
180
181 #ifdef __APPLE__
182 // Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64)
183 static bool is_cpu_emulated();
184 #endif
185
186 static void initialize_cpu_information(void);
187
188 static bool use_rop_protection() { return _rop_protection; }
189
190 // For common 64/128-bit unpredicated vector operations, we may prefer
191 // emitting NEON instructions rather than the corresponding SVE instructions.
|