[X86] Add a def file to CPU vendor, type, and subtype encodings used by Host.cpp
authorCraig Topper <craig.topper@intel.com>
Fri, 10 Nov 2017 17:10:57 +0000 (17:10 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 10 Nov 2017 17:10:57 +0000 (17:10 +0000)
commitc77d00e327d4997c5bb34e39ee6e16ca339237ca
treee9f1e8030eaf7a6719e7134a53eb2fd6bcef00f0
parenta17bd121850a7e1c57cd0bd9d7553b35a72f0c39
[X86] Add a def file to CPU vendor, type, and subtype encodings used by Host.cpp

Summary:
I want to leverage this to clean up some of the code in clang. This will allow us to simplify D39521 which was trying to do some of the same.

If we accurately keep the code in Host.cpp synced with new CPUs added to compile-rt/libgcc we should be able to use this file as a proxy for what's implemented in the libraries.

The entries for the CPUs recognized by the libraries use separate macros that define additional parameters like the name for __builtin_cpu_is and an alias string for the couple cases where __builtin_cpu_is accepts two different names.

All of the macros contain an ARCHNAME that is usually the same as the __builtin_cpu_is string, but sometimes isn't. This represents the name recognized by X86.td and -march.

I'm following the precedent set by ARM and AArch64 and adding this information to lib/Support/TargetParser.cpp

Reviewers: erichkeane, echristo, asbirlea

Reviewed By: echristo

Subscribers: llvm-commits, aemerson, kristof.beyls

Differential Revision: https://reviews.llvm.org/D39782

llvm-svn: 317900
llvm/include/llvm/Support/TargetParser.h
llvm/include/llvm/Support/X86TargetParser.def [new file with mode: 0644]
llvm/lib/Support/Host.cpp