llvm.org GIT mirror llvm / 22bb8f5
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255644 91177308-0d34-0410-b5e6-96231b3b80d8 Asaf Badouh 3 years ago
5 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
811811 Features["rdseed"] = HasLeaf7 && ((EBX >> 18) & 1);
812812 Features["adx"] = HasLeaf7 && ((EBX >> 19) & 1);
813813 Features["sha"] = HasLeaf7 && ((EBX >> 29) & 1);
814 // Enable protection keys
815 Features["pku"] = HasLeaf7 && ((ECX >> 4) & 1);
814816
815817 // AVX512 is only supported if the OS supports the context save for it.
816818 Features["avx512f"] = HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save;
133133 def FeatureVLX : SubtargetFeature<"avx512vl", "HasVLX", "true",
134134 "Enable AVX-512 Vector Length eXtensions",
135135 [FeatureAVX512]>;
136 def FeaturePKU : SubtargetFeature<"pku", "HasPKU", "true",
137 "Enable protection keys">;
136138 def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true",
137139 "Enable packed carry-less multiplication instructions",
138140 [FeatureSSE2]>;
490492 FeatureDQI,
491493 FeatureBWI,
492494 FeatureVLX,
495 FeaturePKU,
493496 FeatureCMPXCHG16B,
494497 FeatureSlowBTMem,
495498 FeaturePOPCNT,
770770 def NoVLX : Predicate<"!Subtarget->hasVLX()">;
771771 def NoVLX_Or_NoBWI : Predicate<"!Subtarget->hasVLX() || !Subtarget->hasBWI()">;
772772 def NoVLX_Or_NoDQI : Predicate<"!Subtarget->hasVLX() || !Subtarget->hasDQI()">;
773 def PKU : Predicate<"!Subtarget->hasPKU()">;
773774
774775 def HasPOPCNT : Predicate<"Subtarget->hasPOPCNT()">;
775776 def HasAES : Predicate<"Subtarget->hasAES()">;
269269 HasBWI = false;
270270 HasVLX = false;
271271 HasADX = false;
272 HasPKU = false;
272273 HasSHA = false;
273274 HasPRFCHW = false;
274275 HasRDSEED = false;
221221
222222 /// Processor has AVX-512 Vector Length eXtenstions
223223 bool HasVLX;
224
225 /// Processor has PKU extenstions
226 bool HasPKU;
224227
225228 /// Processot supports MPX - Memory Protection Extensions
226229 bool HasMPX;
397400 bool hasDQI() const { return HasDQI; }
398401 bool hasBWI() const { return HasBWI; }
399402 bool hasVLX() const { return HasVLX; }
403 bool hasPKU() const { return HasPKU; }
400404 bool hasMPX() const { return HasMPX; }
401405
402406 bool isAtom() const { return X86ProcFamily == IntelAtom; }