[Bug target/80313] -march=znver1 produce worse code than -march=haswell

venkataramanan.kumar at amd dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 6 15:30:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80313

--- Comment #3 from Venkataramanan <venkataramanan.kumar at amd dot com> ---
Thanks for pointing out. It looks like we need to adjust our branch cost. 

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 14ac189..8212c56 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1405,7 +1405,7 @@ struct processor_costs znver1_cost = {
      to limit number of prefetches at all, as their execution also takes some
      time).  */
   100,                                 /* number of parallel prefetches.  */
-  2,                                   /* Branch cost.  */
+  3,                                   /* Branch cost.  */
   COSTS_N_INSNS (6),                   /* cost of FADD and FSUB insns.  */
   COSTS_N_INSNS (6),                   /* cost of FMUL instruction.  */
   COSTS_N_INSNS (42),                  /* cost of FDIV instruction.  */
@@ -4155,6 +4155,312 @@ convert_scalars_to_vector ()
   return 0;
 }

Adjusting it the runtime for attached test case improved.  As richard said we
have not yet completed the cost model tuning for Zen.  We will benchmark and
come back on this.


More information about the Gcc-bugs mailing list