https://gcc.gnu.org/g:4a9427f75b9f5dfbd9edd0ec8e0a07f868754b65

commit r15-6216-g4a9427f75b9f5dfbd9edd0ec8e0a07f868754b65
Author: Tamar Christina <tamar.christ...@arm.com>
Date:   Fri Dec 13 11:17:55 2024 +0000

    AArch64: Add CMP+CSEL and CMP+CSET for cores that support it
    
    GCC 15 added two new fusions CMP+CSEL and CMP+CSET.
    
    This patch enables them for cores that support based on their Software
    Optimization Guides and generically on Armv9-A.   Even if a core does not
    support it there's no negative performance impact.
    
    gcc/ChangeLog:
    
            * config/aarch64/aarch64-fusion-pairs.def 
(AARCH64_FUSE_NEOVERSE_BASE):
            New.
            * config/aarch64/tuning_models/neoverse512tvb.h: Use it.
            * config/aarch64/tuning_models/neoversen2.h: Use it.
            * config/aarch64/tuning_models/neoversen3.h: Use it.
            * config/aarch64/tuning_models/neoversev1.h: Use it.
            * config/aarch64/tuning_models/neoversev2.h: Use it.
            * config/aarch64/tuning_models/neoversev3.h: Use it.
            * config/aarch64/tuning_models/neoversev3ae.h: Use it.
            * config/aarch64/tuning_models/cortexx925.h: Add fusions.
            * config/aarch64/tuning_models/generic_armv9_a.h: Add fusions.

Diff:
---
 gcc/config/aarch64/aarch64-fusion-pairs.def        | 4 ++++
 gcc/config/aarch64/tuning_models/cortexx925.h      | 4 +++-
 gcc/config/aarch64/tuning_models/generic_armv9_a.h | 4 +++-
 gcc/config/aarch64/tuning_models/neoverse512tvb.h  | 2 +-
 gcc/config/aarch64/tuning_models/neoversen2.h      | 2 +-
 gcc/config/aarch64/tuning_models/neoversen3.h      | 2 +-
 gcc/config/aarch64/tuning_models/neoversev1.h      | 2 +-
 gcc/config/aarch64/tuning_models/neoversev2.h      | 2 +-
 gcc/config/aarch64/tuning_models/neoversev3.h      | 2 +-
 gcc/config/aarch64/tuning_models/neoversev3ae.h    | 2 +-
 10 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-fusion-pairs.def 
b/gcc/config/aarch64/aarch64-fusion-pairs.def
index f8413ab0c802..0123430d988b 100644
--- a/gcc/config/aarch64/aarch64-fusion-pairs.def
+++ b/gcc/config/aarch64/aarch64-fusion-pairs.def
@@ -45,4 +45,8 @@ AARCH64_FUSION_PAIR ("cmp+cset", CMP_CSET)
 /* Baseline fusion settings suitable for all cores.  */
 #define AARCH64_FUSE_BASE (AARCH64_FUSE_CMP_BRANCH | AARCH64_FUSE_AES_AESMC)
 
+/* Baseline fusion settings suitable for all Neoverse cores.  */
+#define AARCH64_FUSE_NEOVERSE_BASE (AARCH64_FUSE_BASE | AARCH64_FUSE_CMP_CSEL \
+                                   | AARCH64_FUSE_CMP_CSET)
+
 #define AARCH64_FUSE_MOVK (AARCH64_FUSE_MOV_MOVK | AARCH64_FUSE_MOVK_MOVK)
