Tests were added. I also updated Changelog and set the max line length to be 
equal to 79 characters.

gcc/
        * config/i386/subst.md (mask_scalar, round_scalar,
        round_saeonly_scalar): New meta-templates.
        (mask_scalar_name, mask_scalar_operand3, round_scalar_name,
        round_scalar_mask_operand3, round_scalar_mask_op3,
        round_scalar_constraint, round_scalar_prefix, round_saeonly_scalar_name,
        round_saeonly_scalar_mask_operand3, round_saeonly_scalar_mask_op3,
        round_saeonly_scalar_constraint, 
        round_saeonly_scalar_prefix): New subst attribute.
        * config/i386/sse.md
        (<sse>_vm<plusminus_insn><mode>3<mask_name><round_name>): Renamed to ...
        <sse>_vm<plusminus_insn><mode>3<mask_scalar_name>
        <round_scalar_name> ... this.
        (<sse>_vm<multdiv_mnemonic><mode>3<mask_name><round_name>): Renamed to 
...
        <sse>_vm<multdiv_mnemonic><mode>3<mask_scalar_name>
        <round_scalar_name> ... this.
        (<sse>_vm<code><mode>3<mask_name><round_saeonly_name>): Renamed to ...
        <sse>_vm<code><mode>3<mask_scalar_name>
        <round_saeonly_scalar_name> ... this.
        (v<plusminus_mnemonic><ssescalarmodesuffix>
        \t{<round_mask_op3>%2, %1, %0<mask_operand3>|
        %0<mask_operand3>, %1, %<iptr>2<round_mask_op3>}): Changed to ...
        v<plusminus_mnemonic><ssescalarmodesuffix>
        \t{<round_scalar_mask_op3>%2, %1, %0<mask_scalar_operand3>|
        %0<mask_scalar_operand3>, %1, %<iptr>2<round_scalar_mask_op3>} ... this.
        (v<multdiv_mnemonic><ssescalarmodesuffix>
        \t{<round_mask_op3>%2, %1, %0<mask_operand3>|
        %0<mask_operand3>, %1, %<iptr>2<round_mask_op3>}): Changed to ...
        v<multdiv_mnemonic><ssescalarmodesuffix>
        \t{<round_scalar_mask_op3>%2, %1, %0<mask_scalar_operand3>|
        %0<mask_scalar_operand3>, %1, %<iptr>2<round_scalar_mask_op3>} ... this.
        (v<maxmin_float><ssescalarmodesuffix>
        \t{<round_saeonly_mask_op3>%2, %1, %0<mask_operand3>|
        %0<mask_operand3>, %1, %<iptr>2<round_saeonly_mask_op3>}): Changed to 
...
        v<maxmin_float><ssescalarmodesuffix>
        \t{<round_saeonly_scalar_mask_op3>%2, %1, %0<mask_scalar_operand3>|
        %0<mask_scalar_operand3>, %1, %<iptr>2
        <round_saeonly_scalar_mask_op3>} ... this.
        
gcc/testsuite
        * gcc.target/i386/avx512f-vaddsd-3.c: New test for mask 0 verification.
        * gcc.target/i386/avx512f-vaddss-3.c: Ditto.
        * gcc.target/i386/avx512f-vdivsd-3.c: Ditto.
        * gcc.target/i386/avx512f-vdivss-3.c: Ditto.
        * gcc.target/i386/avx512f-vmaxsd-3.c: Ditto.
        * gcc.target/i386/avx512f-vmaxss-3.c: Ditto.
        * gcc.target/i386/avx512f-vminsd-3.c: Ditto.
        * gcc.target/i386/avx512f-vminss-3.c: Ditto.
        * gcc.target/i386/avx512f-vmulsd-3.c: Ditto.
        * gcc.target/i386/avx512f-vmulss-3.c: Ditto.
        * gcc.target/i386/avx512f-vsubsd-3.c: Ditto.
        * gcc.target/i386/avx512f-vsubss-3.c: Ditto.

Is it ok for trunk?

Thanks,
Sebastian

-----Original Message-----
From: Kirill Yukhin [mailto:kirill.yuk...@gmail.com] 
Sent: Wednesday, July 5, 2017 12:36 PM
To: Peryt, Sebastian <sebastian.pe...@intel.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATHC][x86] Scalar mask and round RTL templates

