RFR: 8365991: AArch64: Ignore BlockZeroingLowLimit when UseBlockZeroing is false [v2]
Patrick Zhang
qpzhang at openjdk.org
Wed Sep 3 10:30:42 UTC 2025
On Mon, 1 Sep 2025 10:11:49 GMT, Andrew Haley <aph at openjdk.org> wrote:
> To begin with, please add this short patch, then see if any of this PR provides an advantage.
>
> ```
>
> diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> index 9321dd0542e..14a584c5106 100644
> --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> @@ -446,6 +446,11 @@ void VM_Version::initialize() {
> FLAG_SET_DEFAULT(UseBlockZeroing, false);
> }
>
> + if (!UseBlockZeroing && !FLAG_IS_DEFAULT(BlockZeroingLowLimit)) {
> + warning("BlockZeroingLowLimit has been ignored because UseBlockZeroing is disabled");
> + FLAG_SET_DEFAULT(BlockZeroingLowLimit, 4 * VM_Version::zva_length());
> + }
> +
> if (VM_Version::supports_sve2()) {
> if (FLAG_IS_DEFAULT(UseSVE)) {
> FLAG_SET_DEFAULT(UseSVE, 2);
> ```
Thanks for advice. Updated accordingly (commit 3 vs 2: https://github.com/openjdk/jdk/pull/26917/commits/22e72f49e82cc7febbcd44b01636f8cbdeaa4cca) to keep the shape of the generated code as unchanged as possible. My test case with `-XX:-UseBlockZeroing -XX:BlockZeroingLowLimit=8, size=32` also works as expected. I added some comments to better clarify the purpose of the if-condition inside the `zero_words` function to avoid future confusion upon. Please help review, thanks.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26917#issuecomment-3248661050
More information about the hotspot-dev
mailing list