public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/66925] New: [3.9 optimization regression] _mm_cvtsi32_si128 spilling to memory
@ 2015-07-18  6:35 thiago at kde dot org
  2015-07-18  6:45 ` [Bug target/66925] [4.9 " pinskia at gcc dot gnu.org
  2015-07-18 15:04 ` hjl.tools at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: thiago at kde dot org @ 2015-07-18  6:35 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/66925] [4.9 optimization regression] _mm_cvtsi32_si128 spilling to memory
  2015-07-18  6:35 [Bug target/66925] New: [3.9 optimization regression] _mm_cvtsi32_si128 spilling to memory thiago at kde dot org
@ 2015-07-18  6:45 ` pinskia at gcc dot gnu.org
  2015-07-18 15:04 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-07-18  6:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Some processors moving between the GPR via vmovd is slower than moving via
memory.  So that is the reason why using -march=sandybridge or -march=ivybridge
makes the issue go away.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/66925] [4.9 optimization regression] _mm_cvtsi32_si128 spilling to memory
  2015-07-18  6:35 [Bug target/66925] New: [3.9 optimization regression] _mm_cvtsi32_si128 spilling to memory thiago at kde dot org
  2015-07-18  6:45 ` [Bug target/66925] [4.9 " pinskia at gcc dot gnu.org
@ 2015-07-18 15:04 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-18 15:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
> Some processors moving between the GPR via vmovd is slower than moving via
> memory.  So that is the reason why using -march=sandybridge or
> -march=ivybridge makes the issue go away.

You can also use -mtune=intel.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-18 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-18  6:35 [Bug target/66925] New: [3.9 optimization regression] _mm_cvtsi32_si128 spilling to memory thiago at kde dot org
2015-07-18  6:45 ` [Bug target/66925] [4.9 " pinskia at gcc dot gnu.org
2015-07-18 15:04 ` hjl.tools at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).