From d6240ea016ea87d12456f92a7215af28c3dc3316 Mon Sep 17 00:00:00 2001 From: "Paul A. Clarke" Date: Mon, 25 Oct 2021 15:17:28 -0500 Subject: [PATCH] rs6000: Fix missing "externs" in smmintrin.h Inline functions defined in smmintrin.h need "extern" as part of their declaration, otherwise instances of those functions are created in the objects which include them. Fixes commits: - acd4b9103c1a30c833de4eee31fb69c3ff13cd77 - 9d352c68e8c8b642a36a6bcfc7f6b5dba11ac748 - bd9a8737d478f7f1d01a9d5f1cc4309ffbb53103 - 5f500715438761f59de5fb992267748c5d4dc4b6 - eaa93a0f3d9f67c8cbc1dc849ea6feba432ff412 - 29fb1e831bf1c25e4574bf2f98a9f534e5c67665 2021-10-25 Paul A. Clarke gcc * config/rs6000/smmintrin.h (_mm_testz_si128): Add "extern" to function signature. (_mm_testc_si128): Likewise. (_mm_testnzc_si128): Likewise. (_mm_blend_ps): Likewise. (_mm_blendv_ps): Likewise. (_mm_blend_pd): Likewise. (_mm_blendv_pd): Likewise. (_mm_ceil_pd): Likewise. (_mm_ceil_sd): Likewise. (_mm_ceil_ps): Likewise. (_mm_ceil_ss): Likewise. (_mm_floor_pd): Likewise. (_mm_floor_sd): Likewise. (_mm_floor_ps): Likewise. (_mm_floor_ss): Likewise. (_mm_minpos_epu16): Likewise. (_mm_mul_epi32): Likewise. (_mm_cvtepi8_epi16): Likewise. (_mm_packus_epi32): Likewise. (_mm_cmpgt_epi64): Likewise. --- gcc/config/rs6000/smmintrin.h | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gcc/config/rs6000/smmintrin.h b/gcc/config/rs6000/smmintrin.h index b732fbca7b09..0fab308b1951 100644 --- a/gcc/config/rs6000/smmintrin.h +++ b/gcc/config/rs6000/smmintrin.h @@ -118,7 +118,7 @@ _mm_blendv_epi8 (__m128i __A, __m128i __B, __m128i __mask) return (__m128i) vec_sel ((__v16qu) __A, (__v16qu) __B, __lmask); } -__inline __m128 +extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_blend_ps (__m128 __A, __m128 __B, const int __imm8) { @@ -145,7 +145,7 @@ _mm_blend_ps (__m128 __A, __m128 __B, const int __imm8) return (__m128) __r; } -__inline __m128 +extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_blendv_ps (__m128 __A, __m128 __B, __m128 __mask) { @@ -154,7 +154,7 @@ _mm_blendv_ps (__m128 __A, __m128 __B, __m128 __mask) return (__m128) vec_sel ((__v4su) __A, (__v4su) __B, (__v4su) __boolmask); } -__inline __m128d +extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_blend_pd (__m128d __A, __m128d __B, const int __imm8) { @@ -170,7 +170,7 @@ _mm_blend_pd (__m128d __A, __m128d __B, const int __imm8) } #ifdef _ARCH_PWR8 -__inline __m128d +extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_blendv_pd (__m128d __A, __m128d __B, __m128d __mask) { @@ -180,7 +180,7 @@ _mm_blendv_pd (__m128d __A, __m128d __B, __m128d __mask) } #endif -__inline int +extern __inline int __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_testz_si128 (__m128i __A, __m128i __B) { @@ -189,7 +189,7 @@ _mm_testz_si128 (__m128i __A, __m128i __B) return vec_all_eq (vec_and ((__v16qu) __A, (__v16qu) __B), __zero); } -__inline int +extern __inline int __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_testc_si128 (__m128i __A, __m128i __B) { @@ -199,7 +199,7 @@ _mm_testc_si128 (__m128i __A, __m128i __B) return vec_all_eq (vec_and ((__v16qu) __notA, (__v16qu) __B), __zero); } -__inline int +extern __inline int __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_testnzc_si128 (__m128i __A, __m128i __B) { @@ -214,14 +214,14 @@ _mm_testnzc_si128 (__m128i __A, __m128i __B) #define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128 ((M), (V)) -__inline __m128d +extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_ceil_pd (__m128d __A) { return (__m128d) vec_ceil ((__v2df) __A); } -__inline __m128d +extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_ceil_sd (__m128d __A, __m128d __B) { @@ -230,14 +230,14 @@ _mm_ceil_sd (__m128d __A, __m128d __B) return (__m128d) __r; } -__inline __m128d +extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_floor_pd (__m128d __A) { return (__m128d) vec_floor ((__v2df) __A); } -__inline __m128d +extern __inline __m128d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_floor_sd (__m128d __A, __m128d __B) { @@ -246,14 +246,14 @@ _mm_floor_sd (__m128d __A, __m128d __B) return (__m128d) __r; } -__inline __m128 +extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_ceil_ps (__m128 __A) { return (__m128) vec_ceil ((__v4sf) __A); } -__inline __m128 +extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_ceil_ss (__m128 __A, __m128 __B) { @@ -262,14 +262,14 @@ _mm_ceil_ss (__m128 __A, __m128 __B) return __r; } -__inline __m128 +extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_floor_ps (__m128 __A) { return (__m128) vec_floor ((__v4sf) __A); } -__inline __m128 +extern __inline __m128 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_floor_ss (__m128 __A, __m128 __B) { @@ -351,7 +351,7 @@ _mm_mullo_epi32 (__m128i __X, __m128i __Y) } #ifdef _ARCH_PWR8 -__inline __m128i +extern __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_mul_epi32 (__m128i __X, __m128i __Y) { @@ -359,7 +359,7 @@ _mm_mul_epi32 (__m128i __X, __m128i __Y) } #endif -__inline __m128i +extern __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_cvtepi8_epi16 (__m128i __A) { @@ -499,7 +499,7 @@ _mm_cvtepu32_epi64 (__m128i __A) /* Return horizontal packed word minimum and its index in bits [15:0] and bits [18:16] respectively. */ -__inline __m128i +extern __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_minpos_epu16 (__m128i __A) { @@ -524,7 +524,7 @@ _mm_minpos_epu16 (__m128i __A) return __r.__m; } -__inline __m128i +extern __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_packus_epi32 (__m128i __X, __m128i __Y) { @@ -532,7 +532,7 @@ _mm_packus_epi32 (__m128i __X, __m128i __Y) } #ifdef _ARCH_PWR8 -__inline __m128i +extern __inline __m128i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_epi64 (__m128i __X, __m128i __Y) {