[i386] : Fix REDUC_SSE_SMINMAX_MODE mode iterator

Message ID CAFULd4aTR+uKyqN7LFPmRE9Am1Rvkq4Py-CK34ASCk2cJskLVA@mail.gmail.com
State New
Headers show
Series
  • [i386] : Fix REDUC_SSE_SMINMAX_MODE mode iterator
Related show

Commit Message

Uros Bizjak Oct. 28, 2019, 11:35 a.m.
2019-10-28  UroŇ° Bizjak  <ubizjak@gmail.com>

    PR target/92225
    * config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE4_2
    condition for V2DImode.

testsuite/ChangeLog:

2019-10-28  UroŇ° Bizjak  <ubizjak@gmail.com>

    PR target/92225
    * gcc.target/i386/pr92225.c: New test.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline, will be backported to other release branches.

Uros.

Patch

Index: config/i386/sse.md
===================================================================
--- config/i386/sse.md	(revision 277509)
+++ config/i386/sse.md	(working copy)
@@ -2825,7 +2825,7 @@ 
 ;; Modes handled by reduc_sm{in,ax}* patterns.
 (define_mode_iterator REDUC_SSE_SMINMAX_MODE
   [(V4SF "TARGET_SSE") (V2DF "TARGET_SSE")
-   (V2DI "TARGET_SSE") (V4SI "TARGET_SSE") (V8HI "TARGET_SSE")
+   (V2DI "TARGET_SSE4_2") (V4SI "TARGET_SSE") (V8HI "TARGET_SSE")
    (V16QI "TARGET_SSE")])
 
 (define_expand "reduc_<code>_scal_<mode>"
Index: testsuite/gcc.target/i386/pr92225.c
===================================================================
--- testsuite/gcc.target/i386/pr92225.c	(nonexistent)
+++ testsuite/gcc.target/i386/pr92225.c	(working copy)
@@ -0,0 +1,19 @@ 
+/* PR target/92225 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse4" } */
+
+void a (long);
+
+unsigned *b;
+
+void
+c ()
+{
+  long d = 2;
+  int e = 0;
+  
+  for (; e < 1024; e++)
+    if (b[e] > d)
+      d = b[e];
+  a (d);
+}