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.
146 #undef CPU_FEATURE_DETECTION
147
148 static int cpu_family() { return _cpu; }
149 static int cpu_model() { return _model; }
150 static int cpu_model2() { return _model2; }
151 static int cpu_variant() { return _variant; }
152 static int cpu_revision() { return _revision; }
153
154 static bool is_zva_enabled() { return 0 <= _zva_length; }
155 static int zva_length() {
156 assert(is_zva_enabled(), "ZVA not available");
157 return _zva_length;
158 }
159
160 static int icache_line_size() { return _icache_line_size; }
161 static int dcache_line_size() { return _dcache_line_size; }
162 static int get_initial_sve_vector_length() { return _initial_sve_vector_length; };
163
164 static bool supports_fast_class_init_checks() { return true; }
165 constexpr static bool supports_stack_watermark_barrier() { return true; }
166
167 static void get_compatible_board(char *buf, int buflen);
168
169 static const SpinWait& spin_wait_desc() { return _spin_wait; }
170
171 static bool supports_on_spin_wait() { return _spin_wait.inst() != SpinWait::NONE; }
172
173 static bool supports_float16() { return true; }
174
175 #ifdef __APPLE__
176 // Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64)
177 static bool is_cpu_emulated();
178 #endif
179
180 static void initialize_cpu_information(void);
181
182 static bool use_rop_protection() { return _rop_protection; }
183
184 // For common 64/128-bit unpredicated vector operations, we may prefer
185 // 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.
146 #undef CPU_FEATURE_DETECTION
147
148 static int cpu_family() { return _cpu; }
149 static int cpu_model() { return _model; }
150 static int cpu_model2() { return _model2; }
151 static int cpu_variant() { return _variant; }
152 static int cpu_revision() { return _revision; }
153
154 static bool is_zva_enabled() { return 0 <= _zva_length; }
155 static int zva_length() {
156 assert(is_zva_enabled(), "ZVA not available");
157 return _zva_length;
158 }
159
160 static int icache_line_size() { return _icache_line_size; }
161 static int dcache_line_size() { return _dcache_line_size; }
162 static int get_initial_sve_vector_length() { return _initial_sve_vector_length; };
163
164 static bool supports_fast_class_init_checks() { return true; }
165 constexpr static bool supports_stack_watermark_barrier() { return true; }
166 constexpr static bool supports_recursive_lightweight_locking() { return true; }
167
168 static void get_compatible_board(char *buf, int buflen);
169
170 static const SpinWait& spin_wait_desc() { return _spin_wait; }
171
172 static bool supports_on_spin_wait() { return _spin_wait.inst() != SpinWait::NONE; }
173
174 static bool supports_float16() { return true; }
175
176 #ifdef __APPLE__
177 // Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64)
178 static bool is_cpu_emulated();
179 #endif
180
181 static void initialize_cpu_information(void);
182
183 static bool use_rop_protection() { return _rop_protection; }
184
185 // For common 64/128-bit unpredicated vector operations, we may prefer
186 // emitting NEON instructions rather than the corresponding SVE instructions.
|