[llvm-dev] Failed PPC64 compile when using Power7 loads and stores?

Jinsong Ji via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 24 11:22:40 PDT 2019

Looks like to me that your clang is too old.

  clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)

clang 3.8.0 was released on 08 Mar 2016.

While vec_xl was added in https://reviews.llvm.org/rL286455 onNov 11 2016,
which is around half an year later then 3.8.0.

Can you please try using newer clang.


Jinsong Ji (纪金松), PhD.

XL/LLVM on Power Compiler Development
E-mail: jji at us.ibm.com

From:	Jeffrey Walton via llvm-dev <llvm-dev at lists.llvm.org>
To:	llvm-dev <llvm-dev at lists.llvm.org>
Date:	10/24/2019 03:57 AM
Subject:	[EXTERNAL] [llvm-dev] Failed PPC64 compile when using Power7
            loads and stores?
Sent by:	"llvm-dev" <llvm-dev-bounces at lists.llvm.org>

Hi Everyone,

I'm having trouble figuring out a compile failure on ppc64le. The
failure is at

. The message is:

/bin/bash ./libtool  --tag=CXX   --mode=compile clang++
-DHAVE_CONFIG_H -I.    -DCRYPTOPP_DISABLE_POWER8  -pipe -mcpu=power7
-mvsx -maltivec -g -O2 -MT libppc_power7_la-ppc_power7.lo -MD -MP -MF
.deps/libppc_power7_la-ppc_power7.Tpo -c -o
libppc_power7_la-ppc_power7.lo `test -f 'ppc_power7.cpp' || echo

ppc_power7.cpp:71:21: error: use of undeclared identifier 'vec_xl'
            vec_xst(vec_xl(0, (__vector unsigned int*)(b1+3)), 0, (__vec...

The source file includes <altivec.h>. The source file is compiled with
-mcpu=power7 -mvsx -maltivec.


Here is the source code of interest:

// POWER7 added unaligned loads and store operations
byte b1[19] = {255, 255, 255, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, b2[17];

#if defined(_ARCH_PWR7) && defined(__xlC__)
    // Workaround XL C++
    vec_xst(vec_xl(0, (unsigned int*)(b1+3)), 0, (unsigned int*)(b2+1));
#elif defined(_ARCH_PWR7)
    vec_xst(vec_xl(0, (__vector unsigned int*)(b1+3)), 0, (__vector
unsigned int*)(b2+1));
    std::memset(b2, 0x00, sizeof(b2));

result = (0 == std::memcmp(b1+3, b2+1, 16));

Why is the file failing to compile?


Here are some details of the host:

  Operating System Details
  Distributor ID: Ubuntu
  Description: Ubuntu 16.04.6 LTS
  Release: 16.04
  Codename: xenial
  OS/Arch:           linux/ppc64le
  clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)


Compile is OK on my old PowerMac G5, GCC112 and GCC119 from the
compile farm. Unfortunately, the compile farm only tests GCC and XLC.
The Clang compiler does not work.

Thanks in advance.

LLVM Developers mailing list
llvm-dev at lists.llvm.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191024/f02bc262/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191024/f02bc262/attachment.gif>

More information about the llvm-dev mailing list