2 /* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-require-effective-target p8vector_hw } */
7 #define CHECK_H "sse2-check.h"
13 #define TEST sse2_test_pinsrw_1
16 #include <emmintrin.h>
38 unsigned short ins
[4] = { 3, 4, 5, 6 };
41 val
.i
[0] = 0x35251505;
42 val
.i
[1] = 0x75655545;
43 val
.i
[2] = 0xB5A59585;
44 val
.i
[3] = 0xF5E5D5C5;
46 /* Check pinsrw imm8, r32, xmm. */
47 res
[0].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk0
);
48 res
[1].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk1
);
49 res
[2].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk2
);
50 res
[3].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk3
);
51 res
[4].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk4
);
52 res
[5].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk5
);
53 res
[6].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk6
);
54 res
[7].x
= _mm_insert_epi16 (val
.x
, ins
[0], msk7
);
65 for (i
= 0; i
< 8; i
++)
68 tmp
.s
[masks
[i
]] = ins
[0];
69 if (memcmp (&tmp
, &res
[i
], sizeof (tmp
)))
73 /* Check pinsrw imm8, m16, xmm. */
74 for (i
= 0; i
< 8; i
++)
76 res
[i
].x
= _mm_insert_epi16 (val
.x
, ins
[i
% 2], msk0
);
80 for (i
= 0; i
< 8; i
++)
83 tmp
.s
[masks
[i
]] = ins
[i
% 2];
84 if (memcmp (&tmp
, &res
[i
], sizeof (tmp
)))