From 8662802d4924603981b20b3340cb31a098a48b51 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 28 Jun 2019 08:49:23 +0000 Subject: [PATCH] add file missing from earlier commit From-SVN: r272781 --- gcc/testsuite/gcc.target/i386/cvtpd2pi.c | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/cvtpd2pi.c diff --git a/gcc/testsuite/gcc.target/i386/cvtpd2pi.c b/gcc/testsuite/gcc.target/i386/cvtpd2pi.c new file mode 100644 index 00000000000..cb043b84e8f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/cvtpd2pi.c @@ -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]*\\(" } } */ -- 2.30.2