2 /* { dg-options "-O2 -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 "sse4_1-check.h"
11 #define TEST sse4_1_test
16 #include <smmintrin.h>
46 unsigned char ins
[4] = { 3, 4, 5, 6 };
49 val
.i
[0] = 0x35251505;
50 val
.i
[1] = 0x75655545;
51 val
.i
[2] = 0xB5A59585;
52 val
.i
[3] = 0xF5E5D5C5;
54 /* Check pinsrb imm8, r32, xmm. */
55 res
[0].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk0
);
56 res
[1].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk1
);
57 res
[2].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk2
);
58 res
[3].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk3
);
59 res
[4].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk4
);
60 res
[5].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk5
);
61 res
[6].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk6
);
62 res
[7].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk7
);
63 res
[8].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk8
);
64 res
[9].x
= _mm_insert_epi8 (val
.x
, ins
[0], msk9
);
65 res
[10].x
= _mm_insert_epi8 (val
.x
, ins
[0], mskA
);
66 res
[11].x
= _mm_insert_epi8 (val
.x
, ins
[0], mskB
);
67 res
[12].x
= _mm_insert_epi8 (val
.x
, ins
[0], mskC
);
68 res
[13].x
= _mm_insert_epi8 (val
.x
, ins
[0], mskD
);
69 res
[14].x
= _mm_insert_epi8 (val
.x
, ins
[0], mskE
);
70 res
[15].x
= _mm_insert_epi8 (val
.x
, ins
[0], mskF
);
89 for (i
= 0; i
< 16; i
++)
92 tmp
.c
[masks
[i
]] = ins
[0];
93 if (memcmp (&tmp
, &res
[i
], sizeof (tmp
)))
97 /* Check pinsrb imm8, m8, xmm. */
98 for (i
= 0; i
< 16; i
++)
100 res
[i
].x
= _mm_insert_epi8 (val
.x
, ins
[i
% 4], msk0
);
104 for (i
= 0; i
< 16; i
++)
107 tmp
.c
[masks
[i
]] = ins
[i
% 4];
108 if (memcmp (&tmp
, &res
[i
], sizeof (tmp
)))