I lack words to describe what happens on x86-64 to
<------------------------------------------------------>
#include <emmintrin.h>


__m128i foo(__m128i a) { return _mm_srli_si128(a, 8); }

int main() { return 0; }
<------------------------------------------------------>

# /usr/local/gcc-4.2-20060916/bin/gcc -O1 pr-psrldq.c -o pr-psrldq

000000000040042e <foo>:
  40042e:       66 0f 7f 44 24 d8       movdqa %xmm0,0xffffffffffffffd8(%rsp)
  400434:       48 8b 54 24 e0          mov    0xffffffffffffffe0(%rsp),%rdx
  400439:       48 89 d0                mov    %rdx,%rax
  40043c:       31 d2                   xor    %edx,%edx
  40043e:       48 89 44 24 e8          mov    %rax,0xffffffffffffffe8(%rsp)
  400443:       48 89 54 24 f0          mov    %rdx,0xfffffffffffffff0(%rsp)
  400448:       66 0f 6f 44 24 e8       movdqa 0xffffffffffffffe8(%rsp),%xmm0
  40044e:       c3                      retq

gcc-4.3-20070105 is still that creative.

As far as i know, it's specific to x86-64 but i'm not sure if other shifting
ops or specific values also are pathologic.


-- 
           Summary:  _mm_srli_si128, heinous code for some shifts
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbptbp at gmail dot com
  GCC host triplet: x86-64, linux, gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32280

Reply via email to