[LLVMbugs] [Bug 13624] New: powerpc64 complex return value handling does not match PPC64 ELF ABI

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 16 14:27:23 PDT 2012


             Bug #: 13624
           Summary: powerpc64 complex return value handling does not match
                    PPC64 ELF ABI
           Product: new-bugs
           Version: trunk
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: wschmidt at linux.vnet.ibm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

On powerpc64-unknown-linux-gnu, the method of returning complex values is not
compatible with the 64-bit PowerPC ELF Application Binary Interface Supplement
(see http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html).  To
wit, Section 3.2.4 states:  "Functions shall return floating point complex
values of size 16 (four or eight byte complex) in f1:f2..."

Instead, LLVM currently returns a floating-point complex value into an area of
the caller's stack addressed by GPR3, as this example shows.

_Complex double
comp_test (void)
  _Complex double x = 2.5i;
  return x;

    li 4, 4097
    li 5, 0
    sldi 4, 4, 50
    std 5, -16(1)
    std 4, -8(1)
    lfd 0, -16(1)
    stfd 0, 0(3)    <--
    std 4, 8(3)     <--
    mr 5, 3
    std 4, 8(3)
    std 5, -24(1)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list