Handle T_HRESULT types in CodeView records
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse4_1-pinsrb.c
blob66d8815778c36ffc3dffdc0eb4fcc1219ef1e95b
1 /* { dg-do run } */
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 } */
6 #ifndef CHECK_H
7 #define CHECK_H "sse4_1-check.h"
8 #endif
10 #ifndef TEST
11 #define TEST sse4_1_test
12 #endif
14 #include CHECK_H
16 #include <smmintrin.h>
17 #include <string.h>
19 #define msk0 0x00
20 #define msk1 0x01
21 #define msk2 0x02
22 #define msk3 0x03
23 #define msk4 0x04
24 #define msk5 0x05
25 #define msk6 0x06
26 #define msk7 0x07
27 #define msk8 0x08
28 #define msk9 0x09
29 #define mskA 0x0A
30 #define mskB 0x0B
31 #define mskC 0x0C
32 #define mskD 0x0D
33 #define mskE 0x0E
34 #define mskF 0x0F
36 static void
37 TEST (void)
39 union
41 __m128i x;
42 unsigned int i[4];
43 unsigned char c[16];
44 } res [16], val, tmp;
45 int masks[16];
46 unsigned char ins[4] = { 3, 4, 5, 6 };
47 int i;
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);
72 masks[0] = msk0;
73 masks[1] = msk1;
74 masks[2] = msk2;
75 masks[3] = msk3;
76 masks[4] = msk4;
77 masks[5] = msk5;
78 masks[6] = msk6;
79 masks[7] = msk7;
80 masks[8] = msk8;
81 masks[9] = msk9;
82 masks[10] = mskA;
83 masks[11] = mskB;
84 masks[12] = mskC;
85 masks[13] = mskD;
86 masks[14] = mskE;
87 masks[15] = mskF;
89 for (i = 0; i < 16; i++)
91 tmp.x = val.x;
92 tmp.c[masks[i]] = ins[0];
93 if (memcmp (&tmp, &res[i], sizeof (tmp)))
94 abort ();
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);
101 masks[i] = msk0;
104 for (i = 0; i < 16; i++)
106 tmp.x = val.x;
107 tmp.c[masks[i]] = ins[i % 4];
108 if (memcmp (&tmp, &res[i], sizeof (tmp)))
109 abort ();