[llvm-bugs] [Bug 38378] New: LLVM defines __GNUC__ but can't compile __builtin_crypto_vcipher on POWER8

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 30 19:10:52 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38378

            Bug ID: 38378
           Summary: LLVM defines __GNUC__ but can't compile
                    __builtin_crypto_vcipher on POWER8
           Product: clang
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: noloader at gmail.com
                CC: llvm-bugs at lists.llvm.org

This is a piece of existing code that has worked well for the last several
years. 

template <class T1, class T2>
inline T1 VectorEncrypt(const T1& state, const T2& key)
{
#if defined(__xlc__) || defined(__xlC__)
    return (T1)__vcipher((uint8x16_p)state, (uint8x16_p)key);
#elif defined(__GNUC__)
    return (T1)__builtin_crypto_vcipher((uint64x2_p)state, (uint64x2_p)key);
#else
    _ASSERT(0);
#endif
}

Attempting to compile with IBM XL C/C++ 13.1 on GCC112 from the compile farm
results in:

$ CXX=xlC make aes-simd.o
xlC -DNDEBUG -g2 -O3 -qrtti -qpic -qarch=pwr8 -qaltivec -c aes-simd.cpp
In file included from aes-simd.cpp:29:
./ppc-simd.h:443:16: error: use of undeclared identifier
      '__builtin_crypto_vcipher'; did you mean '__builtin_vec_vcipher'?
    return (T1)__builtin_crypto_vcipher((uint64x2_p)state, (uint64x2_p)key);

This should have been well tested before making those claims. We should not be
experiencing the failure in the field.

Please stop pretending to be other compilers when you can't compile the
program.

----------

$ xlC -qshowmacros -qarch=pwr8 -qaltivec -E test.cpp | egrep -i -E
'xlc|clang|llvm|gnuc'
#define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_PREREQ(maj,min) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) <<
16) + (min))
#define __GNUC_VA_LIST 1
#define __GNUC__ 4
#define __XLC_BUILTIN_VAARG__ 1
#define __clang__ 1
#define __clang_major__ 4
#define __clang_minor__ 0
#define __clang_patchlevel__ 1
#define __clang_version__ "4.0.1 (tags/RELEASE_401/final)"
#define __llvm__ 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180731/24109be7/attachment-0001.html>


More information about the llvm-bugs mailing list