This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch x86_64]: fix order of cost table initialization for -march=znver1.
- From: "Kumar, Venkataramanan" <Venkataramanan dot Kumar at amd dot com>
- To: "Uros Bizjak (ubizjak at gmail dot com)" <ubizjak at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "Richard Beiner (richard dot guenther at gmail dot com)" <richard dot guenther at gmail dot com>
- Date: Tue, 8 Mar 2016 13:51:06 +0000
- Subject: [Patch x86_64]: fix order of cost table initialization for -march=znver1.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=amd.com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
Hi Uros,
While debugging GCC to see if cost of multiplication for DI mode is set correctly for znver1 target.
I found that the order of cost table insertion is wrong for znver1 and it worked because btver2 had same cost for multiply .
The patch corrects the mistake I made.
2016-03-08 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
* config/i386/i386.c (processor_target_table): Fix cost table
initialization order for znver1.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8a026ae..3d67c65 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2662,9 +2662,9 @@ static const struct ptt processor_target_table[PROCESSOR_max] =
{"bdver2", &bdver2_cost, 16, 10, 16, 7, 11},
{"bdver3", &bdver3_cost, 16, 10, 16, 7, 11},
{"bdver4", &bdver4_cost, 16, 10, 16, 7, 11},
- {"znver1", &znver1_cost, 16, 10, 16, 7, 11},
{"btver1", &btver1_cost, 16, 10, 16, 7, 11},
- {"btver2", &btver2_cost, 16, 10, 16, 7, 11}
+ {"btver2", &btver2_cost, 16, 10, 16, 7, 11},
+ {"znver1", &znver1_cost, 16, 10, 16, 7, 11},
};
It passes normal bootstrap and bootstrap with BOOT_CFLAGS="-O2 -g -march=znver1 -mno-clzero -mno-sha " on avx2 target.
Is it ok for trunk?
Regards,
Venkat.