2 /* { dg-options "-O3 -mpower8-vector" } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-require-effective-target p8vector_hw } */
6 #define NO_WARN_X86_INTRINSICS 1
15 __attribute__ ((noinline
))
16 check_packs_pu16 (unsigned long long int src1
, unsigned long long int src2
,
17 unsigned long long int res_ref
)
19 unsigned long long int res
;
21 res
= (unsigned long long int) _mm_packs_pu16 ((__m64
) src1
, (__m64
) src2
);
28 __attribute__ ((noinline
))
29 check_packs_pi16 (unsigned long long int src1
, unsigned long long int src2
,
30 unsigned long long int res_ref
)
32 unsigned long long int res
;
34 res
= (unsigned long long int) _mm_packs_pi16 ((__m64
) src1
, (__m64
) src2
);
42 __attribute__ ((noinline
))
43 check_packs_pi32 (unsigned long long int src1
, unsigned long long int src2
,
44 unsigned long long int res_ref
)
46 unsigned long long int res
;
48 res
= (unsigned long long int) _mm_packs_pi32 ((__m64
) src1
, (__m64
) src2
);
54 static unsigned long long int src1
[] =
55 { 0xffff0000fffe0000UL
, 0x0001000000020000UL
, 0xfffffffffffffffeUL
,
56 0x0000000100000002UL
, 0x0001000200030004UL
, 0xfffffffefffdfffcUL
,
57 0x0100020003000400UL
, 0xff00fe01fe02fe03UL
};
59 static unsigned long long int src2
[] =
60 { 0xfffffffdfffffffcUL
, 0x0000000200000003UL
, 0xfffffffdfffffffcUL
,
61 0x0000000300000004UL
, 0x0005000600070008UL
, 0xfffbfffafff9fff8UL
,
62 0x0005000600070008UL
, 0xfffbfffafff9fff8UL
};
64 static unsigned long long int res_pi16
[] =
65 { 0xfffdfffcff00fe00UL
, 0x0002000301000200UL
, 0xfffdfffcfffffffeUL
,
66 0x0003000400010002UL
, 0x0506070801020304UL
, 0xfbfaf9f8fffefdfcUL
,
67 0x050607087f7f7f7fUL
, 0xfbfaf9f880808080UL
};
69 static unsigned long long int res_pi32
[] =
70 { 0xfffdfffc80008000UL
, 0x000200037fff7fffUL
, 0xfffdfffcfffffffeUL
,
71 0x0003000400010002UL
, 0x7fff7fff7fff7fffUL
, 0x80008000fffe8000UL
,
72 0x7fff7fff7fff7fffUL
, 0x8000800080008000UL
};
74 static unsigned long long int res_pu16
[] =
75 { 0x0000000000000000UL
, 0x0002000301000200UL
, 0x0000000000000000UL
,
76 0x0003000400010002UL
, 0x0506070801020304UL
, 0x000000000000000UL
,
77 0x5060708ffffffffUL
, 0x0000000000000000UL
};
84 for (i
= 0; i
< 8; i
++)
86 check_packs_pu16 (src1
[i
], src2
[i
], res_pu16
[i
]);
87 check_packs_pi16 (src1
[i
], src2
[i
], res_pi16
[i
]);
88 check_packs_pi32 (src1
[i
], src2
[i
], res_pi32
[i
]);