[PATCH] D35214: [compiler-rt][X86] Match the detection of cpu's for __cpu_model to the latest version of gcc

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 11:03:20 PDT 2017


craig.topper created this revision.
Herald added a subscriber: dberris.

We were missing many feature flags that newer gcc supports and we had our own set of feature flags that gcc didnt' support that were overlapping. Clang's implementation assumes gcc's features list so a mismatch here is problematic.

I've also matched the cpu type/subtype lists with gcc and removed all the cpus that gcc doesn't support. I've also removed the fallback autodetection logic that was taken from Host.cpp. It was the main reason we had extra feature flags relative to gcc. I don't think gcc does this in libgcc.

Unfortunately, libgcc seems to have ignored their own source code comment and has added new cpu types/subtypes in the middle of their enums at various times so I can't guarantee any compatibility with older libgcc here. But maybe once we have a matching implementation we can treat that as a reason to file bugs against libgcc if they do it again going forward.

Once this support is in place we can consider implementing __builtin_cpu_is in clang. This could also be needed for function dispatching that Erich Keane is working on.


https://reviews.llvm.org/D35214

Files:
  lib/builtins/cpu_model.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35214.105881.patch
Type: text/x-patch
Size: 16758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170710/ab5b3758/attachment.bin>


More information about the llvm-commits mailing list