diff options
author | Craig Topper <craig.topper@intel.com> | 2019-03-20 23:35:49 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-03-20 23:35:49 +0000 |
commit | 8d46403b8e133905c37d828cf152259a05901049 (patch) | |
tree | 670258456ecfc58eff4b488bbf38ce49acc82bad /llvm/lib/Support/Host.cpp | |
parent | 6452ba478638f1b40ff36727c766d7d16651d2b6 (diff) | |
download | bcm5719-llvm-8d46403b8e133905c37d828cf152259a05901049.tar.gz bcm5719-llvm-8d46403b8e133905c37d828cf152259a05901049.zip |
[X86] Add CMPXCHG8B feature flag. Set it for all CPUs except i386/i486 including 'generic'. Disable use of CMPXCHG8B when this flag isn't set.
CMPXCHG8B was introduced on i586/pentium generation.
If its not enabled, limit the atomic width to 32 bits so the AtomicExpandPass will expand to lib calls. Unclear if we should be using a different limit for other configs. The default is 1024 and experimentation shows that using an i256 atomic will cause a crash in SelectionDAG.
Differential Revision: https://reviews.llvm.org/D59576
llvm-svn: 356631
Diffstat (limited to 'llvm/lib/Support/Host.cpp')
-rw-r--r-- | llvm/lib/Support/Host.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp index 52e7080e744..69362704687 100644 --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/Support/Host.cpp @@ -1264,6 +1264,7 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) { getX86CpuIDAndInfo(1, &EAX, &EBX, &ECX, &EDX); + Features["cx8"] = (EDX >> 8) & 1; Features["cmov"] = (EDX >> 15) & 1; Features["mmx"] = (EDX >> 23) & 1; Features["fxsr"] = (EDX >> 24) & 1; |