diff --git a/gcc/config/aarch64/tuning_models/cortexx925.h 
b/gcc/config/aarch64/tuning_models/cortexx925.h
index b2ff716157a4..ef4c7d1a8323 100644
--- a/gcc/config/aarch64/tuning_models/cortexx925.h
+++ b/gcc/config/aarch64/tuning_models/cortexx925.h
@@ -205,7 +205,9 @@ static const struct tune_params cortexx925_tunings =
     2 /* store_pred.  */
   }, /* memmov_cost.  */
   10, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  (AARCH64_FUSE_BASE
+   | AARCH64_FUSE_CMP_CSEL
+   | AARCH64_FUSE_CMP_CSET), /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/generic_armv9_a.h 
b/gcc/config/aarch64/tuning_models/generic_armv9_a.h
index a05a9ab92a27..785e00946bc4 100644
--- a/gcc/config/aarch64/tuning_models/generic_armv9_a.h
+++ b/gcc/config/aarch64/tuning_models/generic_armv9_a.h
@@ -236,7 +236,9 @@ static const struct tune_params generic_armv9_a_tunings =
     1 /* store_pred.  */
   }, /* memmov_cost.  */
   3, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  (AARCH64_FUSE_BASE
+   | AARCH64_FUSE_CMP_CSEL
+   | AARCH64_FUSE_CMP_CSET), /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoverse512tvb.h 
b/gcc/config/aarch64/tuning_models/neoverse512tvb.h
index c407b89a22f1..f72505918f3a 100644
--- a/gcc/config/aarch64/tuning_models/neoverse512tvb.h
+++ b/gcc/config/aarch64/tuning_models/neoverse512tvb.h
@@ -143,7 +143,7 @@ static const struct tune_params neoverse512tvb_tunings =
     1 /* store_pred.  */
   }, /* memmov_cost.  */
   3, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoversen2.h 
b/gcc/config/aarch64/tuning_models/neoversen2.h
index fd5f8f373705..141c994df381 100644
--- a/gcc/config/aarch64/tuning_models/neoversen2.h
+++ b/gcc/config/aarch64/tuning_models/neoversen2.h
@@ -205,7 +205,7 @@ static const struct tune_params neoversen2_tunings =
     1 /* store_pred.  */
   }, /* memmov_cost.  */
   5, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoversen3.h 
b/gcc/config/aarch64/tuning_models/neoversen3.h
index 8b156c2fe4d2..b3e31885cdee 100644
--- a/gcc/config/aarch64/tuning_models/neoversen3.h
+++ b/gcc/config/aarch64/tuning_models/neoversen3.h
@@ -205,7 +205,7 @@ static const struct tune_params neoversen3_tunings =
     2 /* store_pred.  */
   }, /* memmov_cost.  */
   5, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoversev1.h 
b/gcc/config/aarch64/tuning_models/neoversev1.h
index 23c121d86524..b3d27eb780df 100644
--- a/gcc/config/aarch64/tuning_models/neoversev1.h
+++ b/gcc/config/aarch64/tuning_models/neoversev1.h
@@ -214,7 +214,7 @@ static const struct tune_params neoversev1_tunings =
     1 /* store_pred.  */
   }, /* memmov_cost.  */
   3, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoversev2.h 
b/gcc/config/aarch64/tuning_models/neoversev2.h
index 40af5f47f4f6..ea91bbb732d4 100644
--- a/gcc/config/aarch64/tuning_models/neoversev2.h
+++ b/gcc/config/aarch64/tuning_models/neoversev2.h
@@ -218,7 +218,7 @@ static const struct tune_params neoversev2_tunings =
     2 /* store_pred.  */
   }, /* memmov_cost.  */
   5, /* issue_rate  */
-  (AARCH64_FUSE_BASE | AARCH64_FUSE_CMP_CSEL | AARCH64_FUSE_CMP_CSET), /* 
fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoversev3.h 
b/gcc/config/aarch64/tuning_models/neoversev3.h
index d65d74bfecfb..3f5ba4bf52e1 100644
--- a/gcc/config/aarch64/tuning_models/neoversev3.h
+++ b/gcc/config/aarch64/tuning_models/neoversev3.h
@@ -205,7 +205,7 @@ static const struct tune_params neoversev3_tunings =
     2 /* store_pred.  */
   }, /* memmov_cost.  */
   10, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */
diff --git a/gcc/config/aarch64/tuning_models/neoversev3ae.h 
b/gcc/config/aarch64/tuning_models/neoversev3ae.h
index 7b7fa0b4b081..4d9c62f104de 100644
--- a/gcc/config/aarch64/tuning_models/neoversev3ae.h
+++ b/gcc/config/aarch64/tuning_models/neoversev3ae.h
@@ -205,7 +205,7 @@ static const struct tune_params neoversev3ae_tunings =
     2 /* store_pred.  */
   }, /* memmov_cost.  */
   10, /* issue_rate  */
-  AARCH64_FUSE_BASE, /* fusible_ops  */
+  AARCH64_FUSE_NEOVERSE_BASE, /* fusible_ops  */
   "32:16",     /* function_align.  */
   "4",         /* jump_align.  */
   "32:16",     /* loop_align.  */

Reply via email to