aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Host.cpp
diff options
context:
space:
mode:
authorAsaf Badouh <asaf.badouh@intel.com>2015-12-15 13:35:29 +0000
committerAsaf Badouh <asaf.badouh@intel.com>2015-12-15 13:35:29 +0000
commit5acf66ff97843df85a697b38b091cdcc8decbd0a (patch)
tree886601e488d46ac3385f89c31f20064286771d19 /llvm/lib/Support/Host.cpp
parent801ee74167e9887f058dc2bf7bb19289ff842132 (diff)
downloadllvm-5acf66ff97843df85a697b38b091cdcc8decbd0a.zip
llvm-5acf66ff97843df85a697b38b091cdcc8decbd0a.tar.gz
llvm-5acf66ff97843df85a697b38b091cdcc8decbd0a.tar.bz2
[x86] adding PKU feature flag
the feature flag is essential for RDPKRU and WRPKRU instruction more about the instruction can be found in the SDM rev 56, vol 2 from http://www.intel.com/sdm Differential Revision: http://reviews.llvm.org/D15491 llvm-svn: 255644
Diffstat (limited to 'llvm/lib/Support/Host.cpp')
-rw-r--r--llvm/lib/Support/Host.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index d7c9947..c0f9e07 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -812,6 +812,8 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);
Features["sha"] = HasLeaf7 && ((EBX >> 29) & 1);
+ // Enable protection keys
+ Features["pku"] = HasLeaf7 && ((ECX >> 4) & 1);
// AVX512 is only supported if the OS supports the context save for it.
Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save;