From 5acf66ff97843df85a697b38b091cdcc8decbd0a Mon Sep 17 00:00:00 2001 From: Asaf Badouh Date: Tue, 15 Dec 2015 13:35:29 +0000 Subject: [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 --- llvm/lib/Support/Host.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Support/Host.cpp') 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 &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; -- cgit v1.1