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

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 22 12:20:37 PDT 2018


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

Stefan Pintilie <stefanp at ca.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
                 CC|                            |stefanp at ca.ibm.com
             Status|NEW                         |RESOLVED

--- Comment #4 from Stefan Pintilie <stefanp at ca.ibm.com> ---
Checked altivec.h and both of the __builtin and __builtin_altivec_ forms are
there. The function in the example given: __builtin_crypto_vcipher has been
part of altivec.h since 2015. It looks like LLVM does have all of the PPC
crypto functions available for use.

A quick test with this example:

$ cat builtins-ppc-crypto-vcipher.c
#include <altivec.h>

#define D_INIT1 { 0x0102030405060708, \
                  0x090A0B0C0D0E0F10 };
#define D_INIT2 { 0x7172737475767778, \
                  0x797A7B7C7D7E7F70 };

// <2 x i64> test_vcipher_e
vector unsigned long long test_vcipher_e(void)
{
  vector unsigned long long a = D_INIT1
  vector unsigned long long b = D_INIT2
  return __builtin_crypto_vcipher(a, b);
}

$ clang -c builtins-ppc-crypto-vcipher.c
$ echo $?
0

Looks like __builtin_crypto_vcipher is working.

There is a passing test case that is part of LLVM that tests all of the PPC
crypto builtins: ./tools/clang/test/CodeGen/builtins-ppc-crypto.c


I see that you are using xlC to compile instead of LLVM. This may be an xlC
only issue.

-- 
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/20181022/a31e966d/attachment.html>


More information about the llvm-bugs mailing list