File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2000, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2000, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
44 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55 *
@@ -165,7 +165,13 @@ class FloatRegister {
165165 max_slots_per_register = 4 ,
166166 save_slots_per_register = 2 ,
167167 slots_per_neon_register = 4 ,
168- extra_save_slots_per_neon_register = slots_per_neon_register - save_slots_per_register
168+ extra_save_slots_per_neon_register = slots_per_neon_register - save_slots_per_register,
169+ neon_vl = 16 ,
170+ // VLmax: The maximum sve vector length is determined by the hardware
171+ // sve_vl_min <= VLmax <= sve_vl_max.
172+ sve_vl_min = 16 ,
173+ // Maximum supported vector length across all CPUs
174+ sve_vl_max = 256
169175 };
170176
171177 class FloatRegisterImpl : public AbstractRegisterImpl {
Original file line number Diff line number Diff line change 2525
2626#include " precompiled.hpp"
2727#include " pauth_aarch64.hpp"
28+ #include " register_aarch64.hpp"
2829#include " runtime/arguments.hpp"
2930#include " runtime/globals_extension.hpp"
3031#include " runtime/java.hpp"
@@ -440,7 +441,19 @@ void VM_Version::initialize() {
440441 }
441442
442443 if (UseSVE > 0 ) {
443- _initial_sve_vector_length = get_current_sve_vector_length ();
444+ int vl = get_current_sve_vector_length ();
445+ if (vl < 0 ) {
446+ warning (" Unable to get SVE vector length on this system. "
447+ " Disabling SVE. Specify -XX:UseSVE=0 to shun this warning." );
448+ FLAG_SET_DEFAULT (UseSVE, 0 );
449+ } else if ((vl == 0 ) || ((vl % FloatRegister::sve_vl_min) != 0 ) || !is_power_of_2 (vl)) {
450+ warning (" Detected SVE vector length (%d) should be a power of two and a multiple of %d. "
451+ " Disabling SVE. Specify -XX:UseSVE=0 to shun this warning." ,
452+ vl, FloatRegister::sve_vl_min);
453+ FLAG_SET_DEFAULT (UseSVE, 0 );
454+ } else {
455+ _initial_sve_vector_length = vl;
456+ }
444457 }
445458
446459 // This machine allows unaligned memory accesses
You can’t perform that action at this time.
0 commit comments