This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
How to tell PPC assembler VSX is available?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Sat, 10 Mar 2018 19:21:53 -0500
- Subject: How to tell PPC assembler VSX is available?
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
I'm trying to replace vec_xl_be, which seems to be missing in most
versions of GCC. I have the code shown below.
When I attempt to use VEC_XL_BE it results in:
$ g++ -DTEST_MAIN -g2 -O3 -mcpu=power8 sha256-p8.cxx -o sha256-p8.exe
/home/noloader/tmp/ccbDnfFr.s: Assembler messages:
/home/noloader/tmp/ccbDnfFr.s:758: Error: operand out of range (32 is
not between 0 and 31)
/home/noloader/tmp/ccbDnfFr.s:983: Error: operand out of range (48 is
not between 0 and 31)
According to IBM's docs at [1], -mcpu=power8 is the correct option;
and it enables other options, like -mvsx. Enabling other options in
turn, like -maltivec and -mvsx, does not help.
I've found several similar problems on the web. Most seem to be
related to the range of a constant. This feels more like an
architecture/configuration problem.
How can I tell the assembler the VSX registers are available? Or what
should I do to make this work?
[1] https://www.ibm.com/support/knowledgecenter/en/linuxonibm/liaal/iplsdkrecbldset.htm
********************
typedef __vector unsigned int uint32x4_p8;
...
uint32x4_p8 VEC_XL_BE(const uint8_t* data, int offset)
{
#if defined(__xlc__) || defined(__xlC__)
return (uint32x4_p8)vec_xl_be(offset, (uint8_t*)data);
#else
uint32x4_p8 res;
__asm(" lxvd2x %x0, %1, %2 \n\t"
: "=wa" (res)
: "g" (data), "g" (offset));
return res;
#endif
}
********************
I'm working on GCC112 from the compile farm, which is ppc64-le. It is
the hand we are dealt.
$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
$ as --version
GNU assembler version 2.25.1-32.base.el7_4.1