3684
|
1 # This file is part of MXE. |
|
2 # See index.html for further information. |
|
3 |
|
4 This patch has been taken from: |
|
5 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56038 |
|
6 |
|
7 diff --git a/gcc/config/i386/adxintrin.h b/gcc/config/i386/adxintrin.h |
|
8 index 6118900..a83410d 100644 |
|
9 --- a/gcc/config/i386/adxintrin.h |
|
10 +++ b/gcc/config/i386/adxintrin.h |
|
11 @@ -28,6 +28,10 @@ |
|
12 #ifndef _ADXINTRIN_H_INCLUDED |
|
13 #define _ADXINTRIN_H_INCLUDED |
|
14 |
|
15 +#ifdef __cplusplus |
|
16 +extern "C" { |
|
17 +#endif |
|
18 + |
|
19 extern __inline unsigned char |
|
20 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
21 _addcarryx_u32 (unsigned char __CF, unsigned int __X, |
|
22 @@ -46,4 +50,8 @@ _addcarryx_u64 (unsigned char __CF, unsigned long __X, |
|
23 } |
|
24 #endif |
|
25 |
|
26 +#ifdef __cplusplus |
|
27 +} |
|
28 +#endif |
|
29 + |
|
30 #endif /* _ADXINTRIN_H_INCLUDED */ |
|
31 diff --git a/gcc/config/i386/ammintrin.h b/gcc/config/i386/ammintrin.h |
|
32 index a89b204..a370eb0 100644 |
|
33 --- a/gcc/config/i386/ammintrin.h |
|
34 +++ b/gcc/config/i386/ammintrin.h |
|
35 @@ -36,6 +36,10 @@ |
|
36 #define __DISABLE_SSE4A__ |
|
37 #endif /* __SSE4A__ */ |
|
38 |
|
39 +#ifdef __cplusplus |
|
40 +extern "C" { |
|
41 +#endif |
|
42 + |
|
43 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
44 _mm_stream_sd (double * __P, __m128d __Y) |
|
45 { |
|
46 @@ -85,6 +89,10 @@ _mm_inserti_si64(__m128i __X, __m128i __Y, unsigned const int __I, unsigned cons |
|
47 (unsigned int)(I), (unsigned int)(L))) |
|
48 #endif |
|
49 |
|
50 +#ifdef __cplusplus |
|
51 +} |
|
52 +#endif |
|
53 + |
|
54 #ifdef __DISABLE_SSE4A__ |
|
55 #undef __DISABLE_SSE4A__ |
|
56 #pragma GCC pop_options |
|
57 diff --git a/gcc/config/i386/avx2intrin.h b/gcc/config/i386/avx2intrin.h |
|
58 index d04c972..9302273 100644 |
|
59 --- a/gcc/config/i386/avx2intrin.h |
|
60 +++ b/gcc/config/i386/avx2intrin.h |
|
61 @@ -34,6 +34,10 @@ |
|
62 #define __DISABLE_AVX2__ |
|
63 #endif /* __AVX2__ */ |
|
64 |
|
65 +#ifdef __cplusplus |
|
66 +extern "C" { |
|
67 +#endif |
|
68 + |
|
69 /* Sum absolute 8-bit integer difference of adjacent groups of 4 |
|
70 byte integers in the first 2 operands. Starting offsets within |
|
71 operands are determined by the 3rd mask operand. */ |
|
72 @@ -1887,3 +1891,8 @@ _mm256_mask_i64gather_epi32 (__m128i src, int const *base, |
|
73 #endif /* __DISABLE_AVX2__ */ |
|
74 |
|
75 #endif /* _AVX2INTRIN_H_INCLUDED */ |
|
76 + |
|
77 +#ifdef __cplusplus |
|
78 +} |
|
79 +#endif |
|
80 + |
|
81 diff --git a/gcc/config/i386/avxintrin.h b/gcc/config/i386/avxintrin.h |
|
82 index 2ea327c..32591da 100644 |
|
83 --- a/gcc/config/i386/avxintrin.h |
|
84 +++ b/gcc/config/i386/avxintrin.h |
|
85 @@ -37,6 +37,10 @@ |
|
86 #define __DISABLE_AVX__ |
|
87 #endif /* __AVX__ */ |
|
88 |
|
89 +#ifdef __cplusplus |
|
90 +extern "C" { |
|
91 +#endif |
|
92 + |
|
93 /* Internal data types for implementing the intrinsics. */ |
|
94 typedef double __v4df __attribute__ ((__vector_size__ (32))); |
|
95 typedef float __v8sf __attribute__ ((__vector_size__ (32))); |
|
96 @@ -1461,3 +1465,8 @@ _mm256_castsi128_si256 (__m128i __A) |
|
97 #endif /* __DISABLE_AVX__ */ |
|
98 |
|
99 #endif /* _AVXINTRIN_H_INCLUDED */ |
|
100 + |
|
101 +#ifdef __cplusplus |
|
102 +} |
|
103 +#endif |
|
104 + |
|
105 diff --git a/gcc/config/i386/bmi2intrin.h b/gcc/config/i386/bmi2intrin.h |
|
106 index ff96296..b01e1e1 100644 |
|
107 --- a/gcc/config/i386/bmi2intrin.h |
|
108 +++ b/gcc/config/i386/bmi2intrin.h |
|
109 @@ -34,6 +34,10 @@ |
|
110 #define __DISABLE_BMI2__ |
|
111 #endif /* __BMI2__ */ |
|
112 |
|
113 +#ifdef __cplusplus |
|
114 +extern "C" { |
|
115 +#endif |
|
116 + |
|
117 extern __inline unsigned int |
|
118 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
119 _bzhi_u32 (unsigned int __X, unsigned int __Y) |
|
120 @@ -106,4 +110,8 @@ _mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P) |
|
121 #pragma GCC pop_options |
|
122 #endif /* __DISABLE_BMI2__ */ |
|
123 |
|
124 +#ifdef __cplusplus |
|
125 +} |
|
126 +#endif |
|
127 + |
|
128 #endif /* _BMI2INTRIN_H_INCLUDED */ |
|
129 diff --git a/gcc/config/i386/bmiintrin.h b/gcc/config/i386/bmiintrin.h |
|
130 index b2d7c60..c8ad38a 100644 |
|
131 --- a/gcc/config/i386/bmiintrin.h |
|
132 +++ b/gcc/config/i386/bmiintrin.h |
|
133 @@ -34,6 +34,10 @@ |
|
134 #define __DISABLE_BMI__ |
|
135 #endif /* __BMI__ */ |
|
136 |
|
137 +#ifdef __cplusplus |
|
138 +extern "C" { |
|
139 +#endif |
|
140 + |
|
141 extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
142 __tzcnt_u16 (unsigned short __X) |
|
143 { |
|
144 @@ -181,4 +185,8 @@ _tzcnt_u64 (unsigned long long __X) |
|
145 #pragma GCC pop_options |
|
146 #endif /* __DISABLE_BMI__ */ |
|
147 |
|
148 +#ifdef __cplusplus |
|
149 +} |
|
150 +#endif |
|
151 + |
|
152 #endif /* _BMIINTRIN_H_INCLUDED */ |
|
153 diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h |
|
154 index 8c323ae..52047e3 100644 |
|
155 --- a/gcc/config/i386/cpuid.h |
|
156 +++ b/gcc/config/i386/cpuid.h |
|
157 @@ -21,6 +21,10 @@ |
|
158 * <http://www.gnu.org/licenses/>. |
|
159 */ |
|
160 |
|
161 +#ifdef __cplusplus |
|
162 +extern "C" { |
|
163 +#endif |
|
164 + |
|
165 /* %ecx */ |
|
166 #define bit_SSE3 (1 << 0) |
|
167 #define bit_PCLMUL (1 << 1) |
|
168 @@ -275,3 +279,8 @@ __get_cpuid (unsigned int __level, |
|
169 __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx); |
|
170 return 1; |
|
171 } |
|
172 + |
|
173 +#ifdef __cplusplus |
|
174 +} |
|
175 +#endif |
|
176 + |
|
177 diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h |
|
178 index a2bdf0e..2c4af53 100644 |
|
179 --- a/gcc/config/i386/emmintrin.h |
|
180 +++ b/gcc/config/i386/emmintrin.h |
|
181 @@ -36,6 +36,10 @@ |
|
182 #define __DISABLE_SSE2__ |
|
183 #endif /* __SSE2__ */ |
|
184 |
|
185 +#ifdef __cplusplus |
|
186 +extern "C" { |
|
187 +#endif |
|
188 + |
|
189 /* SSE2 */ |
|
190 typedef double __v2df __attribute__ ((__vector_size__ (16))); |
|
191 typedef long long __v2di __attribute__ ((__vector_size__ (16))); |
|
192 @@ -1515,6 +1519,10 @@ _mm_castps_pd(__m128 __A) |
|
193 return (__m128d) __A; |
|
194 } |
|
195 |
|
196 +#ifdef __cplusplus |
|
197 +} |
|
198 +#endif |
|
199 + |
|
200 extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
201 _mm_castps_si128(__m128 __A) |
|
202 { |
|
203 diff --git a/gcc/config/i386/f16cintrin.h b/gcc/config/i386/f16cintrin.h |
|
204 index 1181f8b..5cc37dd 100644 |
|
205 --- a/gcc/config/i386/f16cintrin.h |
|
206 +++ b/gcc/config/i386/f16cintrin.h |
|
207 @@ -34,6 +34,10 @@ |
|
208 #define __DISABLE_F16C__ |
|
209 #endif /* __F16C__ */ |
|
210 |
|
211 +#ifdef __cplusplus |
|
212 +extern "C" { |
|
213 +#endif |
|
214 + |
|
215 extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
216 _cvtsh_ss (unsigned short __S) |
|
217 { |
|
218 @@ -95,4 +99,8 @@ _mm256_cvtps_ph (__m256 __A, const int __I) |
|
219 #pragma GCC pop_options |
|
220 #endif /* __DISABLE_F16C__ */ |
|
221 |
|
222 +#ifdef __cplusplus |
|
223 +} |
|
224 +#endif |
|
225 + |
|
226 #endif /* _F16CINTRIN_H_INCLUDED */ |
|
227 diff --git a/gcc/config/i386/fma4intrin.h b/gcc/config/i386/fma4intrin.h |
|
228 index e1bdef7..0ee2bf8 100644 |
|
229 --- a/gcc/config/i386/fma4intrin.h |
|
230 +++ b/gcc/config/i386/fma4intrin.h |
|
231 @@ -37,6 +37,10 @@ |
|
232 #define __DISABLE_FMA4__ |
|
233 #endif /* __FMA4__ */ |
|
234 |
|
235 +#ifdef __cplusplus |
|
236 +extern "C" { |
|
237 +#endif |
|
238 + |
|
239 /* 128b Floating point multiply/add type instructions. */ |
|
240 extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
241 _mm_macc_ps (__m128 __A, __m128 __B, __m128 __C) |
|
242 @@ -233,6 +237,10 @@ _mm256_msubadd_pd (__m256d __A, __m256d __B, __m256d __C) |
|
243 return (__m256d) __builtin_ia32_vfmaddsubpd256 ((__v4df)__A, (__v4df)__B, -(__v4df)__C); |
|
244 } |
|
245 |
|
246 +#ifdef __cplusplus |
|
247 +} |
|
248 +#endif |
|
249 + |
|
250 #ifdef __DISABLE_FMA4__ |
|
251 #undef __DISABLE_FMA4__ |
|
252 #pragma GCC pop_options |
|
253 diff --git a/gcc/config/i386/fmaintrin.h b/gcc/config/i386/fmaintrin.h |
|
254 index bfbb75d..806ff8e 100644 |
|
255 --- a/gcc/config/i386/fmaintrin.h |
|
256 +++ b/gcc/config/i386/fmaintrin.h |
|
257 @@ -34,6 +34,10 @@ |
|
258 #define __DISABLE_FMA__ |
|
259 #endif /* __FMA__ */ |
|
260 |
|
261 +#ifdef __cplusplus |
|
262 +extern "C" { |
|
263 +#endif |
|
264 + |
|
265 extern __inline __m128d |
|
266 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
267 _mm_fmadd_pd (__m128d __A, __m128d __B, __m128d __C) |
|
268 @@ -294,6 +298,10 @@ _mm256_fmsubadd_ps (__m256 __A, __m256 __B, __m256 __C) |
|
269 -(__v8sf)__C); |
|
270 } |
|
271 |
|
272 +#ifdef __cplusplus |
|
273 +} |
|
274 +#endif |
|
275 + |
|
276 #ifdef __DISABLE_FMA__ |
|
277 #undef __DISABLE_FMA__ |
|
278 #pragma GCC pop_options |
|
279 diff --git a/gcc/config/i386/fxsrintrin.h b/gcc/config/i386/fxsrintrin.h |
|
280 index 98e73ee..34cc3cb 100644 |
|
281 --- a/gcc/config/i386/fxsrintrin.h |
|
282 +++ b/gcc/config/i386/fxsrintrin.h |
|
283 @@ -34,6 +34,10 @@ |
|
284 #define __DISABLE_FXSR__ |
|
285 #endif /* __FXSR__ */ |
|
286 |
|
287 +#ifdef __cplusplus |
|
288 +extern "C" { |
|
289 +#endif |
|
290 + |
|
291 extern __inline void |
|
292 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
293 _fxsave (void *__P) |
|
294 @@ -70,4 +74,8 @@ _fxrstor64 (void *__P) |
|
295 #endif /* __DISABLE_FXSR__ */ |
|
296 |
|
297 |
|
298 +#ifdef __cplusplus |
|
299 +} |
|
300 +#endif |
|
301 + |
|
302 #endif /* _FXSRINTRIN_H_INCLUDED */ |
|
303 diff --git a/gcc/config/i386/gmm_malloc.h b/gcc/config/i386/gmm_malloc.h |
|
304 index 516b13b..c55db44 100644 |
|
305 --- a/gcc/config/i386/gmm_malloc.h |
|
306 +++ b/gcc/config/i386/gmm_malloc.h |
|
307 @@ -27,6 +27,10 @@ |
|
308 #include <stdlib.h> |
|
309 #include <errno.h> |
|
310 |
|
311 +#ifdef __cplusplus |
|
312 +extern "C" { |
|
313 +#endif |
|
314 + |
|
315 static __inline__ void* |
|
316 _mm_malloc (size_t size, size_t align) |
|
317 { |
|
318 @@ -71,4 +75,8 @@ _mm_free (void * aligned_ptr) |
|
319 free (((void **) aligned_ptr) [-1]); |
|
320 } |
|
321 |
|
322 +#ifdef __cplusplus |
|
323 +} |
|
324 +#endif |
|
325 + |
|
326 #endif /* _MM_MALLOC_H_INCLUDED */ |
|
327 diff --git a/gcc/config/i386/ia32intrin.h b/gcc/config/i386/ia32intrin.h |
|
328 index 5e7c893..a7fa538 100644 |
|
329 --- a/gcc/config/i386/ia32intrin.h |
|
330 +++ b/gcc/config/i386/ia32intrin.h |
|
331 @@ -25,6 +25,10 @@ |
|
332 # error "Never use <ia32intrin.h> directly; include <x86intrin.h> instead." |
|
333 #endif |
|
334 |
|
335 +#ifdef __cplusplus |
|
336 +extern "C" { |
|
337 +#endif |
|
338 + |
|
339 /* 32bit bsf */ |
|
340 extern __inline int |
|
341 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
342 @@ -291,3 +295,7 @@ __writeeflags (unsigned int X) |
|
343 #define _rotwr(a,b) __rorw((a), (b)) |
|
344 #define _rotl(a,b) __rold((a), (b)) |
|
345 #define _rotr(a,b) __rord((a), (b)) |
|
346 + |
|
347 +#ifdef __cplusplus |
|
348 +} |
|
349 +#endif |
|
350 diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h |
|
351 index 73b4859..49a03e4 100644 |
|
352 --- a/gcc/config/i386/immintrin.h |
|
353 +++ b/gcc/config/i386/immintrin.h |
|
354 @@ -78,6 +78,10 @@ _rdrand16_step (unsigned short *__P) |
|
355 return __builtin_ia32_rdrand16_step (__P); |
|
356 } |
|
357 |
|
358 +#ifdef __cplusplus |
|
359 +extern "C" { |
|
360 +#endif |
|
361 + |
|
362 extern __inline int |
|
363 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
364 _rdrand32_step (unsigned int *__P) |
|
365 @@ -174,4 +178,8 @@ _rdrand64_step (unsigned long long *__P) |
|
366 |
|
367 #endif /* __x86_64__ */ |
|
368 |
|
369 +#ifdef __cplusplus |
|
370 +} |
|
371 +#endif |
|
372 + |
|
373 #endif /* _IMMINTRIN_H_INCLUDED */ |
|
374 diff --git a/gcc/config/i386/lwpintrin.h b/gcc/config/i386/lwpintrin.h |
|
375 index 1cd046a..26d65f1 100644 |
|
376 --- a/gcc/config/i386/lwpintrin.h |
|
377 +++ b/gcc/config/i386/lwpintrin.h |
|
378 @@ -34,6 +34,10 @@ |
|
379 #define __DISABLE_LWP__ |
|
380 #endif /* __LWP__ */ |
|
381 |
|
382 +#ifdef __cplusplus |
|
383 +extern "C" { |
|
384 +#endif |
|
385 + |
|
386 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
387 __llwpcb (void *pcbAddress) |
|
388 { |
|
389 @@ -71,6 +75,9 @@ __lwpval64 (unsigned long long data2, unsigned int data1, unsigned int flags) |
|
390 #endif |
|
391 #endif |
|
392 |
|
393 +#ifdef __cplusplus |
|
394 +} |
|
395 +#endif |
|
396 |
|
397 #ifdef __OPTIMIZE__ |
|
398 extern __inline unsigned char __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
399 diff --git a/gcc/config/i386/lzcntintrin.h b/gcc/config/i386/lzcntintrin.h |
|
400 index b680a35..d292f24 100644 |
|
401 --- a/gcc/config/i386/lzcntintrin.h |
|
402 +++ b/gcc/config/i386/lzcntintrin.h |
|
403 @@ -35,6 +35,10 @@ |
|
404 #define __DISABLE_LZCNT__ |
|
405 #endif /* __LZCNT__ */ |
|
406 |
|
407 +#ifdef __cplusplus |
|
408 +extern "C" { |
|
409 +#endif |
|
410 + |
|
411 extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
412 __lzcnt16 (unsigned short __X) |
|
413 { |
|
414 @@ -72,4 +76,8 @@ _lzcnt_u64 (unsigned long long __X) |
|
415 #pragma GCC pop_options |
|
416 #endif /* __DISABLE_LZCNT__ */ |
|
417 |
|
418 +#ifdef __cplusplus |
|
419 +} |
|
420 +#endif |
|
421 + |
|
422 #endif /* _LZCNTINTRIN_H_INCLUDED */ |
|
423 diff --git a/gcc/config/i386/mm3dnow.h b/gcc/config/i386/mm3dnow.h |
|
424 index bf847f9..464e98f 100644 |
|
425 --- a/gcc/config/i386/mm3dnow.h |
|
426 +++ b/gcc/config/i386/mm3dnow.h |
|
427 @@ -36,6 +36,10 @@ |
|
428 #define __DISABLE_3dNOW__ |
|
429 #endif /* __3dNOW__ */ |
|
430 |
|
431 +#ifdef __cplusplus |
|
432 +extern "C" { |
|
433 +#endif |
|
434 + |
|
435 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
436 _m_femms (void) |
|
437 { |
|
438 @@ -210,6 +214,10 @@ _m_pswapd (__m64 __A) |
|
439 |
|
440 #endif /* __3dNOW_A__ */ |
|
441 |
|
442 +#ifdef __cplusplus |
|
443 +} |
|
444 +#endif |
|
445 + |
|
446 #ifdef __DISABLE_3dNOW__ |
|
447 #undef __DISABLE_3dNOW__ |
|
448 #pragma GCC pop_options |
|
449 diff --git a/gcc/config/i386/mmintrin.h b/gcc/config/i386/mmintrin.h |
|
450 index b351200..eaee690 100644 |
|
451 --- a/gcc/config/i386/mmintrin.h |
|
452 +++ b/gcc/config/i386/mmintrin.h |
|
453 @@ -33,6 +33,10 @@ |
|
454 #define __DISABLE_MMX__ |
|
455 #endif /* __MMX__ */ |
|
456 |
|
457 +#ifdef __cplusplus |
|
458 +extern "C" { |
|
459 +#endif |
|
460 + |
|
461 /* The Intel API is flexible enough that we must allow aliasing with other |
|
462 vector types, and their scalar components. */ |
|
463 typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); |
|
464 @@ -939,4 +943,8 @@ _mm_set1_pi8 (char __b) |
|
465 #pragma GCC pop_options |
|
466 #endif /* __DISABLE_MMX__ */ |
|
467 |
|
468 +#ifdef __cplusplus |
|
469 +} |
|
470 +#endif |
|
471 + |
|
472 #endif /* _MMINTRIN_H_INCLUDED */ |
|
473 diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h |
|
474 index 3be2f35..f8c99c7 100644 |
|
475 --- a/gcc/config/i386/pmm_malloc.h |
|
476 +++ b/gcc/config/i386/pmm_malloc.h |
|
477 @@ -34,6 +34,10 @@ extern int posix_memalign (void **, size_t, size_t); |
|
478 extern "C" int posix_memalign (void **, size_t, size_t) throw (); |
|
479 #endif |
|
480 |
|
481 +#ifdef __cplusplus |
|
482 +extern "C" { |
|
483 +#endif |
|
484 + |
|
485 static __inline void * |
|
486 _mm_malloc (size_t size, size_t alignment) |
|
487 { |
|
488 @@ -54,4 +58,8 @@ _mm_free (void * ptr) |
|
489 free (ptr); |
|
490 } |
|
491 |
|
492 +#ifdef __cplusplus |
|
493 +} |
|
494 +#endif |
|
495 + |
|
496 #endif /* _MM_MALLOC_H_INCLUDED */ |
|
497 diff --git a/gcc/config/i386/pmmintrin.h b/gcc/config/i386/pmmintrin.h |
|
498 index 6a79500..2c98a85 100644 |
|
499 --- a/gcc/config/i386/pmmintrin.h |
|
500 +++ b/gcc/config/i386/pmmintrin.h |
|
501 @@ -36,6 +36,10 @@ |
|
502 #define __DISABLE_SSE3__ |
|
503 #endif /* __SSE3__ */ |
|
504 |
|
505 +#ifdef __cplusplus |
|
506 +extern "C" { |
|
507 +#endif |
|
508 + |
|
509 /* Additional bits in the MXCSR. */ |
|
510 #define _MM_DENORMALS_ZERO_MASK 0x0040 |
|
511 #define _MM_DENORMALS_ZERO_ON 0x0040 |
|
512 @@ -124,6 +128,10 @@ _mm_mwait (unsigned int __E, unsigned int __H) |
|
513 __builtin_ia32_mwait (__E, __H); |
|
514 } |
|
515 |
|
516 +#ifdef __cplusplus |
|
517 +} |
|
518 +#endif |
|
519 + |
|
520 #ifdef __DISABLE_SSE3__ |
|
521 #undef __DISABLE_SSE3__ |
|
522 #pragma GCC pop_options |
|
523 diff --git a/gcc/config/i386/popcntintrin.h b/gcc/config/i386/popcntintrin.h |
|
524 index 41845d8..285e96a 100644 |
|
525 --- a/gcc/config/i386/popcntintrin.h |
|
526 +++ b/gcc/config/i386/popcntintrin.h |
|
527 @@ -30,6 +30,10 @@ |
|
528 #define __DISABLE_POPCNT__ |
|
529 #endif /* __POPCNT__ */ |
|
530 |
|
531 +#ifdef __cplusplus |
|
532 +extern "C" { |
|
533 +#endif |
|
534 + |
|
535 /* Calculate a number of bits set to 1. */ |
|
536 extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
537 _mm_popcnt_u32 (unsigned int __X) |
|
538 @@ -50,4 +54,8 @@ _mm_popcnt_u64 (unsigned long long __X) |
|
539 #pragma GCC pop_options |
|
540 #endif /* __DISABLE_POPCNT__ */ |
|
541 |
|
542 +#ifdef __cplusplus |
|
543 +} |
|
544 +#endif |
|
545 + |
|
546 #endif /* _POPCNTINTRIN_H_INCLUDED */ |
|
547 diff --git a/gcc/config/i386/prfchwintrin.h b/gcc/config/i386/prfchwintrin.h |
|
548 index b2f5772..f779a28 100644 |
|
549 --- a/gcc/config/i386/prfchwintrin.h |
|
550 +++ b/gcc/config/i386/prfchwintrin.h |
|
551 @@ -28,10 +28,18 @@ |
|
552 #ifndef _PRFCHWINTRIN_H_INCLUDED |
|
553 #define _PRFCHWINTRIN_H_INCLUDED |
|
554 |
|
555 +#ifdef __cplusplus |
|
556 +extern "C" { |
|
557 +#endif |
|
558 + |
|
559 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
560 _m_prefetchw (void *__P) |
|
561 { |
|
562 __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); |
|
563 } |
|
564 |
|
565 +#ifdef __cplusplus |
|
566 +} |
|
567 +#endif |
|
568 + |
|
569 #endif /* _PRFCHWINTRIN_H_INCLUDED */ |
|
570 diff --git a/gcc/config/i386/rdseedintrin.h b/gcc/config/i386/rdseedintrin.h |
|
571 index 0ab18e5..98eb318 100644 |
|
572 --- a/gcc/config/i386/rdseedintrin.h |
|
573 +++ b/gcc/config/i386/rdseedintrin.h |
|
574 @@ -35,6 +35,10 @@ |
|
575 #endif /* __RDSEED__ */ |
|
576 |
|
577 |
|
578 +#ifdef __cplusplus |
|
579 +extern "C" { |
|
580 +#endif |
|
581 + |
|
582 extern __inline int |
|
583 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
584 _rdseed16_step (unsigned short *p) |
|
585 @@ -63,4 +67,8 @@ _rdseed64_step (unsigned long long *p) |
|
586 #pragma GCC pop_options |
|
587 #endif /* __DISABLE_RDSEED__ */ |
|
588 |
|
589 +#ifdef __cplusplus |
|
590 +} |
|
591 +#endif |
|
592 + |
|
593 #endif /* _RDSEEDINTRIN_H_INCLUDED */ |
|
594 diff --git a/gcc/config/i386/rtmintrin.h b/gcc/config/i386/rtmintrin.h |
|
595 index ac40d22..3aa8246 100644 |
|
596 --- a/gcc/config/i386/rtmintrin.h |
|
597 +++ b/gcc/config/i386/rtmintrin.h |
|
598 @@ -34,6 +34,10 @@ |
|
599 #define __DISABLE_RTM__ |
|
600 #endif /* __RTM__ */ |
|
601 |
|
602 +#ifdef __cplusplus |
|
603 +extern "C" { |
|
604 +#endif |
|
605 + |
|
606 #define _XBEGIN_STARTED (~0u) |
|
607 #define _XABORT_EXPLICIT (1 << 0) |
|
608 #define _XABORT_RETRY (1 << 1) |
|
609 @@ -81,4 +85,8 @@ _xabort (const unsigned int imm) |
|
610 #pragma GCC pop_options |
|
611 #endif /* __DISABLE_RTM__ */ |
|
612 |
|
613 +#ifdef __cplusplus |
|
614 +} |
|
615 +#endif |
|
616 + |
|
617 #endif /* _RTMINTRIN_H_INCLUDED */ |
|
618 diff --git a/gcc/config/i386/smmintrin.h b/gcc/config/i386/smmintrin.h |
|
619 index 886ace4..168b903 100644 |
|
620 --- a/gcc/config/i386/smmintrin.h |
|
621 +++ b/gcc/config/i386/smmintrin.h |
|
622 @@ -37,6 +37,10 @@ |
|
623 #define __DISABLE_SSE4_1__ |
|
624 #endif /* __SSE4_1__ */ |
|
625 |
|
626 +#ifdef __cplusplus |
|
627 +extern "C" { |
|
628 +#endif |
|
629 + |
|
630 /* Rounding mode macros. */ |
|
631 #define _MM_FROUND_TO_NEAREST_INT 0x00 |
|
632 #define _MM_FROUND_TO_NEG_INF 0x01 |
|
633 @@ -820,6 +824,11 @@ _mm_cmpgt_epi64 (__m128i __X, __m128i __Y) |
|
634 #pragma GCC push_options |
|
635 #pragma GCC target("sse4.2") |
|
636 #define __DISABLE_SSE4_2__ |
|
637 + |
|
638 +#ifdef __cplusplus |
|
639 +} |
|
640 +#endif |
|
641 + |
|
642 #endif /* __SSE4_1__ */ |
|
643 |
|
644 /* Accumulate CRC32 (polynomial 0x11EDC6F41) value. */ |
|
645 diff --git a/gcc/config/i386/tbmintrin.h b/gcc/config/i386/tbmintrin.h |
|
646 index 871f532..744b9ca 100644 |
|
647 --- a/gcc/config/i386/tbmintrin.h |
|
648 +++ b/gcc/config/i386/tbmintrin.h |
|
649 @@ -34,6 +34,10 @@ |
|
650 #define __DISABLE_TBM__ |
|
651 #endif /* __TBM__ */ |
|
652 |
|
653 +#ifdef __cplusplus |
|
654 +extern "C" { |
|
655 +#endif |
|
656 + |
|
657 #ifdef __OPTIMIZE__ |
|
658 extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
659 __bextri_u32 (unsigned int __X, const unsigned int __I) |
|
660 @@ -177,4 +181,8 @@ __tzmsk_u64 (unsigned long long __X) |
|
661 #pragma GCC pop_options |
|
662 #endif /* __DISABLE_TBM__ */ |
|
663 |
|
664 +#ifdef __cplusplus |
|
665 +} |
|
666 +#endif |
|
667 + |
|
668 #endif /* _TBMINTRIN_H_INCLUDED */ |
|
669 diff --git a/gcc/config/i386/tmmintrin.h b/gcc/config/i386/tmmintrin.h |
|
670 index 89556d2..f89e33c 100644 |
|
671 --- a/gcc/config/i386/tmmintrin.h |
|
672 +++ b/gcc/config/i386/tmmintrin.h |
|
673 @@ -36,6 +36,10 @@ |
|
674 #define __DISABLE_SSSE3__ |
|
675 #endif /* __SSSE3__ */ |
|
676 |
|
677 +#ifdef __cplusplus |
|
678 +extern "C" { |
|
679 +#endif |
|
680 + |
|
681 extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
682 _mm_hadd_epi16 (__m128i __X, __m128i __Y) |
|
683 { |
|
684 @@ -241,6 +245,10 @@ _mm_abs_pi32 (__m64 __X) |
|
685 return (__m64) __builtin_ia32_pabsd ((__v2si)__X); |
|
686 } |
|
687 |
|
688 +#ifdef __cplusplus |
|
689 +} |
|
690 +#endif |
|
691 + |
|
692 #ifdef __DISABLE_SSSE3__ |
|
693 #undef __DISABLE_SSSE3__ |
|
694 #pragma GCC pop_options |
|
695 diff --git a/gcc/config/i386/wmmintrin.h b/gcc/config/i386/wmmintrin.h |
|
696 index 2002375..a22bb07 100644 |
|
697 --- a/gcc/config/i386/wmmintrin.h |
|
698 +++ b/gcc/config/i386/wmmintrin.h |
|
699 @@ -30,6 +30,10 @@ |
|
700 /* We need definitions from the SSE2 header file. */ |
|
701 #include <emmintrin.h> |
|
702 |
|
703 +#ifdef __cplusplus |
|
704 +extern "C" { |
|
705 +#endif |
|
706 + |
|
707 /* AES */ |
|
708 |
|
709 #ifndef __AES__ |
|
710 @@ -124,6 +128,10 @@ _mm_clmulepi64_si128 (__m128i __X, __m128i __Y, const int __I) |
|
711 (__v2di)(__m128i)(Y), (int)(I))) |
|
712 #endif |
|
713 |
|
714 +#ifdef __cplusplus |
|
715 +} |
|
716 +#endif |
|
717 + |
|
718 #ifdef __DISABLE_PCLMUL__ |
|
719 #undef __DISABLE_PCLMUL__ |
|
720 #pragma GCC pop_options |
|
721 diff --git a/gcc/config/i386/xmmintrin.h b/gcc/config/i386/xmmintrin.h |
|
722 index a3824e7..ee1a1fc 100644 |
|
723 --- a/gcc/config/i386/xmmintrin.h |
|
724 +++ b/gcc/config/i386/xmmintrin.h |
|
725 @@ -64,6 +64,10 @@ _mm_prefetch (const void *__P, enum _mm_hint __I) |
|
726 #define __DISABLE_SSE__ |
|
727 #endif /* __SSE__ */ |
|
728 |
|
729 +#ifdef __cplusplus |
|
730 +extern "C" { |
|
731 +#endif |
|
732 + |
|
733 /* The Intel API is flexible enough that we must allow aliasing with other |
|
734 vector types, and their scalar components. */ |
|
735 typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); |
|
736 @@ -1254,6 +1258,10 @@ do { \ |
|
737 (row3) = __builtin_ia32_movhlps (__t3, __t2); \ |
|
738 } while (0) |
|
739 |
|
740 +#ifdef __cplusplus |
|
741 +} |
|
742 +#endif |
|
743 + |
|
744 /* For backward source compatibility. */ |
|
745 # include <emmintrin.h> |
|
746 |
|
747 diff --git a/gcc/config/i386/xopintrin.h b/gcc/config/i386/xopintrin.h |
|
748 index cc82bc5..d567a98 100644 |
|
749 --- a/gcc/config/i386/xopintrin.h |
|
750 +++ b/gcc/config/i386/xopintrin.h |
|
751 @@ -36,6 +36,10 @@ |
|
752 #define __DISABLE_XOP__ |
|
753 #endif /* __XOP__ */ |
|
754 |
|
755 +#ifdef __cplusplus |
|
756 +extern "C" { |
|
757 +#endif |
|
758 + |
|
759 /* Integer multiply/add intructions. */ |
|
760 extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
761 _mm_maccs_epi16(__m128i __A, __m128i __B, __m128i __C) |
|
762 @@ -836,6 +840,10 @@ _mm256_permute2_ps (__m256 __X, __m256 __Y, __m256i __C, const int __I) |
|
763 (int)(I))) |
|
764 #endif /* __OPTIMIZE__ */ |
|
765 |
|
766 +#ifdef __cplusplus |
|
767 +} |
|
768 +#endif |
|
769 + |
|
770 #ifdef __DISABLE_XOP__ |
|
771 #undef __DISABLE_XOP__ |
|
772 #pragma GCC pop_options |
|
773 diff --git a/gcc/config/i386/xsaveintrin.h b/gcc/config/i386/xsaveintrin.h |
|
774 index 47be25f..be2caea 100644 |
|
775 --- a/gcc/config/i386/xsaveintrin.h |
|
776 +++ b/gcc/config/i386/xsaveintrin.h |
|
777 @@ -34,6 +34,10 @@ |
|
778 #define __DISABLE_XSAVE__ |
|
779 #endif /* __XSAVE__ */ |
|
780 |
|
781 +#ifdef __cplusplus |
|
782 +extern "C" { |
|
783 +#endif |
|
784 + |
|
785 extern __inline void |
|
786 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
787 _xsave (void *__P, long long __M) |
|
788 @@ -69,4 +73,8 @@ _xrstor64 (void *__P, long long __M) |
|
789 #pragma GCC pop_options |
|
790 #endif /* __DISABLE_XSAVE__ */ |
|
791 |
|
792 +#ifdef __cplusplus |
|
793 +} |
|
794 +#endif |
|
795 + |
|
796 #endif /* _XSAVEINTRIN_H_INCLUDED */ |
|
797 diff --git a/gcc/config/i386/xsaveoptintrin.h b/gcc/config/i386/xsaveoptintrin.h |
|
798 index d7534b4..90eeb45 100644 |
|
799 --- a/gcc/config/i386/xsaveoptintrin.h |
|
800 +++ b/gcc/config/i386/xsaveoptintrin.h |
|
801 @@ -34,6 +34,10 @@ |
|
802 #define __DISABLE_XSAVEOPT__ |
|
803 #endif /* __XSAVEOPT__ */ |
|
804 |
|
805 +#ifdef __cplusplus |
|
806 +extern "C" { |
|
807 +#endif |
|
808 + |
|
809 extern __inline void |
|
810 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
|
811 _xsaveopt (void *__P, long long __M) |
|
812 @@ -55,4 +59,8 @@ _xsaveopt64 (void *__P, long long __M) |
|
813 #pragma GCC pop_options |
|
814 #endif /* __DISABLE_XSAVEOPT__ */ |
|
815 |
|
816 +#ifdef __cplusplus |
|
817 +} |
|
818 +#endif |
|
819 + |
|
820 #endif /* _XSAVEOPTINTRIN_H_INCLUDED */ |
|
821 diff --git a/gcc/config/i386/xtestintrin.h b/gcc/config/i386/xtestintrin.h |
|
822 index ba79e5c..864b727 100644 |
|
823 --- a/gcc/config/i386/xtestintrin.h |
|
824 +++ b/gcc/config/i386/xtestintrin.h |
|
825 @@ -34,6 +34,10 @@ |
|
826 #define __DISABLE_RTM__ |
|
827 #endif /* __RTM__ */ |
|
828 |
|
829 +#ifdef __cplusplus |
|
830 +extern "C" { |
|
831 +#endif |
|
832 + |
|
833 /* Return non-zero if the instruction executes inside an RTM or HLE code |
|
834 region. Return zero otherwise. */ |
|
835 extern __inline int |
|
836 @@ -48,4 +52,8 @@ _xtest (void) |
|
837 #pragma GCC pop_options |
|
838 #endif /* __DISABLE_RTM__ */ |
|
839 |
|
840 +#ifdef __cplusplus |
|
841 +} |
|
842 +#endif |
|
843 + |
|
844 #endif /* _XTESTINTRIN_H_INCLUDED */ |
|
845 -- |
|
846 1.8.4.5 |
|
847 |