2 /* { dg-options "-O2 -msse" } */
3 /* { dg-require-effective-target sse } */
15 unsigned short int s
[4];
20 void sse_tests (void) __attribute__((noinline
));
21 void dump64_16 (char *, char *, vecInWord
);
22 int check (const char *, const char *[]);
25 char comparison
[8000];
26 static int errors
= 0;
31 const char *reference_sse
[] = {
32 "_mm_shuffle_pi16 0123 4567 89ab cdef \n",
39 e64
.t
= 0x0123456789abcdefULL
;
44 check (buf
, reference_sse
);
46 printf ("sse testing:\n");
48 printf ("\ncomparison:\n");
57 void __attribute__((noinline
))
61 c64
.v
= _mm_shuffle_pi16 (m64_64
, 0x1b);
62 dump64_16 (buf
, "_mm_shuffle_pi16", c64
);
66 dump64_16 (char *buf
, char *name
, vecInWord x
)
69 char *p
= buf
+ strlen (buf
);
71 sprintf (p
, "%s ", name
);
76 sprintf (p
, "%4.4x ", x
.s
[i
]);
83 check (const char *input
, const char *reference
[])
85 int broken
, i
, j
, len
;
90 p_comparison
= &comparison
[0];
93 for (i
= 0; *reference
[i
] != '\0'; i
++)
96 len
= strlen (reference
[i
]);
97 for (j
= 0; j
< len
; j
++)
99 /* Ignore the terminating NUL characters at the end of every string in 'reference[]'. */
100 if (!broken
&& *p_input
!= reference
[i
][j
])
102 *p_comparison
= '\0';
103 strcat (p_comparison
, " >>> ");
104 p_comparison
+= strlen (p_comparison
);
108 *p_comparison
= *p_input
;
114 *p_comparison
= '\0';
115 strcat (p_comparison
, "expected:\n");
116 strcat (p_comparison
, reference
[i
]);
117 p_comparison
+= strlen (p_comparison
);
120 *p_comparison
= '\0';
121 strcat (p_comparison
, new_errors
? "failure\n\n" : "O.K.\n\n") ;
122 errors
+= new_errors
;