This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/67291] error: 'asm' operand has impossible constraints when compiling gromacs 5.1 testsuite on PPC64 and PPC64LE with VSX SIMD
- From: "amodra at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Aug 2015 13:19:50 +0000
- Subject: [Bug target/67291] error: 'asm' operand has impossible constraints when compiling gromacs 5.1 testsuite on PPC64 and PPC64LE with VSX SIMD
- Auto-submitted: auto-generated
- References: <bug-67291-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67291
Alan Modra <amodra at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amodra at gmail dot com
--- Comment #2 from Alan Modra <amodra at gmail dot com> ---
I think this is a user error.
The "ww" constraint is for the single precision vsx insns, like xsaddsp. This
constraint is only enabled for vsx regs when compiling with -mcpu=power8 (or
when you compiler defaults to -mcpu=power8), or when explicitly enabled with
-mupper-regs-sf. So if your compiler defaults to -mcpu=power7, you'll get the
"impossible constraints" message.
Reduced testcase, which compiles OK with -mcpu=power8, but fails with
-mcpu=power7.
__vector double
gmx_simd_cvt_i2d_ibm_vsx(__vector signed int ix)
{
const __vector unsigned char perm = {4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,
8, 9, 10, 11};
__vector double x;
ix = __builtin_vec_perm(ix, ix, perm);
__asm__ ("xvcvsxwdp %x0,%x1" : "=ww" (x) : "ww" (ix));
return x;
}
I believe the asm should be using "=wd" and "wa" constraints. Also, that
vec_perm is a bit ugly. Putting the words of ix in the right place would
better be done with xxsldwi.