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/48609] New: Inefficient complex float store


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

           Summary: Inefficient complex float store
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: ubizjak@gmail.com
            Target: x86_64


[hjl@gnu-6 pr1000]$ cat s2.i
typedef _Complex float SCtype;
extern SCtype bar;
void
foo (SCtype x)
{
  bar = x;
}
[hjl@gnu-6 pr1000]$ /usr/gcc-4.7/bin/gcc -S -O2 s2.i   
[hjl@gnu-6 pr1000]$ cat s2.s
    .file    "s2.i"
    .text
    .p2align 4,,15
    .globl    foo
    .type    foo, @function
foo:
.LFB0:
    .cfi_startproc
    movq    %xmm0, -8(%rsp)
    movl    -8(%rsp), %eax
    movl    %eax, bar(%rip)
    movl    -4(%rsp), %eax
    movl    %eax, bar+4(%rip)
    ret
    .cfi_endproc
.LFE0:
    .size    foo, .-foo

We should simply do

movq    %xmm0, bar(%rip)


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