i386: Add register source to movddup
authorH.J. Lu <hongjiu.lu@intel.com>
Sun, 14 Oct 2018 20:39:05 +0000 (20:39 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sun, 14 Oct 2018 20:39:05 +0000 (13:39 -0700)
Add register source to movddup so that IRA will allow register source
for *vec_dupv2di when SSE3 is enabled.

gcc/

PR target/87599
* config/i386/sse.md (*vec_dupv2di): Add register source to
movddup.

gcc/testsuite/

PR target/87599
* gcc.target/i386/pr87599.c: New test.

From-SVN: r265151

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr87599.c [new file with mode: 0644]

index e6c6dbcbcad506f6ef3d4504515924f651dfbfb7..8144181a567601ba96170450fd92a7545b3a28bd 100644 (file)
@@ -1,3 +1,9 @@
+2018-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/87599
+       * config/i386/sse.md (*vec_dupv2di): Add register source to
+       movddup.
+
 2018-10-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/87572
index 9fc5819a863710481a05e3185e12fc26a686fa65..ff9f81535a9a2dd8ee8ccf56d89dbb0f6a1a053b 100644 (file)
 (define_insn "*vec_dupv2di"
   [(set (match_operand:V2DI 0 "register_operand"     "=x,v,v,x")
        (vec_duplicate:V2DI
-         (match_operand:DI 1 "nonimmediate_operand" " 0,Yv,m,0")))]
+         (match_operand:DI 1 "nonimmediate_operand" " 0,Yv,vm,0")))]
   "TARGET_SSE"
   "@
    punpcklqdq\t%0, %0
index d8fbbccabe54ee06a18afde8a8fcf81a86d6832b..8824474e85d16b2f2ef0975fcec95dc5a2095cdb 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/87599
+       * gcc.target/i386/pr87599.c: New test.
+
 2018-10-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/87572
diff --git a/gcc/testsuite/gcc.target/i386/pr87599.c b/gcc/testsuite/gcc.target/i386/pr87599.c
new file mode 100644 (file)
index 0000000..1e2defd
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-march=corei7 -O2" } */
+/* { dg-final { scan-assembler-times "punpcklqdq\[ \\t\]+%xmm\[0-9\]+,\[ \\t\]+%xmm\[0-9\]+" 1 } } */
+
+#include <immintrin.h>
+
+__m128i
+foo (long long val)
+{
+  __m128i rval = {val, val};
+  return rval;
+}