[Bug target/81481] [7/8 Regression] Spills %xmm to stack in glibc strspn SSE 4.2 variant

amonakov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 26 11:33:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81481

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
A bit further reduced, needs -m32 -mssse3 -fpic -O2:

#include <immintrin.h>

extern const signed char c[31] __attribute__((visibility("hidden")));

__m128i f(__m128i *x, void *v)
{
  int i;
  asm("# %0" : "=r"(i));
  __m128i t = _mm_loadu_si128((void*)&c[i]);
  __m128i xx = *x;
  xx =  _mm_shuffle_epi8(xx, t);
  asm("# %0 %1 %2" : "+x"(xx) : "r"(c), "r"(i));
  return xx;
}


More information about the Gcc-bugs mailing list