]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/gcc-tumbl.git/commitdiff
PR target/51235
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Nov 2011 22:26:14 +0000 (22:26 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 Nov 2011 22:26:14 +0000 (22:26 +0000)
* config/i386/i386.c (ix86_expand_vcond): Generate TARGET_XOP
patterns for supported mode only.

PR target/51236
* config/i386/i386.c (ix86_expand_builtin)
<IX86_BUILTIN_GATHERALTSIV4DI>: Use CODE_FOR_avx2_gathersiv4di.

testsuite/ChangeLog:

PR target/51235
* gcc.target/i386/pr51235.c: New test.

PR target/51236
* gcc.target/i386/pr51236.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181537 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr51235.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr51236.c [new file with mode: 0644]

index d2ed66a97a9b4634b9502298d5a94b96daf259fb..9bef97dff15cc06924e88de292e2d96f959de6ef 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-20  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/51235
+       * config/i386/i386.c (ix86_expand_vcond): Generate TARGET_XOP
+       patterns for supported mode only.
+
+       PR target/51236
+       * config/i386/i386.c (ix86_expand_builtin)
+       <IX86_BUILTIN_GATHERALTSIV4DI>: Use CODE_FOR_avx2_gathersiv4di.
+
 2011-11-20  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (UNSPEC_MOVNTI): Remove.
index d92f8e2c631aac0f0440404d970fd22c975c20a7..34368203cd9e849aad9799e3e7ccf271d4c7471f 100644 (file)
@@ -19619,8 +19619,12 @@ ix86_expand_int_vcond (rtx operands[])
   cop0 = operands[4];
   cop1 = operands[5];
 
-  /* XOP supports all of the comparisons on all vector int types.  */
-  if (!TARGET_XOP)
+  /* XOP supports all of the comparisons on all 128-bit vector int types.  */
+  if (TARGET_XOP
+      && (mode == V16QImode || mode == V8HImode
+         || mode == V4SImode || mode == V2DImode))
+    ;
+  else
     {
       /* Canonicalize the comparison to EQ, GT, GTU.  */
       switch (code)
@@ -30013,7 +30017,7 @@ rdrand_step:
       icode = CODE_FOR_avx2_gatherdiv8sf;
       goto gather_gen;
     case IX86_BUILTIN_GATHERALTSIV4DI:
-      icode = CODE_FOR_avx2_gathersiv4df;
+      icode = CODE_FOR_avx2_gathersiv4di;
       goto gather_gen;
     case IX86_BUILTIN_GATHERALTDIV8SI:
       icode = CODE_FOR_avx2_gatherdiv8si;
index 6c85640c261939b26cbc90945286a848a466dfdd..2a9c6d101db661f54e242493951a5e52410f216b 100644 (file)
@@ -1,3 +1,11 @@
+2011-11-20  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/51235
+       * gcc.target/i386/pr51235.c: New test.
+
+       PR target/51236
+       * gcc.target/i386/pr51236.c: New test.
+
 2011-11-20  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/discr32.adb: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr51235.c b/gcc/testsuite/gcc.target/i386/pr51235.c
new file mode 100644 (file)
index 0000000..c99d5c0
--- /dev/null
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -mxop -mavx2" } */
+
+void *foo (int count, void **list)
+{
+  void *minaddr = list[0];
+  int i;
+
+  for (i = 1; i < count; i++)
+    {
+      void *addr = list[i];
+      if (addr < minaddr)
+       minaddr = addr;
+    }
+
+  return minaddr;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr51236.c b/gcc/testsuite/gcc.target/i386/pr51236.c
new file mode 100644 (file)
index 0000000..63bfaee
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -mavx2" } */
+
+long foo (long *p, int i)
+{
+  long x = 0;
+
+  while (--i)
+    x ^= p[i];
+
+  return x;
+}