diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index 77508e4528e..ad052fe9128 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -654,7 +654,8 @@ class Address { if (offset % vl == 0) { // Convert address offset into sve imm offset (MUL VL). int64_t sve_offset = offset / vl; - if (((-(1 << (shift - 1))) <= sve_offset) && (sve_offset < (1 << (shift - 1)))) { + int32_t range = 1 << (shift - 1); + if ((-range <= sve_offset) && (sve_offset < range)) { // sve_offset can be encoded return true; }