> -----Original Message-----
> From: Saurabh Jha via Sourceware Forge <forge-bot+saurabh.jha@forge-
> stage.sourceware.org>
> Sent: 30 October 2026 13:10
> To: gcc-patches mailing list <[email protected]>
> Cc: Tamar Christina <[email protected]>
> Subject: [PATCH v1 2/3] aarch64: Change SVE2 comparison costs for Neoverse
> V3
> 
> From: Saurabh Jha <[email protected]>
> 
> Currently, we underestimate vector comparison costs for Neoverse V3.
> This leads to unnecessary vectorisation in cases where scalar code would
> have been more performant.
> 
> This patch increases the SVE int comparison cost from 0 to 2 and SVE int
> comparison cost from 0 to 1, while keeping SVE comparison predication
> costs to 0.
> 

But Neoverse V3 is 4 wide and both integer and fp  SVE compares have a
throughput of 1.  Given this I'd expect both values to be 3. (or 4 with the
new calculation I mentioned in part 1).

2 probably worked because it's 2 + 1, which was close enough to say that
the SVE compares have lower throughput but it's not based on the actual
throughput.

Also a similar change is needed for the Neoverse V3AE model.

Thanks,
Tamar

> This change led to around 5% improvement in the execution time of SPEC
> 2017 541.leela_r benchmark against current master while using the
> compiler options '-Ofast -mcpu=neoverse-v3' on a Neoverse V3 core.
> 
> gcc/ChangeLog:
> 
>       * config/aarch64/tuning_models/neoversev3.h: Increase
>       int_cmp_ops from 0 to 2 and fp_cmp_ops from 0 to 1.
> ---
>  gcc/config/aarch64/tuning_models/neoversev3.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/config/aarch64/tuning_models/neoversev3.h
> b/gcc/config/aarch64/tuning_models/neoversev3.h
> index c6b8b0a411998..cafbb9e5c7cdb 100644
> --- a/gcc/config/aarch64/tuning_models/neoversev3.h
> +++ b/gcc/config/aarch64/tuning_models/neoversev3.h
> @@ -161,9 +161,9 @@ static const aarch64_sve_vec_issue_info
> neoversev3_sve_issue_info =
>    },
>    2, /* pred_ops_per_cycle  */
>    1, /* while_pred_ops  */
> -  0, /* int_cmp_ops  */
> +  2, /* int_cmp_ops  */
>    0, /* int_cmp_pred_ops  */
> -  0, /* fp_cmp_ops  */
> +  1, /* fp_cmp_ops  */
>    0, /* fp_cmp_pred_ops  */
>    1, /* gather_scatter_pair_general_ops  */
>    1 /* gather_scatter_pair_pred_ops  */
> --
> 2.56.0

Reply via email to