2 /* { dg-options "-O2 -msse" } */
14 unsigned short int s[4];
19 void sse_tests (void) __attribute__((noinline));
20 void dump64_16 (char *, char *, vecInWord);
21 int check (const char *, const char *[]);
24 char comparison[8000];
25 static int errors = 0;
30 const char *reference_sse[] = {
31 "_mm_shuffle_pi16 0123 4567 89ab cdef \n",
38 e64.t = 0x0123456789abcdefULL;
43 check (buf, reference_sse);
45 printf ("sse testing:\n");
47 printf ("\ncomparison:\n");
56 void __attribute__((noinline))
60 c64.v = _mm_shuffle_pi16 (m64_64, 0x1b);
61 dump64_16 (buf, "_mm_shuffle_pi16", c64);
65 dump64_16 (char *buf, char *name, vecInWord x)
68 char *p = buf + strlen (buf);
70 sprintf (p, "%s ", name);
75 sprintf (p, "%4.4x ", x.s[i]);
82 check (const char *input, const char *reference[])
84 int broken, i, j, len;
89 p_comparison = &comparison[0];
92 for (i = 0; *reference[i] != '\0'; i++)
95 len = strlen (reference[i]);
96 for (j = 0; j < len; j++)
98 /* Ignore the terminating NUL characters at the end of every string in 'reference[]'. */
99 if (!broken && *p_input != reference[i][j])
101 *p_comparison = '\0';
102 strcat (p_comparison, " >>> ");
103 p_comparison += strlen (p_comparison);
107 *p_comparison = *p_input;
113 *p_comparison = '\0';
114 strcat (p_comparison, "expected:\n");
115 strcat (p_comparison, reference[i]);
116 p_comparison += strlen (p_comparison);
119 *p_comparison = '\0';
120 strcat (p_comparison, new_errors ? "failure\n\n" : "O.K.\n\n") ;
121 errors += new_errors;