summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Host.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-03-20 23:35:49 +0000
committerCraig Topper <craig.topper@intel.com>2019-03-20 23:35:49 +0000
commit8d46403b8e133905c37d828cf152259a05901049 (patch)
tree670258456ecfc58eff4b488bbf38ce49acc82bad /llvm/lib/Support/Host.cpp
parent6452ba478638f1b40ff36727c766d7d16651d2b6 (diff)
downloadbcm5719-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.cpp1
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;
OpenPOWER on IntegriCloud