[llvm-bugs] [Bug 41029] New: The __m64 not passed according to i386 ABI

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 11 02:47:50 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41029

            Bug ID: 41029
           Summary: The __m64 not passed according to i386 ABI
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wei3.xiao at intel.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

$ cat m64.c
#include <immintrin.h>
void callee(__m64 __m1, __m64 __m2);
__m64 caller(__m64 __m1, __m64 __m2)
{
  __m64 a = _mm_set_pi16(1, 2, 3, 4);
  callee(__m2, __m1);
  return a;
}
$ gcc -m32 -O2 -S -o - m64.c
        .file   "m64.c"
        .text
        .p2align 4
        .globl  caller
        .type   caller, @function
caller:
.LFB5121:
        .cfi_startproc
        subl    $12, %esp
        .cfi_def_cfa_offset 16
        movq    %mm0, %mm2
        movq    %mm1, %mm0
        movq    %mm2, %mm1
        call    callee
        movq    .LC0, %mm0
        addl    $12, %esp
        .cfi_def_cfa_offset 4
        ret
        .cfi_endproc
.LFE5121:
        .size   caller, .-caller
        .section        .rodata.cst8,"aM", at progbits,8
        .align 8
.LC0:
        .value  4
        .value  3
        .value  2
        .value  1
        .ident  "GCC: (GNU) 9.0.1 20190131 (experimental)"
        .section        .note.GNU-stack,"", at progbits

$ clang -m32 -O2 -S -o - m64.c
        .text
        .file   "m64.c"
        .globl  caller                  # -- Begin function caller
        .p2align        4, 0x90
        .type   caller, at function
caller:                                 # @caller
# %bb.0:                                # %entry
        subl    $12, %esp
        pushl   20(%esp)
        pushl   20(%esp)
        pushl   36(%esp)
        pushl   36(%esp)
        calll   callee
        addl    $16, %esp
        movl    $196612, %eax           # imm = 0x30004
        movl    $65538, %edx            # imm = 0x10002
        addl    $12, %esp
        retl
.Lfunc_end0:
        .size   caller, .Lfunc_end0-caller
                                        # -- End function

        .ident  "clang version 9.0.0 (http://llvm.org/git/clang.git
59f2009cd157fc96a0d558125405b98586cd83d2) (http://llvm.org/git/llvm.git
6a7719c7965af52f904e16588c1754f65bcb8ff0)"
        .section        ".note.GNU-stack","", at progbits
        .addrsig

According to i386 ABI, __m64 values should be passed by mmx registers.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190311/576f3d0d/attachment.html>


More information about the llvm-bugs mailing list