[PATCH] [PATCH][X86] Slightly refactor default features for AMD bdver* cpus. Also improve checks for target features in test Preprocessor/predefined-arch-macros.c.

Andrea Di Biagio Andrea_DiBiagio at sn.scee.net
Wed Nov 5 09:21:00 PST 2014


Hi rnk, craig.topper, qcolombet,

Hi Reid, Quentin (and all),

This patch slightly refactors how clang sets default features for AMD bdver cpus.
Method 'getDefaultFeatures' (in Basic/Targets.cpp), already uses a fallthrough mechanism to set default features for 'bdver4', bdver3 and bdver2. This patch simply adds another fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'. That is because 'bdver2' has the same features available in 'bdver1' plus BMI,FMA,F16C and TBM etc.

While at it, I added missing checks for features in test predefined-arch-macros.c.
In the case of BTVER2, this patch adds explicit checks for __F16C__, __BMI__ and __PCLMUL__.
In the case of BDVER3 and BDVER4, this patch checks for the presence of __FSGSBASE__ (added at r221130).

Please let me know if ok to submit.

Thanks,
Andrea

http://reviews.llvm.org/D6134

Files:
  lib/Basic/Targets.cpp
  test/Preprocessor/predefined-arch-macros.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6134.15815.patch
Type: text/x-patch
Size: 4283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141105/2f1d93be/attachment.bin>


More information about the cfe-commits mailing list