diff mbox

[i386,3/8,AVX512,5/n] Add AVX-512 patterns: Introduce `multdiv' code iterator.

Message ID 20131009102538.GD52466@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Kirill Yukhin Oct. 9, 2013, 10:25 a.m. UTC
Hello,

> This patch is still far too large.
>
> I think you should split it up based on every single mode iterator that
> you need to add or change.

Here's 5th subpatch. It introduces `multdiv' code iterator.

Is it Ok?

Testing:
  1. Bootstrap pass.
  2. make check shows no regressions.
  3. Spec 2000 & 2006 build show no regressions both with and without -mavx512f option.
  4. Spec 2000 & 2006 run shows no stability regressions without -mavx512f option.

--
Thanks, K

PS. If it is Ok - I am going to strip out ChangeLog lines from big patch.

---
 gcc/config/i386/i386.md |  4 ++++
 gcc/config/i386/sse.md  | 31 +++++++------------------------
 2 files changed, 11 insertions(+), 24 deletions(-)

Comments

Richard Henderson Oct. 9, 2013, 9:34 p.m. UTC | #1
On 10/09/2013 03:25 AM, Kirill Yukhin wrote:
> Here's 5th subpatch. It introduces `multdiv' code iterator.

This is the sort of patch I like to see.  It's the first one
you've sent that's done exactly one thing.  Congratulations.

Ok.


r~
Kirill Yukhin Oct. 11, 2013, 1:39 p.m. UTC | #2
Hello,
On 09 Oct 14:34, Richard Henderson wrote:
> On 10/09/2013 03:25 AM, Kirill Yukhin wrote:
> > Here's 5th subpatch. It introduces `multdiv' code iterator.
> 
> This is the sort of patch I like to see.  It's the first one
> you've sent that's done exactly one thing.  Congratulations.
> 
> Ok.
Thanks, checked into main trunk: http://gcc.gnu.org/ml/gcc-cvs/2013-10/msg00383.html

K
Jakub Jelinek Oct. 11, 2013, 1:43 p.m. UTC | #3
On Fri, Oct 11, 2013 at 05:39:05PM +0400, Kirill Yukhin wrote:
> Hello,
> On 09 Oct 14:34, Richard Henderson wrote:
> > On 10/09/2013 03:25 AM, Kirill Yukhin wrote:
> > > Here's 5th subpatch. It introduces `multdiv' code iterator.
> > 
> > This is the sort of patch I like to see.  It's the first one
> > you've sent that's done exactly one thing.  Congratulations.
> > 
> > Ok.
> Thanks, checked into main trunk: http://gcc.gnu.org/ml/gcc-cvs/2013-10/msg00383.html

Everybody can read gcc-cvs mailing list, it's archives or svn log
or git log, there is no need to duplicate this info to gcc-patches
mailing list.

	Jakub
Kirill Yukhin Oct. 11, 2013, 1:47 p.m. UTC | #4
On 11 Oct 15:43, Jakub Jelinek wrote:
> On Fri, Oct 11, 2013 at 05:39:05PM +0400, Kirill Yukhin wrote:
> > Thanks, checked into main trunk: http://gcc.gnu.org/ml/gcc-cvs/2013-10/msg00383.html
> 
> Everybody can read gcc-cvs mailing list, it's archives or svn log
> or git log, there is no need to duplicate this info to gcc-patches
> mailing list.
Okay, I'll stop sending these updates!

Thanks, K
diff mbox

Patch

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index cc332ea..10ca6cb 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -746,6 +746,8 @@ 
 
 (define_code_iterator sat_plusminus [ss_plus us_plus ss_minus us_minus])
 
+(define_code_iterator multdiv [mult div])
+
 ;; Base name for define_insn
 (define_code_attr plusminus_insn
   [(plus "add") (ss_plus "ssadd") (us_plus "usadd")
@@ -757,6 +759,8 @@ 
    (minus "sub") (ss_minus "subs") (us_minus "subus")])
 (define_code_attr plusminus_carry_mnemonic
   [(plus "adc") (minus "sbb")])
+(define_code_attr multdiv_mnemonic
+  [(mult "mul") (div "div")])
 
 ;; Mark commutative operators as such in constraints.
 (define_code_attr comm [(plus "%") (ss_plus "%") (us_plus "%")
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index cdb9ae0..89c31c5 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1061,21 +1061,22 @@ 
    (set_attr "btver2_decode" "direct,double")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "<sse>_vmmul<mode>3"
+(define_insn "<sse>_vm<multdiv_mnemonic><mode>3"
   [(set (match_operand:VF_128 0 "register_operand" "=x,v")
 	(vec_merge:VF_128
-	  (mult:VF_128
+	  (multdiv:VF_128
 	    (match_operand:VF_128 1 "register_operand" "0,v")
 	    (match_operand:VF_128 2 "nonimmediate_operand" "xm,vm"))
 	  (match_dup 1)
 	  (const_int 1)))]
   "TARGET_SSE"
   "@
-   mul<ssescalarmodesuffix>\t{%2, %0|%0, %<iptr>2}
-   vmul<ssescalarmodesuffix>\t{%2, %1, %0|%0, %1, %<iptr>2}"
+   <multdiv_mnemonic><ssescalarmodesuffix>\t{%2, %0|%0, %<iptr>2}
+   v<multdiv_mnemonic><ssescalarmodesuffix>\t{%2, %1, %0|%0, %1, %<iptr>2}"
   [(set_attr "isa" "noavx,avx")
-   (set_attr "type" "ssemul")
-   (set_attr "prefix" "orig,vex")
+   (set_attr "type" "sse<multdiv_mnemonic>")
+   (set_attr "prefix" "orig,maybe_evex")
+   (set_attr "btver2_decode" "direct,double")
    (set_attr "mode" "<ssescalarmode>")])
 
 (define_expand "div<mode>3"
@@ -1118,24 +1119,6 @@ 
    (set_attr "prefix" "orig,vex")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "<sse>_vmdiv<mode>3"
-  [(set (match_operand:VF_128 0 "register_operand" "=x,v")
-	(vec_merge:VF_128
-	  (div:VF_128
-	    (match_operand:VF_128 1 "register_operand" "0,v")
-	    (match_operand:VF_128 2 "nonimmediate_operand" "xm,vm"))
-	  (match_dup 1)
-	  (const_int 1)))]
-  "TARGET_SSE"
-  "@
-   div<ssescalarmodesuffix>\t{%2, %0|%0, %<iptr>2}
-   vdiv<ssescalarmodesuffix>\t{%2, %1, %0|%0, %1, %<iptr>2}"
-  [(set_attr "isa" "noavx,avx")
-   (set_attr "type" "ssediv")
-   (set_attr "prefix" "orig,vex")
-   (set_attr "btver2_decode" "direct,double")
-   (set_attr "mode" "<ssescalarmode>")])
-
 (define_insn "<sse>_rcp<mode>2"
   [(set (match_operand:VF1_128_256 0 "register_operand" "=x")
 	(unspec:VF1_128_256