public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kirill Yukhin <kirill.yukhin@gmail.com>
To: gcc-patches List <gcc-patches@gcc.gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>, "H.J. Lu" <hjl.tools@gmail.com>,
		Uros Bizjak <ubizjak@gmail.com>
Subject: [PATCH, test, i386] Fix for PR50155
Date: Mon, 22 Aug 2011 19:09:00 -0000	[thread overview]
Message-ID: <CAGs3Rfsaur61KOj5ygzK-iZa+knDxkKr5_HY6Pqnzt26Zm=1og@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Hi,
Attached fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50155

ChangeLog entry:
2011-08-22  Kirill Yukhin  <kirill.yukhin@intel.com>

        PR target/50155
        * config/i386/sse.md (VI1248_AVX2): New.
        (<plusminus_insn><mode>3): Update.
        (*<plusminus_insn><mode>3): Likewise.
        (<sse2_avx2>_andnot<mode>3): Likewise.
        (avx2_pbroadcast<mode>): Likewise.

testsuite/ChangeLog entry:
2011-08-22  Kirill Yukhin  <kirill.yukhin@intel.com>

        PR target/50155
        * gcc.target/i386/pr50155.c: New test.

New test fails without fix, passed with it applied.

Ok for trunk if bootstrap will success?

Thanks, K

[-- Attachment #2: pr50155.gcc.patch --]
[-- Type: application/octet-stream, Size: 3074 bytes --]

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 5bc8586..ac542ba 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -93,6 +93,13 @@
 (define_mode_iterator VI8_AVX2
   [(V4DI "TARGET_AVX2") V2DI])
 
+(define_mode_iterator VI1248_AVX2
+  [(V32QI "TARGET_AVX2") V16QI
+   (V16HI "TARGET_AVX2") V8HI
+   (V8SI "TARGET_AVX2") V4SI
+   (V4DI "TARGET_AVX2") V2DI])
+
+
 (define_mode_iterator VIMAX_AVX2
   [(V4DI "TARGET_AVX2") V1TI])
 
@@ -4641,18 +4648,18 @@
   "operands[2] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));")
 
 (define_expand "<plusminus_insn><mode>3"
-  [(set (match_operand:VI 0 "register_operand" "")
-	(plusminus:VI
-	  (match_operand:VI 1 "nonimmediate_operand" "")
-	  (match_operand:VI 2 "nonimmediate_operand" "")))]
+  [(set (match_operand:VI1248_AVX2 0 "register_operand" "")
+	(plusminus:VI1248_AVX2
+	  (match_operand:VI1248_AVX2 1 "nonimmediate_operand" "")
+	  (match_operand:VI1248_AVX2 2 "nonimmediate_operand" "")))]
   "TARGET_SSE2"
   "ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
 
 (define_insn "*<plusminus_insn><mode>3"
-  [(set (match_operand:VI 0 "register_operand" "=x,x")
-	(plusminus:VI
-	  (match_operand:VI 1 "nonimmediate_operand" "<comm>0,x")
-	  (match_operand:VI 2 "nonimmediate_operand" "xm,xm")))]
+  [(set (match_operand:VI1248_AVX2 0 "register_operand" "=x,x")
+	(plusminus:VI1248_AVX2
+	  (match_operand:VI1248_AVX2 1 "nonimmediate_operand" "<comm>0,x")
+	  (match_operand:VI1248_AVX2 2 "nonimmediate_operand" "xm,xm")))]
   "TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
   "@
    p<plusminus_mnemonic><ssemodesuffix>\t{%2, %0|%0, %2}
@@ -6161,10 +6168,10 @@
 })
 
 (define_expand "<sse2_avx2>_andnot<mode>3"
-  [(set (match_operand:VI 0 "register_operand" "")
-	(and:VI
-	  (not:VI (match_operand:VI 1 "register_operand" ""))
-	  (match_operand:VI 2 "nonimmediate_operand" "")))]
+  [(set (match_operand:VI1248_AVX2 0 "register_operand" "")
+	(and:VI1248_AVX2
+	  (not:VI1248_AVX2 (match_operand:VI1248_AVX2 1 "register_operand" ""))
+	  (match_operand:VI1248_AVX2 2 "nonimmediate_operand" "")))]
   "TARGET_SSE2")
 
 (define_insn "*andnot<mode>3"
@@ -11291,8 +11298,8 @@
    (V32QI "V16QI") (V16QI "V16QI")])
 
 (define_insn "avx2_pbroadcast<mode>"
-  [(set (match_operand:VI 0 "register_operand" "=x")
-	(vec_duplicate:VI
+  [(set (match_operand:VI1248_AVX2 0 "register_operand" "=x")
+	(vec_duplicate:VI1248_AVX2
 	  (vec_select:<ssescalarmode>
 	    (match_operand:<AVXTOSSEMODE> 1 "nonimmediate_operand" "xm")
 	    (parallel [(const_int 0)]))))]
diff --git a/gcc/testsuite/gcc.target/i386/pr50155.c b/gcc/testsuite/gcc.target/i386/pr50155.c
new file mode 100644
index 0000000..d7730b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr50155.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mavx" } */
+
+void
+foo (int x, double *a, double *b, double c)
+{
+  int i;
+
+  for (i = 0; i < x; i++)
+    *a++ = *b++ * i / c;
+}
+
+/* { dg-final { scan-assembler-not "vpaddd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */

             reply	other threads:[~2011-08-22 18:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 19:09 Kirill Yukhin [this message]
2011-08-22 19:51 ` Uros Bizjak
2011-08-22 20:36 ` Jakub Jelinek
2011-08-22 20:42   ` Kirill Yukhin
2011-08-22 23:04     ` Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGs3Rfsaur61KOj5ygzK-iZa+knDxkKr5_HY6Pqnzt26Zm=1og@mail.gmail.com' \
    --to=kirill.yukhin@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=jakub@redhat.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).