On 05 Jul 06:38, Peryt, Sebastian wrote:
> Hi Kirill,
> 
> Sorry for this confusion. I meant to write MDs for intrinsics. Those 
> intrinsics are all masked ones for ADD[SD,SS], SUB[SD,SS], MUL[SD,SS], 
> DIV[SD,SS], MIN[SD,SS] and MAX[SD,SS]. What I found is that for mask equal 0 
> they were producing wrong results when old mask meta-template was used.
What you're talking about looks like a bug. Could you pls add a regession test 
to your patch?

> Modified changelog below.
> 
> 2017-07-05  Sebastian Peryt  <sebastian.pe...@intel.com>
> 
> gcc/
>       * config/i386/subst.md (mask_scalar, round_scalar, 
> round_saeonly_scalar): New meta-templates.
>       (mask_scalar_name, mask_scalar_operand3, round_scalar_name,
>       round_scalar_mask_operand3, round_scalar_mask_op3,
>       round_scalar_constraint, round_scalar_prefix, round_saeonly_scalar_name,
>       round_saeonly_scalar_mask_operand3, round_saeonly_scalar_mask_op3,
>       round_saeonly_scalar_constraint, round_saeonly_scalar_prefix): New 
> subst attribute.
>       * config/i386/sse.md
>       (<sse>_vm<plusminus_insn><mode>3<mask_name><round_name>): Renamed to ...
>       <sse>_vm<plusminus_insn><mode>3<mask_scalar_name><round_scalar_name> 
> ... this.
>       (<sse>_vm<multdiv_mnemonic><mode>3<mask_name><round_name>): Renamed to 
> ...
>       <sse>_vm<multdiv_mnemonic><mode>3<mask_scalar_name><round_scalar_name> 
> ... this.
>       (<sse>_vm<code><mode>3<mask_name><round_saeonly_name>): Renamed to ...
>       <sse>_vm<code><mode>3<mask_scalar_name><round_saeonly_scalar_name> ... 
> this.
>       (v<plusminus_mnemonic><ssescalarmodesuffix>\t{<round_mask_op3>%2, %1, 
> %0<mask_operand3>|
>       %0<mask_operand3>, %1, %<iptr>2<round_mask_op3>}): Changed to ...
>       v<plusminus_mnemonic><ssescalarmodesuffix>\t{<round_scalar_mask_op3>%2, 
> %1, %0<mask_scalar_operand3>|
>       %0<mask_scalar_operand3>, %1, %<iptr>2<round_scalar_mask_op3>} ... this.
>       (v<multdiv_mnemonic><ssescalarmodesuffix>\t{<round_mask_op3>%2, %1, 
> %0<mask_operand3>|
>       %0<mask_operand3>, %1, %<iptr>2<round_mask_op3>}): Changed to ...
>       v<multdiv_mnemonic><ssescalarmodesuffix>\t{<round_scalar_mask_op3>%2, 
> %1, %0<mask_scalar_operand3>|
>       %0<mask_scalar_operand3>, %1, %<iptr>2<round_scalar_mask_op3>} ... this.
>       (v<maxmin_float><ssescalarmodesuffix>\t{<round_saeonly_mask_op3>%2, %1, 
> %0<mask_operand3>|
>       %0<mask_operand3>, %1, %<iptr>2<round_saeonly_mask_op3>}): Changed to 
> ...
>       
> v<maxmin_float><ssescalarmodesuffix>\t{<round_saeonly_scalar_mask_op3>%2, %1, 
> %0<mask_scalar_operand3>|
>       %0<mask_scalar_operand3>, %1, %<iptr>2<round_saeonly_scalar_mask_op3>} 
> ... this.
Max line length is 79 characters I suppose.

