This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386, AVX-512] Emit vpbroadcastq instead if non-existent vbroadcastsd.
- From: Richard Biener <rguenther at suse dot de>
- To: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>
- Date: Fri, 18 Mar 2016 11:05:49 +0100 (CET)
- Subject: Re: [PATCH, i386, AVX-512] Emit vpbroadcastq instead if non-existent vbroadcastsd.
- Authentication-results: sourceware.org; auth=none
- References: <20160318094455 dot GB57948 at msticlxl57 dot ims dot intel dot com>
On Fri, 18 Mar 2016, Kirill Yukhin wrote:
> Hello,
> Intel spec [1] states that there're almost all broadcasting
> intructions variants available, except for (p. 2-4)
> vbroadcastsd %xmm, %xmm
> It is safe to emit
> vpbroadcastq %xmm, %xmm
> instead.
>
> I was uable to extract a testcase, but if this insn is generated -
> we'll got asm error.
>
> [1] - https://software.intel.com/sites/default/files/managed/b4/3a/319433-024.pdf
>
> Bootstrapped and regtested.
>
> Richard,
> is it ok to check in to main trunk?
If it's ok with Uros yes.
Richard.
> gcc/
> * config/i386/sse.md: Use vpbroadcastq for broadcasting DF
> values to 128b regs.
>
> --
> Thanks, K
>
> commit 72e85f1b936d61edc93603862c810a8b4817b8a7
> Author: Kirill Yukhin <kirill.yukhin@intel.com>
> Date: Thu Mar 17 18:05:22 2016 +0300
>
> AVX-512. Use vpbroadcastq for broadcasting DF values to 128b regs.
>
> diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> index 3c521b3..b25c246 100644
> --- a/gcc/config/i386/sse.md
> +++ b/gcc/config/i386/sse.md
> @@ -17269,7 +17269,14 @@
> (match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm")
> (parallel [(const_int 0)]))))]
> "TARGET_AVX512F"
> - "v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}"
> +{
> + /* There is no DF broadcast (in AVX-512*) to 128b register.
> + Mimic it with integer variant. */
> + if (<MODE>mode == V2DFmode)
> + return "vpbroadcastq\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}";
> + else
> + return "v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0<mask_operand2>|%0<mask_operand2>, %1}";
> +}
> [(set_attr "type" "ssemov")
> (set_attr "prefix" "evex")
> (set_attr "mode" "<sseinsnmode>")])
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)