[1/2] Re-format zen memcpy/memset costs.

Message ID 1eeb3e1b-8d31-a001-8bff-333e1d3f7e91@suse.cz
State New
Headers show
Series
  • [1/2] Re-format zen memcpy/memset costs.
Related show

Commit Message

Martin Liška June 1, 2020, 11:35 a.m.
The patch improves readability of the memcpy and memset
expansion strategies.

gcc/ChangeLog:

	* config/i386/x86-tune-costs.h: Change code formatting.
---
  gcc/config/i386/x86-tune-costs.h | 38 +++++++++++++++++++++++---------
  1 file changed, 28 insertions(+), 10 deletions(-)

-- 
2.26.2

Comments

Jan Hubicka July 29, 2020, 3:42 p.m. | #1
> The patch improves readability of the memcpy and memset

> expansion strategies.

> 

> gcc/ChangeLog:

> 

> 	* config/i386/x86-tune-costs.h: Change code formatting.


OK,
thanks!
Honza
> ---

>  gcc/config/i386/x86-tune-costs.h | 38 +++++++++++++++++++++++---------

>  1 file changed, 28 insertions(+), 10 deletions(-)

> 

> diff --git a/gcc/config/i386/x86-tune-costs.h b/gcc/config/i386/x86-tune-costs.h

> index c73917e5a62..1169178433f 100644

> --- a/gcc/config/i386/x86-tune-costs.h

> +++ b/gcc/config/i386/x86-tune-costs.h

