]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: update ampere1 vectorization cost
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>
Mon, 17 Apr 2023 23:26:32 +0000 (01:26 +0200)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Tue, 18 Apr 2023 00:37:05 +0000 (02:37 +0200)
The original submission of AmpereOne (-mcpu=ampere1) costs occurred
prior to exhaustive testing of vectorizable workloads against
hardware.

Adjust the vector costs to achieve the best results and more closely
match the underlying hardware.

gcc/ChangeLog:

* config/aarch64/aarch64.c: Update vector costs for ampere1.

Co-Authored-By: Jiangning Liu <jiangning.liu@amperecomputing.com>
Co-Authored-By: Manolis Tsamis <manolis.tsamis@vrull.eu>
(cherry picked from commit ff1f2f2412bda118f7ddc10e69bd4284d9b24b9e)

gcc/config/aarch64/aarch64.c

index e491b9d0d38f025ae5898eeffa24e3e67f9258a5..9aebbbd49100fbec513ae51758985fd9023d1f7e 100644 (file)
@@ -785,18 +785,18 @@ static const struct cpu_vector_cost a64fx_vector_cost =
 static const struct cpu_vector_cost ampere1_vector_cost =
 {
   1, /* scalar_int_stmt_cost  */
-  1, /* scalar_fp_stmt_cost  */
+  3, /* scalar_fp_stmt_cost  */
   4, /* scalar_load_cost  */
   1, /* scalar_store_cost  */
-  3, /* int_stmt_cost  */
+  1, /* int_stmt_cost  */
   3, /* fp_stmt_cost  */
   2, /* permute_cost  */
   6, /* vec_to_scalar_cost  */
   7, /* scalar_to_vec_cost  */
-  5, /* align_load_cost  */
-  5, /* unalign_load_cost  */
-  2, /* unalign_store_cost  */
-  2, /* store_cost  */
+  4, /* align_load_cost  */
+  4, /* unalign_load_cost  */
+  1, /* unalign_store_cost  */
+  1, /* store_cost  */
   1, /* cond_taken_branch_cost  */
   1 /* cond_not_taken_branch_cost  */
 };