[PATCH] Add Clang support for PPC cryptography builtins

Nemanja Ivanovic nemanja.i.ibm at gmail.com
Mon Mar 2 11:11:55 PST 2015


This update addresses the discussion regarding the macro guards in altivec.h. In order to maintain the same semantics for enabling/disabling the builtins as GCC has, there had to be some additional work. The comments in the code are hopefully descriptive enough, but here's a summary.

- GCC provides two ways to provide support for ALL of the builtins (-mcrypto and -mcpu=power8). We do the same now.
- Since some of the builtins are guarded by the __POWER8_VECTOR__ macro, -mcrypto also enables the same semantics as -mpower8-vector
- It stands to reason that -mno-power8-vector should disable both sets (crypto and power8-vector builtins)
- However, -mno-crypto only disables the crypto builtins
- By default, -mcpu=power8 implies both

This only leaves us in a situation where -mcpu=pwr7 -mcrypto -mno-power8-vector actually leaves all the crypto builtins available. However, this would be a strange option set indeed.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7951

Files:
  include/clang/Basic/BuiltinsPPC.def
  include/clang/Driver/Options.td
  lib/Basic/Targets.cpp
  lib/CodeGen/CGBuiltin.cpp
  lib/Headers/altivec.h
  test/CodeGen/builtins-ppc-crypto-diag.c
  test/CodeGen/builtins-ppc-crypto-disabled.c
  test/CodeGen/builtins-ppc-crypto.c
  test/Preprocessor/predefined-arch-macros.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7951.21018.patch
Type: text/x-patch
Size: 28212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150302/d1837885/attachment.bin>


More information about the cfe-commits mailing list