public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, test, i386] Fix for PR50155
@ 2011-08-22 19:09 Kirill Yukhin
  2011-08-22 19:51 ` Uros Bizjak
  2011-08-22 20:36 ` Jakub Jelinek
  0 siblings, 2 replies; 5+ messages in thread
From: Kirill Yukhin @ 2011-08-22 19:09 UTC (permalink / raw)
  To: gcc-patches List; +Cc: Jakub Jelinek, H.J. Lu, Uros Bizjak

[-- 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\]" } } */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-22 21:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22 19:09 [PATCH, test, i386] Fix for PR50155 Kirill Yukhin
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

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).