mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
X86: Added MPX feature and bound registers.
Intel® Memory Protection Extensions (Intel® MPX) is a new feature in Skylake. It is a part of KNL and SKX sets. It is also a part of Skylake client. I added definition of %bnd0 - %bnd3 registers, each register is a pair of 64-bit integers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238916 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -168,6 +168,8 @@ def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true",
|
||||
"Support PRFCHW instructions">;
|
||||
def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true",
|
||||
"Support RDSEED instruction">;
|
||||
def FeatureMPX : SubtargetFeature<"mpx", "HasMPX", "true",
|
||||
"Support MPX instructions">;
|
||||
def FeatureLeaForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true",
|
||||
"Use LEA for adjusting the stack pointer">;
|
||||
def FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb",
|
||||
@@ -380,7 +382,7 @@ class KnightsLandingProc<string Name> : ProcessorModel<Name, HaswellModel,
|
||||
FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C,
|
||||
FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI,
|
||||
FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE,
|
||||
FeatureSlowIncDec]>;
|
||||
FeatureSlowIncDec, FeatureMPX]>;
|
||||
def : KnightsLandingProc<"knl">;
|
||||
|
||||
// FIXME: define SKX model
|
||||
@@ -391,7 +393,7 @@ class SkylakeProc<string Name> : ProcessorModel<Name, HaswellModel,
|
||||
FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C,
|
||||
FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI,
|
||||
FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE,
|
||||
FeatureSlowIncDec]>;
|
||||
FeatureSlowIncDec, FeatureMPX]>;
|
||||
def : SkylakeProc<"skylake">;
|
||||
def : SkylakeProc<"skx">; // Legacy alias.
|
||||
|
||||
|
@@ -788,6 +788,7 @@ def HasRDSEED : Predicate<"Subtarget->hasRDSEED()">;
|
||||
def HasPrefetchW : Predicate<"Subtarget->hasPRFCHW()">;
|
||||
def FPStackf32 : Predicate<"!Subtarget->hasSSE1()">;
|
||||
def FPStackf64 : Predicate<"!Subtarget->hasSSE2()">;
|
||||
def HasMPX : Predicate<"Subtarget->hasMPX()">;
|
||||
def HasCmpxchg16b: Predicate<"Subtarget->hasCmpxchg16b()">;
|
||||
def Not64BitMode : Predicate<"!Subtarget->is64Bit()">,
|
||||
AssemblerPredicate<"!Mode64Bit", "Not 64-bit mode">;
|
||||
|
@@ -302,6 +302,11 @@ def CR15 : X86Reg<"cr15", 15>;
|
||||
def EIZ : X86Reg<"eiz", 4>;
|
||||
def RIZ : X86Reg<"riz", 4>;
|
||||
|
||||
// Bound registers, used in MPX instructions
|
||||
def BND0 : X86Reg<"bnd0", 0>;
|
||||
def BND1 : X86Reg<"bnd1", 0>;
|
||||
def BND2 : X86Reg<"bnd2", 0>;
|
||||
def BND3 : X86Reg<"bnd3", 0>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Register Class Definitions... now that we have all of the pieces, define the
|
||||
@@ -484,3 +489,6 @@ def VK8WM : RegisterClass<"X86", [v8i1], 8, (sub VK8, K0)> {let Size = 8;}
|
||||
def VK16WM : RegisterClass<"X86", [v16i1], 16, (add VK8WM)> {let Size = 16;}
|
||||
def VK32WM : RegisterClass<"X86", [v32i1], 32, (add VK16WM)> {let Size = 32;}
|
||||
def VK64WM : RegisterClass<"X86", [v64i1], 64, (add VK32WM)> {let Size = 64;}
|
||||
|
||||
// Bound registers
|
||||
def BNDR : RegisterClass<"X86", [v2i64], 128, (sequence "BND%u", 0, 3)>;
|
@@ -259,6 +259,7 @@ void X86Subtarget::initializeEnvironment() {
|
||||
HasSHA = false;
|
||||
HasPRFCHW = false;
|
||||
HasRDSEED = false;
|
||||
HasMPX = false;
|
||||
IsBTMemSlow = false;
|
||||
IsSHLDSlow = false;
|
||||
IsUAMemFast = false;
|
||||
|
@@ -218,6 +218,9 @@ protected:
|
||||
/// Processor has AVX-512 Vector Length eXtenstions
|
||||
bool HasVLX;
|
||||
|
||||
/// Processot supports MPX - Memory Protection Extensions
|
||||
bool HasMPX;
|
||||
|
||||
/// Use software floating point for code generation.
|
||||
bool UseSoftFloat;
|
||||
|
||||
@@ -385,6 +388,7 @@ public:
|
||||
bool hasDQI() const { return HasDQI; }
|
||||
bool hasBWI() const { return HasBWI; }
|
||||
bool hasVLX() const { return HasVLX; }
|
||||
bool hasMPX() const { return HasMPX; }
|
||||
|
||||
bool isAtom() const { return X86ProcFamily == IntelAtom; }
|
||||
bool isSLM() const { return X86ProcFamily == IntelSLM; }
|
||||
|
Reference in New Issue
Block a user