public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54349] New: _mm_cvtsi128_si64 unnecessary stores value at stack
@ 2012-08-22 14:30 neleai at seznam dot cz
  2012-08-22 14:58 ` [Bug target/54349] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: neleai at seznam dot cz @ 2012-08-22 14:30 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54349
           Summary: _mm_cvtsi128_si64 unnecessary stores value at stack
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: neleai@seznam.cz


Consider following program:

#include <emmintrin.h>
#include <stdint.h>
int64_t foo(__m128i a){return  _mm_cvtsi128_si64(a);}
int64_t bar(double b){ return *((int64_t*)&b);}

A _mm_cvtsi128_si64 does unnecesary store into stack instead moving to register
directly. Same problem is present when interpreting double as integer.

  .file "e.c"
  .text
  .p2align 4,,15
  .globl  foo
  .type foo, @function
foo:
.LFB517:
  .cfi_startproc
  movq  %xmm0, -16(%rsp)
  movq  -16(%rsp), %rax
  ret
  .cfi_endproc
.LFE517:
  .size foo, .-foo
  .p2align 4,,15
  .globl  bar
  .type bar, @function
bar:
.LFB518:
  .cfi_startproc
  movsd %xmm0, -8(%rsp)
  movq  -8(%rsp), %rax
  ret
  .cfi_endproc
.LFE518:
  .size bar, .-bar
  .ident  "GCC: (Debian 20120820-1) 4.8.0 20120820 (experimental) [trunk
revision 190537]"
  .section  .note.GNU-stack,"",@progbits


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

end of thread, other threads:[~2013-04-29 11:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22 14:30 [Bug target/54349] New: _mm_cvtsi128_si64 unnecessary stores value at stack neleai at seznam dot cz
2012-08-22 14:58 ` [Bug target/54349] " jakub at gcc dot gnu.org
2012-08-23 15:46 ` neleai at seznam dot cz
2013-04-03 14:05 ` hubicka at gcc dot gnu.org
2013-04-27  1:06 ` neleai at seznam dot cz
2013-04-29  6:36 ` ubizjak at gmail dot com
2013-04-29  8:47 ` ubizjak at gmail dot com
2013-04-29 11:10 ` ubizjak at gmail dot com
2013-04-29 11:11 ` ubizjak at gmail dot com
2013-04-29 11:12 ` ubizjak 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).