2 /* { dg-require-effective-target ssse3 } */
3 /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
5 #include "ssse3-check.h"
6 #include "ssse3-vals.h"
10 /* Test the 64-bit form */
12 ssse3_test_pabsd (int *i1, int *r)
14 __m64 t1 = *(__m64 *) i1;
15 *(__m64 *) r = _mm_abs_pi32 (t1);
19 /* Test the 128-bit form */
21 ssse3_test_pabsd128 (int *i1, int *r)
23 /* Assumes incoming pointers are 16-byte aligned */
24 __m128i t1 = *(__m128i *) i1;
25 *(__m128i *) r = _mm_abs_epi32 (t1);
28 /* Routine to manually compute the results */
30 compute_correct_result (int *i1, int *r)
34 for (i = 0; i < 4; i++)
45 int r [4] __attribute__ ((aligned(16)));
49 for (i = 0; i < 256; i += 4)
51 /* Manually compute the result */
52 compute_correct_result(&vals[i + 0], ck);
54 /* Run the 64-bit tests */
55 ssse3_test_pabsd (&vals[i + 0], &r[0]);
56 ssse3_test_pabsd (&vals[i + 2], &r[2]);
57 fail += chk_128 (ck, r);
59 /* Run the 128-bit tests */
60 ssse3_test_pabsd128 (&vals[i + 0], r);
61 fail += chk_128(ck, r);