rs6000: __Uglify non-uglified local variables in headers
Properly prefix (with "__") all local variables in shipped headers for x86 compatibility intrinsics implementations. This avoids possible problems with usages like: ``` ``` 2022-02-16 Paul A. Clarke <pc@us.ibm.com> gcc PR target/104257 * config/rs6000/bmi2intrin.h: Uglify local variables. * config/rs6000/emmintrin.h: Likewise. * config/rs6000/mm_malloc.h: Likewise. * config/rs6000/mmintrin.h: Likewise. * config/rs6000/pmmintrin.h: Likewise. * config/rs6000/smmintrin.h: Likewise. * config/rs6000/tmmintrin.h: Likewise. * config/rs6000/xmmintrin.h: Likewise.
This commit is contained in:
parent
fac15bf848
commit
efbb17db52
8 changed files with 1334 additions and 1335 deletions
|
@ -77,39 +77,39 @@ extern __inline unsigned long long
|
|||
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_pdep_u64 (unsigned long long __X, unsigned long long __M)
|
||||
{
|
||||
unsigned long result = 0x0UL;
|
||||
const unsigned long mask = 0x8000000000000000UL;
|
||||
unsigned long m = __M;
|
||||
unsigned long c, t;
|
||||
unsigned long p;
|
||||
unsigned long __result = 0x0UL;
|
||||
const unsigned long __mask = 0x8000000000000000UL;
|
||||
unsigned long __m = __M;
|
||||
unsigned long __c, __t;
|
||||
unsigned long __p;
|
||||
|
||||
/* The pop-count of the mask gives the number of the bits from
|
||||
source to process. This is also needed to shift bits from the
|
||||
source into the correct position for the result. */
|
||||
p = 64 - __builtin_popcountl (__M);
|
||||
__p = 64 - __builtin_popcountl (__M);
|
||||
|
||||
/* The loop is for the number of '1' bits in the mask and clearing
|
||||
each mask bit as it is processed. */
|
||||
while (m != 0)
|
||||
while (__m != 0)
|
||||
{
|
||||
c = __builtin_clzl (m);
|
||||
t = __X << (p - c);
|
||||
m ^= (mask >> c);
|
||||
result |= (t & (mask >> c));
|
||||
p++;
|
||||
__c = __builtin_clzl (__m);
|
||||
__t = __X << (__p - __c);
|
||||
__m ^= (__mask >> __c);
|
||||
__result |= (__t & (__mask >> __c));
|
||||
__p++;
|
||||
}
|
||||
return (result);
|
||||
return __result;
|
||||
}
|
||||
|
||||
extern __inline unsigned long long
|
||||
__attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_pext_u64 (unsigned long long __X, unsigned long long __M)
|
||||
{
|
||||
unsigned long p = 0x4040404040404040UL; // initial bit permute control
|
||||
const unsigned long mask = 0x8000000000000000UL;
|
||||
unsigned long m = __M;
|
||||
unsigned long c;
|
||||
unsigned long result;
|
||||
unsigned long __p = 0x4040404040404040UL; // initial bit permute control
|
||||
const unsigned long __mask = 0x8000000000000000UL;
|
||||
unsigned long __m = __M;
|
||||
unsigned long __c;
|
||||
unsigned long __result;
|
||||
|
||||
/* if the mask is constant and selects 8 bits or less we can use
|
||||
the Power8 Bit permute instruction. */
|
||||
|
@ -118,35 +118,35 @@ _pext_u64 (unsigned long long __X, unsigned long long __M)
|
|||
/* Also if the pext mask is constant, then the popcount is
|
||||
constant, we can evaluate the following loop at compile
|
||||
time and use a constant bit permute vector. */
|
||||
long i;
|
||||
for (i = 0; i < __builtin_popcountl (__M); i++)
|
||||
long __i;
|
||||
for (__i = 0; __i < __builtin_popcountl (__M); __i++)
|
||||
{
|
||||
c = __builtin_clzl (m);
|
||||
p = (p << 8) | c;
|
||||
m ^= (mask >> c);
|
||||
__c = __builtin_clzl (__m);
|
||||
__p = (__p << 8) | __c;
|
||||
__m ^= (__mask >> __c);
|
||||
}
|
||||
result = __builtin_bpermd (p, __X);
|
||||
__result = __builtin_bpermd (__p, __X);
|
||||
}
|
||||
else
|
||||
{
|
||||
p = 64 - __builtin_popcountl (__M);
|
||||
result = 0;
|
||||
__p = 64 - __builtin_popcountl (__M);
|
||||
__result = 0;
|
||||
/* We could a use a for loop here, but that combined with
|
||||
-funroll-loops can expand to a lot of code. The while
|
||||
loop avoids unrolling and the compiler commons the xor
|
||||
from clearing the mask bit with the (m != 0) test. The
|
||||
result is a more compact loop setup and body. */
|
||||
while (m != 0)
|
||||
while (__m != 0)
|
||||
{
|
||||
unsigned long t;
|
||||
c = __builtin_clzl (m);
|
||||
t = (__X & (mask >> c)) >> (p - c);
|
||||
m ^= (mask >> c);
|
||||
result |= (t);
|
||||
p++;
|
||||
unsigned long __t;
|
||||
__c = __builtin_clzl (__m);
|
||||
__t = (__X & (__mask >> __c)) >> (__p - __c);
|
||||
__m ^= (__mask >> __c);
|
||||
__result |= (__t);
|
||||
__p++;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
return __result;
|
||||
}
|
||||
|
||||
/* these 32-bit implementations depend on 64-bit pdep/pext
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,28 +35,28 @@ extern "C" int posix_memalign (void **, size_t, size_t) throw ();
|
|||
#endif
|
||||
|
||||
static __inline void *
|
||||
_mm_malloc (size_t size, size_t alignment)
|
||||
_mm_malloc (size_t __size, size_t __alignment)
|
||||
{
|
||||
/* PowerPC64 ELF V2 ABI requires quadword alignment. */
|
||||
size_t vec_align = sizeof (__vector float);
|
||||
size_t __vec_align = sizeof (__vector float);
|
||||
/* Linux GLIBC malloc alignment is at least 2 X ptr size. */
|
||||
size_t malloc_align = (sizeof (void *) + sizeof (void *));
|
||||
void *ptr;
|
||||
size_t __malloc_align = (sizeof (void *) + sizeof (void *));
|
||||
void *__ptr;
|
||||
|
||||
if (alignment == malloc_align && alignment == vec_align)
|
||||
return malloc (size);
|
||||
if (alignment < vec_align)
|
||||
alignment = vec_align;
|
||||
if (posix_memalign (&ptr, alignment, size) == 0)
|
||||
return ptr;
|
||||
if (__alignment == __malloc_align && __alignment == __vec_align)
|
||||
return malloc (__size);
|
||||
if (__alignment < __vec_align)
|
||||
__alignment = __vec_align;
|
||||
if (__posix_memalign (&__ptr, __alignment, __size) == 0)
|
||||
return __ptr;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static __inline void
|
||||
_mm_free (void * ptr)
|
||||
_mm_free (void * __ptr)
|
||||
{
|
||||
free (ptr);
|
||||
free (__ptr);
|
||||
}
|
||||
|
||||
#endif /* _MM_MALLOC_H_INCLUDED */
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -58,55 +58,55 @@
|
|||
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_addsub_ps (__m128 __X, __m128 __Y)
|
||||
{
|
||||
const __v4sf even_n0 = {-0.0, 0.0, -0.0, 0.0};
|
||||
__v4sf even_neg_Y = vec_xor(__Y, even_n0);
|
||||
return (__m128) vec_add (__X, even_neg_Y);
|
||||
const __v4sf __even_n0 = {-0.0, 0.0, -0.0, 0.0};
|
||||
__v4sf __even_neg_Y = vec_xor(__Y, __even_n0);
|
||||
return (__m128) vec_add (__X, __even_neg_Y);
|
||||
}
|
||||
|
||||
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_addsub_pd (__m128d __X, __m128d __Y)
|
||||
{
|
||||
const __v2df even_n0 = {-0.0, 0.0};
|
||||
__v2df even_neg_Y = vec_xor(__Y, even_n0);
|
||||
return (__m128d) vec_add (__X, even_neg_Y);
|
||||
const __v2df __even_n0 = {-0.0, 0.0};
|
||||
__v2df __even_neg_Y = vec_xor(__Y, __even_n0);
|
||||
return (__m128d) vec_add (__X, __even_neg_Y);
|
||||
}
|
||||
|
||||
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_hadd_ps (__m128 __X, __m128 __Y)
|
||||
{
|
||||
__vector unsigned char xform2 = {
|
||||
__vector unsigned char __xform2 = {
|
||||
0x00, 0x01, 0x02, 0x03,
|
||||
0x08, 0x09, 0x0A, 0x0B,
|
||||
0x10, 0x11, 0x12, 0x13,
|
||||
0x18, 0x19, 0x1A, 0x1B
|
||||
};
|
||||
__vector unsigned char xform1 = {
|
||||
__vector unsigned char __xform1 = {
|
||||
0x04, 0x05, 0x06, 0x07,
|
||||
0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x14, 0x15, 0x16, 0x17,
|
||||
0x1C, 0x1D, 0x1E, 0x1F
|
||||
};
|
||||
return (__m128) vec_add (vec_perm ((__v4sf) __X, (__v4sf) __Y, xform2),
|
||||
vec_perm ((__v4sf) __X, (__v4sf) __Y, xform1));
|
||||
return (__m128) vec_add (vec_perm ((__v4sf) __X, (__v4sf) __Y, __xform2),
|
||||
vec_perm ((__v4sf) __X, (__v4sf) __Y, __xform1));
|
||||
}
|
||||
|
||||
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_hsub_ps (__m128 __X, __m128 __Y)
|
||||
{
|
||||
__vector unsigned char xform2 = {
|
||||
__vector unsigned char __xform2 = {
|
||||
0x00, 0x01, 0x02, 0x03,
|
||||
0x08, 0x09, 0x0A, 0x0B,
|
||||
0x10, 0x11, 0x12, 0x13,
|
||||
0x18, 0x19, 0x1A, 0x1B
|
||||
};
|
||||
__vector unsigned char xform1 = {
|
||||
__vector unsigned char __xform1 = {
|
||||
0x04, 0x05, 0x06, 0x07,
|
||||
0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x14, 0x15, 0x16, 0x17,
|
||||
0x1C, 0x1D, 0x1E, 0x1F
|
||||
};
|
||||
return (__m128) vec_sub (vec_perm ((__v4sf) __X, (__v4sf) __Y, xform2),
|
||||
vec_perm ((__v4sf) __X, (__v4sf) __Y, xform1));
|
||||
return (__m128) vec_sub (vec_perm ((__v4sf) __X, (__v4sf) __Y, __xform2),
|
||||
vec_perm ((__v4sf) __X, (__v4sf) __Y, __xform1));
|
||||
}
|
||||
|
||||
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
|
|
|
@ -273,31 +273,31 @@ _mm_round_ss (__m128 __A, __m128 __B, int __rounding)
|
|||
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_insert_epi8 (__m128i const __A, int const __D, int const __N)
|
||||
{
|
||||
__v16qi result = (__v16qi)__A;
|
||||
__v16qi __result = (__v16qi)__A;
|
||||
|
||||
result [__N & 0xf] = __D;
|
||||
__result [__N & 0xf] = __D;
|
||||
|
||||
return (__m128i) result;
|
||||
return (__m128i) __result;
|
||||
}
|
||||
|
||||
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_insert_epi32 (__m128i const __A, int const __D, int const __N)
|
||||
{
|
||||
__v4si result = (__v4si)__A;
|
||||
__v4si __result = (__v4si)__A;
|
||||
|
||||
result [__N & 3] = __D;
|
||||
__result [__N & 3] = __D;
|
||||
|
||||
return (__m128i) result;
|
||||
return (__m128i) __result;
|
||||
}
|
||||
|
||||
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_insert_epi64 (__m128i const __A, long long const __D, int const __N)
|
||||
{
|
||||
__v2di result = (__v2di)__A;
|
||||
__v2di __result = (__v2di)__A;
|
||||
|
||||
result [__N & 1] = __D;
|
||||
__result [__N & 1] = __D;
|
||||
|
||||
return (__m128i) result;
|
||||
return (__m128i) __result;
|
||||
}
|
||||
|
||||
extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
|
|
|
@ -112,8 +112,8 @@ _mm_alignr_epi8 (__m128i __A, __m128i __B, const unsigned int __count)
|
|||
{
|
||||
if (__count >= 32)
|
||||
{
|
||||
const __v16qu zero = { 0 };
|
||||
return (__m128i) zero;
|
||||
const __v16qu __zero = { 0 };
|
||||
return (__m128i) __zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue