1 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-O2 -msse3" } */
5 #include "../../gcc.dg/i386-cpuid.h"
7 static void sse3_test (void);
12 unsigned long cpu_facilities;
14 cpu_facilities = i386_cpuid_ecx ();
16 /* Run SSE3 test only if host has SSE3 support. */
17 if ((cpu_facilities & bit_SSE3))
24 sse3_test_movshdup_reg (float *i1, float *r)
26 __m128 t1 = _mm_loadu_ps (i1);
27 __m128 t2 = _mm_movehdup_ps (t1);
29 _mm_storeu_ps (r, t2);
33 sse3_test_movshdup_reg_subsume (float *i1, float *r)
35 __m128 t1 = _mm_load_ps (i1);
36 __m128 t2 = _mm_movehdup_ps (t1);
38 _mm_storeu_ps (r, t2);
42 chk_ps (float *v1, float *v2)
47 for (i = 0; i < 4; i++)
54 static float p1[4] __attribute__ ((aligned(16)));
58 static float vals[80] =
60 100.0, 200.0, 300.0, 400.0, 5.0, -1.0, .345, -21.5,
61 1100.0, 0.235, 321.3, 53.40, 0.3, 10.0, 42.0, 32.52,
62 32.6, 123.3, 1.234, 2.156, 0.1, 3.25, 4.75, 32.44,
63 12.16, 52.34, 64.12, 71.13, -.1, 2.30, 5.12, 3.785,
64 541.3, 321.4, 231.4, 531.4, 71., 321., 231., -531.,
65 23.45, 23.45, 23.45, 23.45, 23.45, 23.45, 23.45, 23.45,
66 23.45, -1.43, -6.74, 6.345, -20.1, -20.1, -40.1, -40.1,
67 1.234, 2.345, 3.456, 4.567, 5.678, 6.789, 7.891, 8.912,
68 -9.32, -8.41, -7.50, -6.59, -5.68, -4.77, -3.86, -2.95,
69 9.32, 8.41, 7.50, 6.59, -5.68, -4.77, -3.86, -2.95
78 for (i = 0; i < 80; i += 2)
90 sse3_test_movshdup_reg (p1, p2);
92 fail += chk_ps (ck, p2);
94 sse3_test_movshdup_reg_subsume (p1, p2);
96 fail += chk_ps (ck, p2);