add file missing from earlier commit
authorJan Beulich <jbeulich@gcc.gnu.org>
Fri, 28 Jun 2019 08:49:23 +0000 (08:49 +0000)
committerJan Beulich <jbeulich@gcc.gnu.org>
Fri, 28 Jun 2019 08:49:23 +0000 (08:49 +0000)
From-SVN: r272781

gcc/testsuite/gcc.target/i386/cvtpd2pi.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.target/i386/cvtpd2pi.c b/gcc/testsuite/gcc.target/i386/cvtpd2pi.c
new file mode 100644 (file)
index 0000000..cb043b8
--- /dev/null
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+typedef int __attribute__((vector_size(8))) v2si_t;
+typedef int __attribute__((vector_size(16))) v4si_t;
+typedef double __attribute__((vector_size(16))) v2df_t;
+
+struct __attribute__((packed)) s {
+  int i;
+  v2si_t m;
+  v4si_t v;
+};
+
+int test (struct s*ps)
+{
+  v4si_t r = ps->v;
+  v2si_t m;
+
+  if (ps->i > 0)
+    {
+      asm volatile ("" : "+m" (*ps));
+      m = __builtin_ia32_cvtpd2pi ((v2df_t)ps->v);
+      r[0] = __builtin_ia32_paddd (m, m)[0];
+    }
+  else
+    {
+      asm volatile ("" : "+m" (*ps));
+      m = __builtin_ia32_cvttpd2pi ((v2df_t)ps->v);
+      r[0] = __builtin_ia32_paddd (m, m)[0];
+    }
+
+  return r[0];
+}
+
+/* { dg-final { scan-assembler-not "cvtpd2pi\[ \t]\[^\n\r]*\\(" } } */
+/* { dg-final { scan-assembler-not "cvttpd2pi\[ \t]\[^\n\r]*\\(" } } */