This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add a def file to CPU vendor, type, and subtype encodings used by Host.cpp
ClosedPublic

Authored by craig.topper on Nov 7 2017, 11:31 PM.

Details

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

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Nov 7 2017, 11:31 PM

Fix some typos

echristo accepted this revision.Nov 9 2017, 10:53 PM

Seems to be a step in the right direction anyhow.

This revision is now accepted and ready to land.Nov 9 2017, 10:53 PM
This revision was automatically updated to reflect the committed changes.