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

            Bug ID: 89021
           Summary: Implement mmintrin.h in SSE
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: crazylht at gmail dot com, ubizjak at gmail dot com,
                    xuepeng.guo at intel dot com
  Target Milestone: ---
            Target: x86-64

On x86-64, __m64 is returned and passed in XMM registers. We generate

[hjl@gnu-cfl-1 pr88828]$ cat i.c
#include <mmintrin.h>

__m64
foo (__m64 x, __m64 y)
{
  return _m_packssdw (x, y);
}
[hjl@gnu-cfl-1 pr88828]$ gcc -S -O2 i.c -march=haswell
[hjl@gnu-cfl-1 pr88828]$ cat i.s
        .file   "i.c"
        .text
        .p2align 4,,15
        .globl  foo
        .type   foo, @function
foo:
.LFB129:
        .cfi_startproc
        movdq2q %xmm0, %mm0
        movdq2q %xmm1, %mm1
        packssdw        %mm1, %mm0
        movq2dq %mm0, %xmm0
        ret
        .cfi_endproc
.LFE129:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 8.2.1 20190109 (Red Hat 8.2.1-7)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-1 pr88828]$ 

We can generate

        packssdw        %xmm1, %xmm0
        ret

instead.

Reply via email to