[llvm-bugs] [Bug 39902] New: Complex double passed as an argument in c uses a spill and ldc1 rather than a pair of mtc1/mthc1 on mips32r2

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 6 06:06:47 PST 2018


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

            Bug ID: 39902
           Summary: Complex double passed as an argument in c uses a spill
                    and ldc1 rather than a pair of mtc1/mthc1 on mips32r2
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: MIPS
          Assignee: unassignedbugs at nondot.org
          Reporter: cassandra.l.mccord at gmail.com
                CC: llvm-bugs at lists.llvm.org

Compiling the following code snippet using clang results in the arguments
spilling to the stack and the using ldc1 rather than a pair of mtc1/mthc1 on
mips32r2 with -mfp32.  
The exact flags used during compilation -O3 -target mipsel -S -march=mips32r2
-ffast-math -mfp32 -mtune=mips32r2

#include <complex.h>
complex double __attribute((noinline)) square(complex double c)
{
    return c * c;
}


Note that the same is true for the opposite, when calling a function like this
the fp registers are spilled to memory and then loaded back into the argument
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/20181206/747f1884/attachment.html>


More information about the llvm-bugs mailing list