[llvm-bugs] [Bug 33684] New: ppc64 VSX asm inline asm fails.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 3 12:54:17 PDT 2017


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

            Bug ID: 33684
           Summary: ppc64 VSX asm inline asm fails.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: rich at pennware.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18747
  --> https://bugs.llvm.org/attachment.cgi?id=18747&action=edit
The functions that fail.

/*The following four functions from the current musl sources fail to compile
  for various reasons with the command line
    clang -target ppc64le-linux ppc.c
  The first two get

ppc.c:38:38: error: invalid output constraint '=ww' in asm
  __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));
                                     ^
ppc.c:44:38: error: invalid output constraint '=ww' in asm
  __asm__ ("xsmindp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));
                                     ^

  and the second two two get

ppc.c:52:12: error: invalid operand in inline asm: 'xsmaxdp ${0:x}, ${1:x},
${2:x}'
  __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));
           ^
ppc.c:52:12: error: invalid operand in inline asm: 'xsmaxdp ${0:x}, ${1:x},
${2:x}'
ppc.c:52:12: error: invalid operand in inline asm: 'xsmaxdp ${0:x}, ${1:x},
${2:x}'
ppc.c:52:12: error: unknown operand
<inline asm>:1:10: note: instantiated into assembly here
        xsmaxdp , , 
                ^
ppc.c:58:12: error: invalid operand in inline asm: 'xsmindp ${0:x}, ${1:x},
${2:x}'
  __asm__ ("xsmindp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));
           ^
ppc.c:58:12: error: invalid operand in inline asm: 'xsmindp ${0:x}, ${1:x},
${2:x}'
ppc.c:58:12: error: invalid operand in inline asm: 'xsmindp ${0:x}, ${1:x},
${2:x}'
ppc.c:58:12: error: unknown operand
<inline asm>:1:10: note: instantiated into assembly here
        xsmindp , , 
                ^
*/

#if 1

float fmaxf(float x, float y)
{
  __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));
  return x;
}

float fminf(float x, float y)
{
  __asm__ ("xsmindp %x0, %x1, %x2" : "=ww"(x) : "ww"(x), "ww"(y));
  return x;
}

#else

double fmax(double x, double y)
{
  __asm__ ("xsmaxdp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));
  return x;
}

double fmin(double x, double y)
{
  __asm__ ("xsmindp %x0, %x1, %x2" : "=ws"(x) : "ws"(x), "ws"(y));
  return x;
}

#endif

-- 
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/20170703/266072cd/attachment.html>


More information about the llvm-bugs mailing list