Vector permutation support for x86
Sebastian Pop
sebastian.pop@amd.com
Mon Nov 30 18:36:00 GMT 2009
Hi,
On Wed, Nov 25, 2009 at 20:56, Richard Henderson <rth@redhat.com> wrote:
> For the AMD folk: I tried to support the vpperm insn from the XOP ISA, but
> there seems to be some disconnect between trunk binutils and trunk gcc wrt
> vpperm. This can be seen in the failure of the new test "vperm-v4si-2x.c".
> I'm looking at the XOP spec labeled "Pub No 43479, Rev 3.03, May 2009", and
> what gcc is emitting looks ok. But I've already been bitten by an
> out-of-date AVX spec during this adventure, so I'd appreciate some
> double-check.
>
An updated manual for XOP has been posted a week ago, see:
http://support.amd.com/us/Processor_TechDocs/43479.pdf
I do not think that this pattern generated by GCC is correct:
vpperm %xmm1, %xmm0, i(%rip), %xmm0
for which I get with trunk GAS this error:
/home/seb/gcc/trunk/gcc/testsuite/gcc.target/i386/vperm-v4si-2x.s:147:
Error: suffix or operands invalid for `vpperm'
The manual specifies the VPPERM insn like this:
VPPERM dest, src1, src2, selector
VPPERM xmm1, xmm2, xmm3, xmm4/mem128
VPPERM xmm1, xmm2, xmm3/mem128, xmm4
and so the pattern for the above insn is this one:
VPPERM xmm1, xmm2, xmm3/mem128, xmm4
Now the AMD manual follows the Intel/Masm syntax whereas GCC generates
the AT&T syntax, and so I think that GCC should instead generate the
memory in the second operand, something like this probably:
vpperm %xmm0, i(%rip), %xmm0, %xmm1
Sebastian Pop
--
AMD / Open Source Compiler Engineering / GNU Tools
More information about the Gcc-patches
mailing list