This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386] Fix ix86_multiplication_cost for SKX
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "Shalnov, Sergey" <sergey dot shalnov at intel dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "Peryt, Sebastian" <sebastian dot peryt at intel dot com>, "Ivchenko, Alexander" <alexander dot ivchenko at intel dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Wed, 7 Feb 2018 14:15:19 +0100
- Subject: Re: [PATCH, i386] Fix ix86_multiplication_cost for SKX
- Authentication-results: sourceware.org; auth=none
- References: <71475DE127B5E94A8E189586234C0888234A1D33@irsmsx111.ger.corp.intel.com>
On Wed, Feb 7, 2018 at 2:02 PM, Shalnov, Sergey
<sergey.shalnov@intel.com> wrote:
> Hi,
> This patch is one of the set of patches to fix SKX costs.
Please post the whole series for review.
Thanks,
Uros.
> I think multiplication costs calculation algorithm needs to be adjusted in gcc/config/i386/i386.c ix86_multiplication_cost() function.
> For TARGET_AVX512DQ emulation is not used and single vpmullq instruction emitted.
> I think we have to align costs calculation algorithm with sequence of emitted instructions.
>
> I don't see visible regressions for this change. This patch helps to avoid a regressions with further changes.
>
> Could you please merge the patch to the main trunk?
>
> Thank you
> Sergey
>
> 2018-02-06 Sergey Shalnov <Sergey.Shalnov@intel.com>
> gcc/
> * config/i386/i386.c (ix86_multiplication_cost): Fix multiplication
> cost for TARGET_AVX512DQ since it uses vpmullq instead
> emulated sequence
>
>
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 70b6775..6f4ec5d 100644
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -40393,6 +40393,10 @@ ix86_multiplication_cost (const struct processor_costs *cost,
> ? cost->mulsd : cost->mulss, true);
> else if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT)
> {
> + /* vpmullq is used in this case. No emulation is needed. */
> + if (TARGET_AVX512DQ)
> + return ix86_vec_cost (mode, cost->mulss, true);
> +
> /* V*QImode is emulated with 7-13 insns. */
> if (mode == V16QImode || mode == V32QImode)
> {
>