summaryrefslogtreecommitdiff
path: root/lib/builtins/cpu_model.c
AgeCommit message (Collapse)Author
2017-11-19[X86] Add cpu detection for cannonlake.Craig Topper
This uses the same encoding for cannonlake in the proposed gcc patches here. https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00551.html git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11[X86] Add Knights Mill CPU to cpu_indicator support to match libgcc.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19[X86][builtins] Sync getX86CpuIDAndInfoEx with llvm's Host.cpp again.Craig Topper
We now use __cpuidex intrinsics intead of inline asm on 32-bit Windows. We already used it on 64-bit. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308420 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-13[compiler-rt][X86] Match the detection of cpu's for __cpu_model to the ↵Craig Topper
latest version of gcc Summary: 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. 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. Reviewers: echristo, asbirlea, RKSimon, erichkeane, zvi Reviewed By: asbirlea Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D35214 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10[X86] Sync a few more things from llvm's Host.cpp to cpu_model.Craig Topper
This syncs the cpuid functions and adds breaks to the appropriate spots in the CPU decoding switches. Also a few formatting tweaks. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-10[X86] Resync cpu_model.c with llvm's Host.cpp in preparation for making it ↵Craig Topper
compatible with newer gcc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-07[builtins] Fix MSVC buildReid Kleckner
Avoid __attribute__((constructor)) in cpu_model.c. Use more C99 _Complex emulation in divtc3.c. Joerg Sonnenberger added this builtin just after the last round of C99 _Complex emulation landed in r249514 (Oct 2015). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-17[compiler-rt] Change all asm directives to __asm__ in cpu_model.Alina Sbirlea
Summary: Aiming to resolve failure in sanitizer bot by changning all asm directives to __asm__. Also, consistency. Reviewers: llvm-commits, echristo, vitalybuka Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D22446 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea
Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX and built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Previously reverted, up for review again to iron out outstanding issues. Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D22181 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Revert "Add runtime support for __cpu_model (__builtin_cpu_supports)"Alina Sbirlea
This reverts commit r274873 until additional fixes are resolved. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274944 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea
Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX, it builts successfully, but the current version does *not* resolve Bug 25510. The __cpu_model symbol is present in the library but it only gets loaded with -all_load. This patch will not land until this issue is clarified. Built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Note: See additional comments on D20988 (committed as r271921). Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential revision: http://reviews.llvm.org/D21033 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Revert r274865-r274870Alina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Added comments identifing code sourceAlina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Check cpuid supported for i386.Alina Sbirlea
Summary: Reviewers: Subscribers: git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Add default initialization. Add unit test.Alina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08clang-format itAlina Sbirlea
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-08Add runtime support for __cpu_model (__builtin_cpu_supports)Alina Sbirlea
Summary: This aims to add support for __cpu_model and address Bug 25510. It uses the code from lib/Support/Host.cpp for cpu detection, and creates __cpu_model with that info. Tested on OSX, it builts successfully, but the current version does *not* resolve Bug 25510. The __cpu_model symbol is present in the library but it only gets loaded with -all_load. This patch will not land until this issue is clarified. Built on Linux as well (though libgcc is the default). The use of "asm" required -std=gnu99, hence the cmake change. Corrections on better addressing this are welcome. Note: See additional comments on D20988 (committed as r271921). Reviewers: llvm-commits, joerg, echristo, mehdi_amini Subscribers: mehdi_amini Differential Revision: http://reviews.llvm.org/D21033 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274865 91177308-0d34-0410-b5e6-96231b3b80d8