This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/66925] New: [3.9 optimization regression] _mm_cvtsi32_si128 spilling to memory


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

            Bug ID: 66925
           Summary: [3.9 optimization regression] _mm_cvtsi32_si128
                    spilling to memory
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thiago at kde dot org
  Target Milestone: ---

Consider the following function:

float __attribute__((target("f16c"))) fromf16(unsigned short v) 
{ 
  __m128i m = _mm_cvtsi32_si128(v); 
  return _mm_cvtss_f32(_mm_cvtph_ps(m)); 
}

With GCC 4.9, this generates:
        movzwl  %di, %edi
        vmovd   %edi, %xmm0
        vcvtph2ps       %xmm0, %xmm0
        ret

With GCC 5.2.1, it became:
        movzwl  %di, %edi
        movl    %edi, -12(%rsp)
        vmovd   -12(%rsp), %xmm0
        vcvtph2ps       %xmm0, %xmm0
        ret

The same still applies to GCC 6.

Note that the problem disappears if -march=sandybridge or -march=ivybridge are
active


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]