> @@ -1311,14 +1311,23 @@ const struct processor_costs bdver_cost = {

>      very small blocks it is better to use loop.  For large blocks, libcall

>      can do nontemporary accesses and beat inline considerably.  */

>  static stringop_algs znver1_memcpy[2] = {

> -  {libcall, {{6, loop, false}, {14, unrolled_loop, false},

> +  /* 32-bit tuning.  */

> +  {libcall, {{6, loop, false},

> +	     {14, unrolled_loop, false},

>  	     {-1, rep_prefix_4_byte, false}}},

> -  {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false},

> +  /* 64-bit tuning.  */

> +  {libcall, {{16, loop, false},

> +	     {8192, rep_prefix_8_byte, false},

>  	     {-1, libcall, false}}}};

>  static stringop_algs znver1_memset[2] = {

> -  {libcall, {{8, loop, false}, {24, unrolled_loop, false},

> -	     {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}},

> -  {libcall, {{48, unrolled_loop, false}, {8192, rep_prefix_8_byte, false},

> +  /* 32-bit tuning.  */

> +  {libcall, {{8, loop, false},

> +	     {24, unrolled_loop, false},

> +	     {2048, rep_prefix_4_byte, false},

> +	     {-1, libcall, false}}},

> +  /* 64-bit tuning.  */

> +  {libcall, {{48, unrolled_loop, false},

> +	     {8192, rep_prefix_8_byte, false},

>  	     {-1, libcall, false}}}};

>  struct processor_costs znver1_cost = {

>    {

> @@ -1448,14 +1457,23 @@ struct processor_costs znver1_cost = {

>      very small blocks it is better to use loop.  For large blocks, libcall

>      can do nontemporary accesses and beat inline considerably.  */

>  static stringop_algs znver2_memcpy[2] = {

> -  {libcall, {{6, loop, false}, {14, unrolled_loop, false},

> +  /* 32-bit tuning.  */

> +  {libcall, {{6, loop, false},

> +	     {14, unrolled_loop, false},

>  	     {-1, rep_prefix_4_byte, false}}},

> -  {libcall, {{16, loop, false}, {64, rep_prefix_4_byte, false},

> +  /* 64-bit tuning.  */

> +  {libcall, {{16, loop, false},

> +	     {64, rep_prefix_4_byte, false},

>  	     {-1, libcall, false}}}};

>  static stringop_algs znver2_memset[2] = {

> -  {libcall, {{8, loop, false}, {24, unrolled_loop, false},

> -	     {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}},

> -  {libcall, {{24, rep_prefix_4_byte, false}, {128, rep_prefix_8_byte, false},

> +  /* 32-bit tuning.  */

> +  {libcall, {{8, loop, false},

> +	     {24, unrolled_loop, false},

> +	     {2048, rep_prefix_4_byte, false}

> +	     {-1, libcall, false}}},

> +  /* 64-bit tuning.  */

> +  {libcall, {{24, rep_prefix_4_byte, false},

> +	     {128, rep_prefix_8_byte, false},

>  	     {-1, libcall, false}}}};

>  struct processor_costs znver2_cost = {

> -- 

> 2.26.2

> 

>

Patch

diff --git a/gcc/config/i386/x86-tune-costs.h b/gcc/config/i386/x86-tune-costs.h
index c73917e5a62..1169178433f 100644
--- a/gcc/config/i386/x86-tune-costs.h
+++ b/gcc/config/i386/x86-tune-costs.h
@@ -1311,14 +1311,23 @@  const struct processor_costs bdver_cost = {
      very small blocks it is better to use loop.  For large blocks, libcall
      can do nontemporary accesses and beat inline considerably.  */
  static stringop_algs znver1_memcpy[2] = {
-  {libcall, {{6, loop, false}, {14, unrolled_loop, false},
+  /* 32-bit tuning.  */
+  {libcall, {{6, loop, false},
+	     {14, unrolled_loop, false},
  	     {-1, rep_prefix_4_byte, false}}},
-  {libcall, {{16, loop, false}, {8192, rep_prefix_8_byte, false},
+  /* 64-bit tuning.  */
+  {libcall, {{16, loop, false},
+	     {8192, rep_prefix_8_byte, false},
  	     {-1, libcall, false}}}};
  static stringop_algs znver1_memset[2] = {
-  {libcall, {{8, loop, false}, {24, unrolled_loop, false},
-	     {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}},
-  {libcall, {{48, unrolled_loop, false}, {8192, rep_prefix_8_byte, false},
+  /* 32-bit tuning.  */
+  {libcall, {{8, loop, false},
+	     {24, unrolled_loop, false},
+	     {2048, rep_prefix_4_byte, false},
+	     {-1, libcall, false}}},
+  /* 64-bit tuning.  */
+  {libcall, {{48, unrolled_loop, false},
+	     {8192, rep_prefix_8_byte, false},
  	     {-1, libcall, false}}}};
  struct processor_costs znver1_cost = {
    {
@@ -1448,14 +1457,23 @@  struct processor_costs znver1_cost = {
      very small blocks it is better to use loop.  For large blocks, libcall
      can do nontemporary accesses and beat inline considerably.  */
  static stringop_algs znver2_memcpy[2] = {
-  {libcall, {{6, loop, false}, {14, unrolled_loop, false},
+  /* 32-bit tuning.  */
+  {libcall, {{6, loop, false},
+	     {14, unrolled_loop, false},
  	     {-1, rep_prefix_4_byte, false}}},
-  {libcall, {{16, loop, false}, {64, rep_prefix_4_byte, false},
+  /* 64-bit tuning.  */
+  {libcall, {{16, loop, false},
+	     {64, rep_prefix_4_byte, false},
  	     {-1, libcall, false}}}};
  static stringop_algs znver2_memset[2] = {
-  {libcall, {{8, loop, false}, {24, unrolled_loop, false},
-	     {2048, rep_prefix_4_byte, false}, {-1, libcall, false}}},
-  {libcall, {{24, rep_prefix_4_byte, false}, {128, rep_prefix_8_byte, false},
+  /* 32-bit tuning.  */
+  {libcall, {{8, loop, false},
+	     {24, unrolled_loop, false},
+	     {2048, rep_prefix_4_byte, false}
+	     {-1, libcall, false}}},
+  /* 64-bit tuning.  */
+  {libcall, {{24, rep_prefix_4_byte, false},
+	     {128, rep_prefix_8_byte, false},
  	     {-1, libcall, false}}}};
  
  struct processor_costs znver2_cost = {