This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [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>, "Kumar, Venkataramanan" <Venkataramanan dot Kumar at amd dot com>
- Date: Tue, 8 Mar 2016 13:56:42 +0000
- Subject: RE: [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;
- References: <CY1PR1201MB10985F3A379B002BA3ECBFF28FB20 at CY1PR1201MB1098 dot namprd12 dot prod dot outlook dot com>
Hi Uros,
> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Kumar, Venkataramanan
> Sent: Tuesday, March 08, 2016 7:21 PM
> To: Uros Bizjak (ubizjak@gmail.com); gcc-patches@gcc.gnu.org
> Cc: Richard Beiner (richard.guenther@gmail.com)
> Subject: [Patch x86_64]: fix order of cost table initialization for -
> march=znver1.
>
> 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?
Please find the correct patch below.
Change Log
2016-03-08 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
* config/i386/i386.c (processor_target_table): Fix cost table
initialization order for znver1.
----snip----
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8a026ae..234327a 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}
};
----snip----
Ok for trunk?
>
> Regards,
> Venkat.