llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.89k stars 11.03k forks source link

ppc64 VSX asm inline asm fails. #33031

Open llvmbot opened 7 years ago

llvmbot commented 7 years ago
Bugzilla Link 33684
Version trunk
OS Linux
Attachments The functions that fail.
Reporter LLVM Bugzilla Contributor
CC @hfinkel

Extended Description

/*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

: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 :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
llvmbot commented 1 week ago

@llvm/issue-subscribers-backend-powerpc

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [33684](https://llvm.org/bz33684) | | Version | trunk | | OS | Linux | | Attachments | [The functions that fail.](https://user-images.githubusercontent.com/60944935/143755925-297c1512-8270-4f09-875f-a9b254b7826f.gz) | | Reporter | LLVM Bugzilla Contributor | | CC | @hfinkel | ## Extended Description /*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