This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/80313] -march=znver1 produce worse code than -march=haswell
- From: "venkataramanan.kumar at amd dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Apr 2017 15:30:28 +0000
- Subject: [Bug target/80313] -march=znver1 produce worse code than -march=haswell
- Auto-submitted: auto-generated
- References: <bug-80313-4@http.gcc.gnu.org/bugzilla/>
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.