summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/sse-11.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-04 20:31:24 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-04 20:31:24 +0000
commitb2eb45186452bdd8f36d734fec609c688ff58e87 (patch)
tree30dc2b3eab3f2e9ac7897436ffd5304d59b98730 /gcc/testsuite/gcc.target/i386/sse-11.c
parentcf024d2253f999eeeaf8c7185f83320f03cef3ef (diff)
downloadgcc-b2eb45186452bdd8f36d734fec609c688ff58e87.tar.gz
* gcc.target/i386/20000609-1.c, gcc.target/i386/20000614-1.c,
gcc.target/i386/20000614-2.c, gcc.target/i386/20000720-1.c, gcc.target/i386/20000807-1.c, gcc.target/i386/20000904-1.c, gcc.target/i386/20001127-1.c, gcc.target/i386/20010202-1.c, gcc.target/i386/20010520-1.c, gcc.target/i386/20011009-1.c, gcc.target/i386/20011029-2.c, gcc.target/i386/20011107-1.c, gcc.target/i386/20011119-1.c, gcc.target/i386/20020201-3.c, gcc.target/i386/20020218-1.c, gcc.target/i386/20020224-1.c, gcc.target/i386/20020426-1.c, gcc.target/i386/20020523-1.c, gcc.target/i386/20020523-2.c, gcc.target/i386/20020531-1.c, gcc.target/i386/20020616-1.c, gcc.target/i386/20020729-1.c, gcc.target/i386/20030217-1.c, gcc.target/i386/20030926-1.c, gcc.target/i386/20040112-1.c, gcc.target/i386/20050113-1.c, gcc.target/i386/980211-1.c, gcc.target/i386/980226-1.c, gcc.target/i386/980414-1.c, gcc.target/i386/980520-1.c, gcc.target/i386/980709-1.c, gcc.target/i386/990117-1.c, gcc.target/i386/990130-1.c, gcc.target/i386/990213-2.c, gcc.target/i386/990214-1.c, gcc.target/i386/990424-1.c, gcc.target/i386/990524-1.c, gcc.target/i386/991129-1.c, gcc.target/i386/991209-1.c, gcc.target/i386/991214-1.c, gcc.target/i386/991230-1.c, gcc.target/i386/pr12092-1.c, gcc.target/i386/pr14289-1.c, gcc.target/i386/pr18614-1.c, gcc.target/i386/pr19236-1.c, gcc.target/i386/pr20204.c, gcc.target/i386/pr23943.c, gcc.target/i386/pr9771-1.c: Move from gcc.dg/. * gcc.target/i386/387-1.c, gcc.target/i386/387-2.c, gcc.target/i386/387-3.c, gcc.target/i386/387-4.c, gcc.target/i386/387-5.c, gcc.target/i386/387-6.c, gcc.target/i386/387-7.c, gcc.target/i386/387-8.c, gcc.target/i386/3dnow-1.c, gcc.target/i386/3dnow-2.c, gcc.target/i386/3dnowA-1.c, gcc.target/i386/3dnowA-2.c, gcc.target/i386/asm-2.c, gcc.target/i386/asm-3.c, gcc.target/i386/asm-4.c, gcc.target/i386/bitfield1.c, gcc.target/i386/bitfield2.c, gcc.target/i386/bitfield3.c, gcc.target/i386/cadd.c, gcc.target/i386/call-1.c, gcc.target/i386/clobbers.c, gcc.target/i386/cmov1.c, gcc.target/i386/cmov2.c, gcc.target/i386/cmov3.c, gcc.target/i386/cmov4.c, gcc.target/i386/cmov5.c, gcc.target/i386/cvt-1.c, gcc.target/i386/fastcall-1.c, gcc.target/i386/fpcvt-1.c, gcc.target/i386/fpcvt-2.c, gcc.target/i386/fpcvt-3.c, gcc.target/i386/fpcvt-4.c, gcc.target/i386/lea.c, gcc.target/i386/local.c, gcc.target/i386/local2.c, gcc.target/i386/loop-1.c, gcc.target/i386/loop-2.c, gcc.target/i386/loop-3.c, gcc.target/i386/memset-1.c, gcc.target/i386/mmx-1.c, gcc.target/i386/mmx-2.c, gcc.target/i386/mmx-3.c, gcc.target/i386/mmx-4.c, gcc.target/i386/mmx-5.c, gcc.target/i386/mmx-6.c, gcc.target/i386/mul.c, gcc.target/i386/pentium4-not-mull.c, gcc.target/i386/pic-1.c, gcc.target/i386/regparm.c, gcc.target/i386/rotate-1.c, gcc.target/i386/sibcall-5.c, gcc.target/i386/signbit-1.c, gcc.target/i386/signbit-2.c, gcc.target/i386/signbit-3.c, gcc.target/i386/sse-10.c, gcc.target/i386/sse-11.c, gcc.target/i386/sse-12.c, gcc.target/i386/sse-5.c, gcc.target/i386/sse-6.c, gcc.target/i386/sse-7.c, gcc.target/i386/sse-8.c, gcc.target/i386/sse-9.c, gcc.target/i386/sse-vect-types.c, gcc.target/i386/ssefn-1.c, gcc.target/i386/ssefn-2.c, gcc.target/i386/ssefn-3.c, gcc.target/i386/ssefn-4.c, gcc.target/i386/ssefp-1.c, gcc.target/i386/ssefp-2.c, gcc.target/i386/ssetype-1.c, gcc.target/i386/ssetype-2.c, gcc.target/i386/ssetype-3.c, gcc.target/i386/ssetype-4.c, gcc.target/i386/ssetype-5.c, gcc.target/i386/unroll-1.c, gcc.target/i386/volatile-1.c, gcc.target/i386/xorps.c: Move from gcc.dg/i386-*. * gcc.target/i386/pr23376.c: Move from gcc.target/x86_64/pr23376.c. * gcc.target/i386/asm-5.c: Move from gcc.dg/asm-1.c. * gcc.target/i386/sse-13.c: Move from gcc.dg/i386-sse-1.c. * gcc.target/i386/sse-14.c: Move from gcc.dg/i386-sse-2.c. * gcc.target/i386/sse-15.c: Move from gcc.dg/i386-sse-3.c. * gcc.target/i386/sse-16.c: Move from gcc.dg/i386-sse-4.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106504 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/sse-11.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-11.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/sse-11.c b/gcc/testsuite/gcc.target/i386/sse-11.c
new file mode 100644
index 00000000000..3ec5e7bb124
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-11.c
@@ -0,0 +1,92 @@
+/* PR rtl-optimization/21239 */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -msse2" } */
+#include <emmintrin.h>
+#include "../../gcc.dg/i386-cpuid.h"
+
+extern void abort (void);
+
+void
+foo (unsigned int x, double *y, const double *z)
+{
+ __m128d tmp;
+ while (x)
+ {
+ tmp = _mm_load_sd (z);
+ _mm_store_sd (y, tmp);
+ --x; ++z; ++y;
+ }
+}
+
+void
+bar (unsigned int x, float *y, const float *z)
+{
+ __m128 tmp;
+ unsigned int i;
+ for (i = 0; i < x; ++i)
+ {
+ tmp = (__m128) { *z, 0, 0, 0 };
+ *y = __builtin_ia32_vec_ext_v4sf (tmp, 0);
+ ++z; ++y;
+ }
+ for (i = 0; i < x; ++i)
+ {
+ tmp = (__m128) { 0, *z, 0, 0 };
+ *y = __builtin_ia32_vec_ext_v4sf (tmp, 1);
+ ++z; ++y;
+ }
+ for (i = 0; i < x; ++i)
+ {
+ tmp = (__m128) { 0, 0, *z, 0 };
+ *y = __builtin_ia32_vec_ext_v4sf (tmp, 2);
+ ++z; ++y;
+ }
+ for (i = 0; i < x; ++i)
+ {
+ tmp = (__m128) { 0, 0, 0, *z };
+ *y = __builtin_ia32_vec_ext_v4sf (tmp, 3);
+ ++z; ++y;
+ }
+}
+
+void __attribute__((noinline))
+run_tests (void)
+{
+ unsigned int i;
+ double a[16], b[16];
+ float c[16], d[16];
+ for (i = 0; i < 16; ++i)
+ {
+ a[i] = 1;
+ b[i] = 2;
+ c[i] = 3;
+ d[i] = 4;
+ }
+ foo (16, a, b);
+ bar (4, c, d);
+ for (i = 0; i < 16; ++i)
+ {
+ if (a[i] != 2)
+ abort ();
+ if (c[i] != 4)
+ abort ();
+ }
+}
+
+int
+main ()
+{
+ unsigned long cpu_facilities;
+ unsigned int i;
+ double a[19], b[19];
+
+ cpu_facilities = i386_cpuid ();
+
+ if ((cpu_facilities & (bit_MMX | bit_SSE | bit_SSE2 | bit_CMOV))
+ != (bit_MMX | bit_SSE | bit_SSE2 | bit_CMOV))
+ /* If host has no vector support, pass. */
+ return 0;
+
+ run_tests ();
+ return 0;
+}