2 /* { dg-options "-O3 -mvsx -Wno-psabi" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target p8vector_hw } */
7 #define CHECK_H "ssse3-check.h"
11 #define TEST ssse3_test
15 #include "ssse3-vals.h"
17 #include <tmmintrin.h>
20 /* Test the 64-bit form */
22 ssse3_test_psignw (__m64
*i1
, __m64
*i2
, __m64
*r
)
24 *r
= _mm_sign_pi16 (*i1
, *i2
);
29 /* Test the 128-bit form */
31 ssse3_test_psignw128 (__m128i
*i1
, __m128i
*i2
, __m128i
*r
)
33 /* Assumes incoming pointers are 16-byte aligned */
34 *r
= _mm_sign_epi16 (*i1
, *i2
);
37 /* Routine to manually compute the results */
39 compute_correct_result (short *i1
, short *i2
, short *r
)
43 for (i
= 0; i
< 8; i
++)
56 union data r
__attribute__ ((aligned(16)));
60 for (i
= 0; i
< ARRAY_SIZE (vals
) - 1; i
++)
62 /* Manually compute the result */
63 compute_correct_result (&vals
[i
+ 0].h
[0], &vals
[i
+ 1].h
[0], &ck
.h
[0]);
66 /* Run the 64-bit tests */
67 ssse3_test_psignw (&vals
[i
+ 0].ll
[0], &vals
[i
+ 1].ll
[0], &r
.ll
[0]);
68 ssse3_test_psignw (&vals
[i
+ 0].ll
[1], &vals
[i
+ 1].ll
[1], &r
.ll
[1]);
69 fail
+= chk_128 (ck
.m
[0], r
.m
[0]);
72 /* Run the 128-bit tests */
73 ssse3_test_psignw128 (&vals
[i
+ 0].m
[0], &vals
[i
+ 1].m
[0], &r
.m
[0]);
74 fail
+= chk_128 (ck
.m
[0], r
.m
[0]);