--
Thanks, K
> 
> Is it ok for trunk?
> 
> Thanks,
> Sebastian
> 
> -----Original Message-----
> From: Kirill Yukhin [mailto:kirill.yuk...@gmail.com]
> Sent: Tuesday, July 4, 2017 7:45 PM
> To: Peryt, Sebastian <sebastian.pe...@intel.com>
> Cc: gcc-patches@gcc.gnu.org; Uros Bizjak <ubiz...@gmail.com>
> Subject: Re: [PATHC][x86] Scalar mask and round RTL templates
> 
> Hello Sebastian,
> On 23 Jun 09:00, Peryt, Sebastian wrote:
> > Hi,
> > 
> > This patch adds three extra RTL meta-templates for scalar round and mask. 
> > Additionally fixes errors caused by previous mask and round usage in some 
> > of the intrinsics that I found.
> Could you pls point which intrinsics did you fixed (or which errors)?
> I see only MD changes in your patch.
> 
> > 
> > 2017-06-23  Sebastian Peryt  <sebastian.pe...@intel.com>
> > 
> > gcc/
> >     * config/i386/subst.md (mask_scalar, round_scalar, 
> > round_saeonly_scalar): New templates.
> I'd call it meta-templates.
> >     (mask_scalar_name, mask_scalar_operand3, round_scalar_name,
> >     round_scalar_mask_operand3, round_scalar_mask_op3,
> >     round_scalar_constraint, round_scalar_prefix, round_saeonly_scalar_name,
> >     round_saeonly_scalar_mask_operand3, round_saeonly_scalar_mask_op3,
> >     round_saeonly_scalar_constraint, round_saeonly_scalar_prefix): New 
> > subst attribute.
> >     * config/i386/sse.md
> >     (<sse>_vm<plusminus_insn><mode>3<mask_name><round_name>): Renamed to ...
> >     <sse>_vm<plusminus_insn><mode>3<mask_scalar_name><round_scalar_name> 
> > ... this.
> >     (<sse>_vm<multdiv_mnemonic><mode>3<mask_name><round_name>): Renamed to 
> > ...
> >     <sse>_vm<multdiv_mnemonic><mode>3<mask_scalar_name><round_scalar_name> 
> > ... this.
> >     (<sse>_vm<code><mode>3<mask_name><round_saeonly_name>): Renamed to ...
> >     <sse>_vm<code><mode>3<mask_scalar_name><round_saeonly_scalar_name> ... 
> > this.
> >     (v<plusminus_mnemonic><ssescalarmodesuffix>\t{<round_mask_op3>%2, %1, 
> > %0<mask_operand3>|%0<mask_operand3>, %1, %<iptr>2<round_mask_op3>}): 
> > Changed to ...
> >     v<plusminus_mnemonic><ssescalarmodesuffix>\t{<round_scalar_mask_op3>%2, 
> > %1, %0<mask_scalar_operand3>|%0<mask_scalar_operand3>, %1, 
> > %<iptr>2<round_scalar_mask_op3>} ... this.
> >     (v<multdiv_mnemonic><ssescalarmodesuffix>\t{<round_mask_op3>%2, %1, 
> > %0<mask_operand3>|%0<mask_operand3>, %1, %<iptr>2<round_mask_op3>}): 
> > Changed to ...
> >     v<multdiv_mnemonic><ssescalarmodesuffix>\t{<round_scalar_mask_op3>%2, 
> > %1, %0<mask_scalar_operand3>|%0<mask_scalar_operand3>, %1, 
> > %<iptr>2<round_scalar_mask_op3>} ... this.
> >     (v<maxmin_float><ssescalarmodesuffix>\t{<round_saeonly_mask_op3>%2, %1, 
> > %0<mask_operand3>|%0<mask_operand3>, %1, 
> > %<iptr>2<round_saeonly_mask_op3>}): Changed to ...
> >     
> > v<maxmin_float><ssescalarmodesuffix>\t{<round_saeonly_scalar_mask_op3>%2, 
> > %1, %0<mask_scalar_operand3>|%0<mask_scalar_operand3>, %1, 
> > %<iptr>2<round_saeonly_scalar_mask_op3>} ... this.
> We need to obey conventions. Pls break long lines here.
> 
> --
> Thanks, K
> > 
> > Is it ok for trunk?
> > 
> > Thanks,
> > Sebastian
> 
> 

Attachment: 0001-Scalar-templates-patch-with-extra-tests.patch
Description: 0001-Scalar-templates-patch-with-extra-tests.patch

Reply via email to