Handle T_HRESULT types in CodeView records
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr80510-2.c
blob45993aba57aafff1fdd14f764cbf20a9ee1c2fc5
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* Now O2 enables vectorization by default, which generates unexpected VSR
4 to GPR movement for vector construction, so simply disable it. */
5 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2 -fno-tree-vectorize" } */
6 /* { dg-require-effective-target powerpc_vsx } */
8 /* Make sure that STXSSPX is generated for float scalars in Altivec registers
9 on power7 instead of moving the value to a FPR register and doing a X-FORM
10 store. */
12 #ifndef TYPE
13 #define TYPE float
14 #endif
16 #ifndef TYPE_IN
17 #define TYPE_IN TYPE
18 #endif
20 #ifndef TYPE_OUT
21 #define TYPE_OUT TYPE
22 #endif
24 #ifndef ITYPE
25 #define ITYPE __INT64_TYPE__
26 #endif
28 #ifdef DO_CALL
29 extern ITYPE get_bits (ITYPE);
31 #else
32 #define get_bits(X) (X)
33 #endif
35 void test (ITYPE *bits, ITYPE n, TYPE one, TYPE_IN *p, TYPE_OUT *q)
37 TYPE x_00 = p[ 0];
38 TYPE x_01 = p[ 1];
39 TYPE x_02 = p[ 2];
40 TYPE x_03 = p[ 3];
41 TYPE x_04 = p[ 4];
42 TYPE x_05 = p[ 5];
43 TYPE x_06 = p[ 6];
44 TYPE x_07 = p[ 7];
45 TYPE x_08 = p[ 8];
46 TYPE x_09 = p[ 9];
48 TYPE x_10 = p[10];
49 TYPE x_11 = p[11];
50 TYPE x_12 = p[12];
51 TYPE x_13 = p[13];
52 TYPE x_14 = p[14];
53 TYPE x_15 = p[15];
54 TYPE x_16 = p[16];
55 TYPE x_17 = p[17];
56 TYPE x_18 = p[18];
57 TYPE x_19 = p[19];
59 TYPE x_20 = p[20];
60 TYPE x_21 = p[21];
61 TYPE x_22 = p[22];
62 TYPE x_23 = p[23];
63 TYPE x_24 = p[24];
64 TYPE x_25 = p[25];
65 TYPE x_26 = p[26];
66 TYPE x_27 = p[27];
67 TYPE x_28 = p[28];
68 TYPE x_29 = p[29];
70 TYPE x_30 = p[30];
71 TYPE x_31 = p[31];
72 TYPE x_32 = p[32];
73 TYPE x_33 = p[33];
74 TYPE x_34 = p[34];
75 TYPE x_35 = p[35];
76 TYPE x_36 = p[36];
77 TYPE x_37 = p[37];
78 TYPE x_38 = p[38];
79 TYPE x_39 = p[39];
81 TYPE x_40 = p[40];
82 TYPE x_41 = p[41];
83 TYPE x_42 = p[42];
84 TYPE x_43 = p[43];
85 TYPE x_44 = p[44];
86 TYPE x_45 = p[45];
87 TYPE x_46 = p[46];
88 TYPE x_47 = p[47];
89 TYPE x_48 = p[48];
90 TYPE x_49 = p[49];
92 ITYPE i;
94 for (i = 0; i < n; i++)
96 ITYPE bit = get_bits (bits[i]);
98 if ((bit & ((ITYPE)1) << 0) != 0) x_00 += one;
99 if ((bit & ((ITYPE)1) << 1) != 0) x_01 += one;
100 if ((bit & ((ITYPE)1) << 2) != 0) x_02 += one;
101 if ((bit & ((ITYPE)1) << 3) != 0) x_03 += one;
102 if ((bit & ((ITYPE)1) << 4) != 0) x_04 += one;
103 if ((bit & ((ITYPE)1) << 5) != 0) x_05 += one;
104 if ((bit & ((ITYPE)1) << 6) != 0) x_06 += one;
105 if ((bit & ((ITYPE)1) << 7) != 0) x_07 += one;
106 if ((bit & ((ITYPE)1) << 8) != 0) x_08 += one;
107 if ((bit & ((ITYPE)1) << 9) != 0) x_09 += one;
109 if ((bit & ((ITYPE)1) << 10) != 0) x_10 += one;
110 if ((bit & ((ITYPE)1) << 11) != 0) x_11 += one;
111 if ((bit & ((ITYPE)1) << 12) != 0) x_12 += one;
112 if ((bit & ((ITYPE)1) << 13) != 0) x_13 += one;
113 if ((bit & ((ITYPE)1) << 14) != 0) x_14 += one;
114 if ((bit & ((ITYPE)1) << 15) != 0) x_15 += one;
115 if ((bit & ((ITYPE)1) << 16) != 0) x_16 += one;
116 if ((bit & ((ITYPE)1) << 17) != 0) x_17 += one;
117 if ((bit & ((ITYPE)1) << 18) != 0) x_18 += one;
118 if ((bit & ((ITYPE)1) << 19) != 0) x_19 += one;
120 if ((bit & ((ITYPE)1) << 20) != 0) x_20 += one;
121 if ((bit & ((ITYPE)1) << 21) != 0) x_21 += one;
122 if ((bit & ((ITYPE)1) << 22) != 0) x_22 += one;
123 if ((bit & ((ITYPE)1) << 23) != 0) x_23 += one;
124 if ((bit & ((ITYPE)1) << 24) != 0) x_24 += one;
125 if ((bit & ((ITYPE)1) << 25) != 0) x_25 += one;
126 if ((bit & ((ITYPE)1) << 26) != 0) x_26 += one;
127 if ((bit & ((ITYPE)1) << 27) != 0) x_27 += one;
128 if ((bit & ((ITYPE)1) << 28) != 0) x_28 += one;
129 if ((bit & ((ITYPE)1) << 29) != 0) x_29 += one;
131 if ((bit & ((ITYPE)1) << 30) != 0) x_30 += one;
132 if ((bit & ((ITYPE)1) << 31) != 0) x_31 += one;
133 if ((bit & ((ITYPE)1) << 32) != 0) x_32 += one;
134 if ((bit & ((ITYPE)1) << 33) != 0) x_33 += one;
135 if ((bit & ((ITYPE)1) << 34) != 0) x_34 += one;
136 if ((bit & ((ITYPE)1) << 35) != 0) x_35 += one;
137 if ((bit & ((ITYPE)1) << 36) != 0) x_36 += one;
138 if ((bit & ((ITYPE)1) << 37) != 0) x_37 += one;
139 if ((bit & ((ITYPE)1) << 38) != 0) x_38 += one;
140 if ((bit & ((ITYPE)1) << 39) != 0) x_39 += one;
142 if ((bit & ((ITYPE)1) << 40) != 0) x_40 += one;
143 if ((bit & ((ITYPE)1) << 41) != 0) x_41 += one;
144 if ((bit & ((ITYPE)1) << 42) != 0) x_42 += one;
145 if ((bit & ((ITYPE)1) << 43) != 0) x_43 += one;
146 if ((bit & ((ITYPE)1) << 44) != 0) x_44 += one;
147 if ((bit & ((ITYPE)1) << 45) != 0) x_45 += one;
148 if ((bit & ((ITYPE)1) << 46) != 0) x_46 += one;
149 if ((bit & ((ITYPE)1) << 47) != 0) x_47 += one;
150 if ((bit & ((ITYPE)1) << 48) != 0) x_48 += one;
151 if ((bit & ((ITYPE)1) << 49) != 0) x_49 += one;
154 q[ 0] = x_00;
155 q[ 1] = x_01;
156 q[ 2] = x_02;
157 q[ 3] = x_03;
158 q[ 4] = x_04;
159 q[ 5] = x_05;
160 q[ 6] = x_06;
161 q[ 7] = x_07;
162 q[ 8] = x_08;
163 q[ 9] = x_09;
165 q[10] = x_10;
166 q[11] = x_11;
167 q[12] = x_12;
168 q[13] = x_13;
169 q[14] = x_14;
170 q[15] = x_15;
171 q[16] = x_16;
172 q[17] = x_17;
173 q[18] = x_18;
174 q[19] = x_19;
176 q[20] = x_20;
177 q[21] = x_21;
178 q[22] = x_22;
179 q[23] = x_23;
180 q[24] = x_24;
181 q[25] = x_25;
182 q[26] = x_26;
183 q[27] = x_27;
184 q[28] = x_28;
185 q[29] = x_29;
187 q[30] = x_30;
188 q[31] = x_31;
189 q[32] = x_32;
190 q[33] = x_33;
191 q[34] = x_34;
192 q[35] = x_35;
193 q[36] = x_36;
194 q[37] = x_37;
195 q[38] = x_38;
196 q[39] = x_39;
198 q[40] = x_40;
199 q[41] = x_41;
200 q[42] = x_42;
201 q[43] = x_43;
202 q[44] = x_44;
203 q[45] = x_45;
204 q[46] = x_46;
205 q[47] = x_47;
206 q[48] = x_48;
207 q[49] = x_49;
210 /* { dg-final { scan-assembler {\mxsaddsp\M} } } */
211 /* { dg-final { scan-assembler {\mstxsspx\M} } } */
212 /* { dg-final { scan-assembler-not {\mmfvsrd\M} } } */
213 /* { dg-final { scan-assembler-not {\mmfvsrwz\M} } } */