diff options
| author | Simon Dardis <simon.dardis@mips.com> | 2018-03-13 14:39:44 +0000 |
|---|---|---|
| committer | Simon Dardis <simon.dardis@mips.com> | 2018-03-13 14:39:44 +0000 |
| commit | 476ed8f26e91bce8144b4df4c20eb1c990383ba3 (patch) | |
| tree | e82da64194c526395d0c3add7e35f241e37d819a /llvm/lib/Target/Mips | |
| parent | d9a8b6a745c15c78a09fc4bf2723c8164b402232 (diff) | |
| download | bcm5719-llvm-476ed8f26e91bce8144b4df4c20eb1c990383ba3.tar.gz bcm5719-llvm-476ed8f26e91bce8144b4df4c20eb1c990383ba3.zip | |
[mips] Fix the definitions of the EVA instructions
Correct their availability to their respective ISAs.
Reviewers: atanasyan
Differential Revision: https://reviews.llvm.org/D44209
llvm-svn: 327403
Diffstat (limited to 'llvm/lib/Target/Mips')
| -rw-r--r-- | llvm/lib/Target/Mips/MicroMipsInstrInfo.td | 95 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsEVAInstrInfo.td | 62 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsInstrInfo.td | 2 |
3 files changed, 84 insertions, 75 deletions
diff --git a/llvm/lib/Target/Mips/MicroMipsInstrInfo.td b/llvm/lib/Target/Mips/MicroMipsInstrInfo.td index 20995f23721..fc215a341c1 100644 --- a/llvm/lib/Target/Mips/MicroMipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MicroMipsInstrInfo.td @@ -777,32 +777,50 @@ let DecoderNamespace = "MicroMips", Predicates = [InMicroMips] in { def SW_MM : Store<"sw", GPR32Opnd, null_frag, II_SW>, MMRel, LW_FM_MM<0x3e>; } - +} +let DecoderNamespace = "MicroMips" in { let DecoderMethod = "DecodeMemMMImm9" in { def LBE_MM : MMRel, Load<"lbe", GPR32Opnd, null_frag, II_LBE>, - POOL32C_LHUE_FM_MM<0x18, 0x6, 0x4>; + POOL32C_LHUE_FM_MM<0x18, 0x6, 0x4>, ISA_MICROMIPS, ASE_EVA; def LBuE_MM : MMRel, Load<"lbue", GPR32Opnd, null_frag, II_LBUE>, - POOL32C_LHUE_FM_MM<0x18, 0x6, 0x0>; - def LHE_MM : MMRel, LoadMemory<"lhe", GPR32Opnd, mem_simm9, - null_frag, II_LHE>, - POOL32C_LHUE_FM_MM<0x18, 0x6, 0x5>; - def LHuE_MM : MMRel, LoadMemory<"lhue", GPR32Opnd, mem_simm9, - null_frag, II_LHUE>, - POOL32C_LHUE_FM_MM<0x18, 0x6, 0x1>; - def LWE_MM : MMRel, LoadMemory<"lwe", GPR32Opnd, mem_simm9, - null_frag, II_LWE>, - POOL32C_LHUE_FM_MM<0x18, 0x6, 0x7>; - def SBE_MM : MMRel, StoreMemory<"sbe", GPR32Opnd, mem_simm9, - null_frag, II_SBE>, - POOL32C_LHUE_FM_MM<0x18, 0xa, 0x4>; - def SHE_MM : MMRel, StoreMemory<"she", GPR32Opnd, mem_simm9, - null_frag, II_SHE>, - POOL32C_LHUE_FM_MM<0x18, 0xa, 0x5>; - def SWE_MM : MMRel, StoreMemory<"swe", GPR32Opnd, mem_simm9, - null_frag, II_SWE>, - POOL32C_LHUE_FM_MM<0x18, 0xa, 0x7>; + POOL32C_LHUE_FM_MM<0x18, 0x6, 0x0>, ISA_MICROMIPS, ASE_EVA; + def LHE_MM : MMRel, LoadMemory<"lhe", GPR32Opnd, mem_simm9, null_frag, + II_LHE>, + POOL32C_LHUE_FM_MM<0x18, 0x6, 0x5>, ISA_MICROMIPS, ASE_EVA; + def LHuE_MM : MMRel, LoadMemory<"lhue", GPR32Opnd, mem_simm9, null_frag, + II_LHUE>, + POOL32C_LHUE_FM_MM<0x18, 0x6, 0x1>, ISA_MICROMIPS, ASE_EVA; + def LWE_MM : MMRel, LoadMemory<"lwe", GPR32Opnd, mem_simm9, null_frag, + II_LWE>, + POOL32C_LHUE_FM_MM<0x18, 0x6, 0x7>, ISA_MICROMIPS, ASE_EVA; + def SBE_MM : MMRel, StoreMemory<"sbe", GPR32Opnd, mem_simm9, null_frag, + II_SBE>, + POOL32C_LHUE_FM_MM<0x18, 0xa, 0x4>, ISA_MICROMIPS, ASE_EVA; + def SHE_MM : MMRel, StoreMemory<"she", GPR32Opnd, mem_simm9, null_frag, + II_SHE>, + POOL32C_LHUE_FM_MM<0x18, 0xa, 0x5>, ISA_MICROMIPS, ASE_EVA; + def SWE_MM : MMRel, StoreMemory<"swe", GPR32Opnd, mem_simm9, null_frag, + II_SWE>, + POOL32C_LHUE_FM_MM<0x18, 0xa, 0x7>, ISA_MICROMIPS, ASE_EVA; + def LWLE_MM : MMRel, LoadLeftRightMM<"lwle", MipsLWL, GPR32Opnd, mem_mm_9, + II_LWLE>, + POOL32C_STEVA_LDEVA_FM_MM<0x6, 0x2>, + ISA_MICROMIPS32_NOT_MIPS32R6, ASE_EVA; + def LWRE_MM : MMRel, LoadLeftRightMM<"lwre", MipsLWR, GPR32Opnd, mem_mm_9, + II_LWRE>, + POOL32C_STEVA_LDEVA_FM_MM<0x6, 0x3>, + ISA_MICROMIPS32_NOT_MIPS32R6, ASE_EVA; + def SWLE_MM : MMRel, StoreLeftRightMM<"swle", MipsSWL, GPR32Opnd, mem_mm_9, + II_SWLE>, + POOL32C_STEVA_LDEVA_FM_MM<0xa, 0x0>, + ISA_MICROMIPS32_NOT_MIPS32R6, ASE_EVA; + def SWRE_MM : MMRel, StoreLeftRightMM<"swre", MipsSWR, GPR32Opnd, mem_mm_9, + II_SWRE>, + POOL32C_STEVA_LDEVA_FM_MM<0xa, 0x1>, + ISA_MICROMIPS32_NOT_MIPS32R6, ASE_EVA; } - +} +let DecoderNamespace = "MicroMips", Predicates = [InMicroMips] in { def LWXS_MM : LoadWordIndexedScaledMM<"lwxs", GPR32Opnd>, LWXS_FM_MM<0x118>; /// Load and Store Instructions - unaligned @@ -814,18 +832,6 @@ let DecoderNamespace = "MicroMips", Predicates = [InMicroMips] in { LWL_FM_MM<0x8>; def SWR_MM : StoreLeftRightMM<"swr", MipsSWR, GPR32Opnd, mem_mm_12, II_SWR>, LWL_FM_MM<0x9>; - let DecoderMethod = "DecodeMemMMImm9" in { - def LWLE_MM : LoadLeftRightMM<"lwle", MipsLWL, GPR32Opnd, mem_mm_9, - II_LWLE>, POOL32C_STEVA_LDEVA_FM_MM<0x6, 0x2>; - def LWRE_MM : LoadLeftRightMM<"lwre", MipsLWR, GPR32Opnd, mem_mm_9, - II_LWRE>, POOL32C_STEVA_LDEVA_FM_MM<0x6, 0x3>; - def SWLE_MM : StoreLeftRightMM<"swle", MipsSWL, GPR32Opnd, mem_mm_9, - II_SWLE>, - POOL32C_STEVA_LDEVA_FM_MM<0xa, 0x0>; - def SWRE_MM : StoreLeftRightMM<"swre", MipsSWR, GPR32Opnd, mem_mm_9, - II_SWRE>, - POOL32C_STEVA_LDEVA_FM_MM<0xa, 0x1>, ISA_MIPS1_NOT_32R6_64R6; - } /// Load and Store Instructions - multiple def SWM32_MM : StoreMultMM<"swm32", II_SWM>, LWM_FM_MM<0xd>; @@ -978,23 +984,30 @@ let DecoderNamespace = "MicroMips", Predicates = [InMicroMips] in { /// Load-linked, Store-conditional def LL_MM : LLBaseMM<"ll", GPR32Opnd>, LL_FM_MM<0x3>; def SC_MM : SCBaseMM<"sc", GPR32Opnd>, LL_FM_MM<0xb>; - - def LLE_MM : MMRel, LLEBaseMM<"lle", GPR32Opnd>, LLE_FM_MM<0x6>; - def SCE_MM : MMRel, SCEBaseMM<"sce", GPR32Opnd>, LLE_FM_MM<0xA>; - +} +let DecoderNamespace = "MicroMips" in { + def LLE_MM : MMRel, LLEBaseMM<"lle", GPR32Opnd>, LLE_FM_MM<0x6>, + ISA_MICROMIPS, ASE_EVA; + def SCE_MM : MMRel, SCEBaseMM<"sce", GPR32Opnd>, LLE_FM_MM<0xA>, + ISA_MICROMIPS, ASE_EVA; +} +let DecoderNamespace = "MicroMips", Predicates = [InMicroMips] in { let DecoderMethod = "DecodeCacheOpMM" in { def CACHE_MM : MMRel, CacheOp<"cache", mem_mm_12, II_CACHE>, CACHE_PREF_FM_MM<0x08, 0x6>; def PREF_MM : MMRel, CacheOp<"pref", mem_mm_12, II_PREF>, CACHE_PREF_FM_MM<0x18, 0x2>; } - +} +let DecoderNamespace = "MicroMips" in { let DecoderMethod = "DecodePrefeOpMM" in { def PREFE_MM : MMRel, CacheOp<"prefe", mem_mm_9, II_PREFE>, - CACHE_PREFE_FM_MM<0x18, 0x2>; + CACHE_PREFE_FM_MM<0x18, 0x2>, ISA_MICROMIPS, ASE_EVA; def CACHEE_MM : MMRel, CacheOp<"cachee", mem_mm_9, II_CACHEE>, - CACHE_PREFE_FM_MM<0x18, 0x3>; + CACHE_PREFE_FM_MM<0x18, 0x3>, ISA_MICROMIPS, ASE_EVA; } +} +let DecoderNamespace = "MicroMips", Predicates = [InMicroMips] in { def SSNOP_MM : MMRel, Barrier<"ssnop", II_SSNOP>, BARRIER_FM_MM<0x1>; def EHB_MM : MMRel, Barrier<"ehb", II_EHB>, BARRIER_FM_MM<0x3>; def PAUSE_MM : MMRel, Barrier<"pause", II_PAUSE>, BARRIER_FM_MM<0x5>; diff --git a/llvm/lib/Target/Mips/MipsEVAInstrInfo.td b/llvm/lib/Target/Mips/MipsEVAInstrInfo.td index 3edd4942abd..59254f211ea 100644 --- a/llvm/lib/Target/Mips/MipsEVAInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsEVAInstrInfo.td @@ -95,6 +95,7 @@ class LOAD_LEFT_RIGHT_EVA_DESC_BASE<string instr_asm, RegisterOperand GPROpnd, string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); list<dag> Pattern = []; string DecoderMethod = "DecodeMemEVA"; + string BaseOpcode = instr_asm; string Constraints = "$src = $rt"; bit canFoldAsLoad = 1; InstrItinClass Itinerary = itin; @@ -110,6 +111,7 @@ class STORE_LEFT_RIGHT_EVA_DESC_BASE<string instr_asm, RegisterOperand GPROpnd, string AsmString = !strconcat(instr_asm, "\t$rt, $addr"); list<dag> Pattern = []; string DecoderMethod = "DecodeMemEVA"; + string BaseOpcode = instr_asm; InstrItinClass Itinerary = itin; } @@ -177,38 +179,32 @@ class PREFE_DESC : CACHEE_DESC_BASE<"prefe", mem_simm9, II_PREFE>; // //===----------------------------------------------------------------------===// -/// Load and Store EVA Instructions -def LBE : MMRel, LBE_ENC, LBE_DESC, ASE_EVA; -def LBuE : MMRel, LBuE_ENC, LBuE_DESC, ASE_EVA; -def LHE : MMRel, LHE_ENC, LHE_DESC, ASE_EVA; -def LHuE : MMRel, LHuE_ENC, LHuE_DESC, ASE_EVA; -let AdditionalPredicates = [NotInMicroMips] in { -def LWE : MMRel, LWE_ENC, LWE_DESC, ASE_EVA; -} -def SBE : MMRel, SBE_ENC, SBE_DESC, ASE_EVA; -def SHE : MMRel, SHE_ENC, SHE_DESC, ASE_EVA; -let AdditionalPredicates = [NotInMicroMips] in { -def SWE : MMRel, SWE_ENC, SWE_DESC, ASE_EVA; -} - -/// load/store left/right EVA let AdditionalPredicates = [NotInMicroMips] in { -def LWLE : LWLE_ENC, LWLE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; -def LWRE : LWRE_ENC, LWRE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; -def SWLE : SWLE_ENC, SWLE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; -def SWRE : SWRE_ENC, SWRE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; + /// Load and Store EVA Instructions + def LBE : MMRel, LBE_ENC, LBE_DESC, ISA_MIPS32R2, ASE_EVA; + def LBuE : MMRel, LBuE_ENC, LBuE_DESC, ISA_MIPS32R2, ASE_EVA; + def LHE : MMRel, LHE_ENC, LHE_DESC, ISA_MIPS32R2, ASE_EVA; + def LHuE : MMRel, LHuE_ENC, LHuE_DESC, ISA_MIPS32R2, ASE_EVA; + def LWE : MMRel, LWE_ENC, LWE_DESC, ISA_MIPS32R2, ASE_EVA; + def SBE : MMRel, SBE_ENC, SBE_DESC, ISA_MIPS32R2, ASE_EVA; + def SHE : MMRel, SHE_ENC, SHE_DESC, ISA_MIPS32R2, ASE_EVA; + def SWE : MMRel, SWE_ENC, SWE_DESC, ISA_MIPS32R2, ASE_EVA; + + /// load/store left/right EVA + def LWLE : MMRel, LWLE_ENC, LWLE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; + def LWRE : MMRel, LWRE_ENC, LWRE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; + def SWLE : MMRel, SWLE_ENC, SWLE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; + def SWRE : MMRel, SWRE_ENC, SWRE_DESC, ISA_MIPS32R2_NOT_32R6_64R6, ASE_EVA; + + /// Load-linked EVA, Store-conditional EVA + def LLE : MMRel, LLE_ENC, LLE_DESC, ISA_MIPS32R2, ASE_EVA; + def SCE : MMRel, SCE_ENC, SCE_DESC, ISA_MIPS32R2, ASE_EVA; + + /// TLB invalidate instructions + def TLBINV : TLBINV_ENC, TLBINV_DESC, ISA_MIPS32R2, ASE_EVA; + def TLBINVF : TLBINVF_ENC, TLBINVF_DESC, ISA_MIPS32R2, ASE_EVA; + + /// EVA versions of cache and pref + def CACHEE : MMRel, CACHEE_ENC, CACHEE_DESC, ISA_MIPS32R2, ASE_EVA; + def PREFE : MMRel, PREFE_ENC, PREFE_DESC, ISA_MIPS32R2, ASE_EVA; } - -/// Load-linked EVA, Store-conditional EVA -let AdditionalPredicates = [NotInMicroMips] in { -def LLE : MMRel, LLE_ENC, LLE_DESC, ASE_EVA; -def SCE : MMRel, SCE_ENC, SCE_DESC, ASE_EVA; -} - -let AdditionalPredicates = [NotInMicroMips] in { - def TLBINV : TLBINV_ENC, TLBINV_DESC, ASE_EVA; - def TLBINVF : TLBINVF_ENC, TLBINVF_DESC, ASE_EVA; -} - -def CACHEE : MMRel, CACHEE_ENC, CACHEE_DESC, ASE_EVA; -def PREFE : MMRel, PREFE_ENC, PREFE_DESC, ASE_EVA; diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index 45ebc4e1944..b8095051c97 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -235,7 +235,7 @@ def IsBE : Predicate<"!Subtarget->isLittle()">; def IsNotNaCl : Predicate<"!Subtarget->isTargetNaCl()">; def UseTCCInDIV : AssemblerPredicate<"FeatureUseTCCInDIV">; def HasEVA : Predicate<"Subtarget->hasEVA()">, - AssemblerPredicate<"FeatureEVA,FeatureMips32r2">; + AssemblerPredicate<"FeatureEVA">; def HasMSA : Predicate<"Subtarget->hasMSA()">, AssemblerPredicate<"FeatureMSA">; def HasMadd4 : Predicate<"!Subtarget->disableMadd4()">, |

