summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Host.cpp
diff options
context:
space:
mode:
authorGabor Buella <gabor.buella@intel.com>2018-05-08 06:47:36 +0000
committerGabor Buella <gabor.buella@intel.com>2018-05-08 06:47:36 +0000
commit2b5e96004b23c9506bbf8ec3480861fb9157ceb8 (patch)
tree4e1de0bae9a75b5f29610f1f785d2f1011bfae2f /llvm/lib/Support/Host.cpp
parentbd088560a88f602c78ffde0b68c97b20f29dc1b6 (diff)
downloadbcm5719-llvm-2b5e96004b23c9506bbf8ec3480861fb9157ceb8.tar.gz
bcm5719-llvm-2b5e96004b23c9506bbf8ec3480861fb9157ceb8.zip
[x86] Introduce the pconfig instruction
Reviewers: craig.topper, zvi Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D46430 llvm-svn: 331739
Diffstat (limited to 'llvm/lib/Support/Host.cpp')
-rw-r--r--llvm/lib/Support/Host.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index ff3a71f2456..d13aa8d5b1a 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -1266,6 +1266,18 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
Features["ibt"] = HasLeaf7 && ((EDX >> 20) & 1);
+ // There are two CPUID leafs which information associated with the pconfig
+ // instruction:
+ // EAX=0x7, ECX=0x0 indicates the availability of the instruction (via the 18th
+ // bit of EDX), while the EAX=0x1b leaf returns information on the
+ // availability of specific pconfig leafs.
+ // The target feature here only refers to the the first of these two.
+ // Users might need to check for the availability of specific pconfig
+ // leaves using cpuid, since that information is ignored while
+ // detecting features using the "-march=native" flag.
+ // For more info, see X86 ISA docs.
+ Features["pconfig"] = HasLeaf7 && ((EDX >> 18) & 1);
+
bool HasLeafD = MaxLevel >= 0xd &&
!getX86CpuIDAndInfoEx(0xd, 0x1, &EAX, &EBX, &ECX, &EDX);
OpenPOWER on IntegriCloud