]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AArch64: Add CMP+CSEL and CMP+CSET for cores that support it
authorTamar Christina <tamar.christina@arm.com>
Fri, 13 Dec 2024 11:17:55 +0000 (11:17 +0000)
committerTamar Christina <tamar.christina@arm.com>
Fri, 13 Dec 2024 11:17:55 +0000 (11:17 +0000)
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.

gcc/config/aarch64/aarch64-fusion-pairs.def
gcc/config/aarch64/tuning_models/cortexx925.h
gcc/config/aarch64/tuning_models/generic_armv9_a.h
gcc/config/aarch64/tuning_models/neoverse512tvb.h
gcc/config/aarch64/tuning_models/neoversen2.h
gcc/config/aarch64/tuning_models/neoversen3.h
gcc/config/aarch64/tuning_models/neoversev1.h
gcc/config/aarch64/tuning_models/neoversev2.h
gcc/config/aarch64/tuning_models/neoversev3.h
gcc/config/aarch64/tuning_models/neoversev3ae.h

index f8413ab0c802c28290ebcc171bfd131622cb33be..0123430d988b96b20d20376df9ae7a196031286d 100644 (file)
@@ -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)
index b2ff716157a452f4ff0260c5be8ddc0355e1a9e1..ef4c7d1a8323d270e0da18aef4d9833c21e7ba18 100644 (file)
@@ -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.  */
index a05a9ab92a27e8f24949aa2ffa5b5512c1487518..785e00946bc47316f64afd0574e59f41b9ecb294 100644 (file)
@@ -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.  */
index c407b89a22f1aecbfd594b493be4fbaf1f9b0437..f72505918f3aa64200aa596dbe2d7d4a3de9c08c 100644 (file)
@@ -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.  */
index fd5f8f3737054e037428527206101f9bc726116d..141c994df3813fb150db2b7c2cc733ddcd7def52 100644 (file)
@@ -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.  */
index 8b156c2fe4d27c5df70446c4eb7d9153e8082268..b3e31885cdee565048ba49c06f5e812d4c41a007 100644 (file)
@@ -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.  */
index 23c121d865248c38c2bfef5e34c314207014649b..b3d27eb780df7ecbaf9eb2de860f82f57fbcd04c 100644 (file)
@@ -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.  */
index 40af5f47f4f62757e8e374abbb29cec5d1a8f7f3..ea91bbb732d474ad38a4059378d2509eb8b8ee1f 100644 (file)
@@ -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.  */
index d65d74bfecfb69eac6c523870a372fc9d32e8687..3f5ba4bf52e1393a127ceb888d537449c2666911 100644 (file)
@@ -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.  */
index 7b7fa0b4b081bb3bd17c8418b8ce9fc598cb19ce..4d9c62f104dee14611294acb39a8396c7b17056a 100644 (file)
@@ -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.  */