Index: llvm/trunk/lib/Target/AMDGPU/AMDGPU.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/AMDGPU.td +++ llvm/trunk/lib/Target/AMDGPU/AMDGPU.td @@ -675,23 +675,30 @@ // Predicate helper class //===----------------------------------------------------------------------===// -def isSICI : Predicate< - "Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||" - "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS" ->, AssemblerPredicate<"!FeatureGCN3Encoding">; - -def isVI : Predicate < - "Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">, - AssemblerPredicate<"FeatureGCN3Encoding">; +def isGFX6GFX7 : + Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS ||" + "Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">, + AssemblerPredicate<"!FeatureGCN3Encoding">; -def isGFX9 : Predicate < - "Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">, +def isGFX7Plus : + Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">, + AssemblerPredicate<"FeatureCIInsts">; + +def isGFX8Plus : + Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS">, + AssemblerPredicate<"FeatureVIInsts">; + +def isGFX9Plus : + Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">, AssemblerPredicate<"FeatureGFX9Insts">; -// TODO: Either the name to be changed or we simply use IsCI! -def isCIVI : Predicate < - "Subtarget->getGeneration() >= AMDGPUSubtarget::SEA_ISLANDS">, - AssemblerPredicate<"FeatureCIInsts">; +def isGFX7 : + Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::SEA_ISLANDS">, + AssemblerPredicate<"!FeatureGCN3Encoding,FeatureCIInsts">; + +def isGFX8 : + Predicate<"Subtarget->getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS">, + AssemblerPredicate<"FeatureGCN3Encoding,FeatureVIInsts,!FeatureGFX9Insts">; def HasFlatAddressSpace : Predicate<"Subtarget->hasFlatAddressSpace()">, AssemblerPredicate<"FeatureFlatAddressSpace">; Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUGISel.td @@ -130,7 +130,7 @@ def : GISelSop2Pat ; let AddedComplexity = 100 in { -let SubtargetPredicate = isSICI in { +let SubtargetPredicate = isGFX6GFX7 in { def : GISelVop2Pat ; } def : GISelVop2CommutePat ; Index: llvm/trunk/lib/Target/AMDGPU/BUFInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/BUFInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/BUFInstructions.td @@ -830,7 +830,7 @@ // This is not described in AMD documentation, // but 'lds' versions of these opcodes are available // in at least GFX8+ chips. See Bug 37653. -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { defm BUFFER_LOAD_DWORDX2_LDS : MUBUF_Pseudo_Loads < "buffer_load_dwordx2", VReg_64, v2i32, null_frag, 0, 1 >; @@ -939,7 +939,7 @@ "buffer_atomic_dec_x2", VReg_64, i64, atomic_dec_global >; -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def BUFFER_STORE_LDS_DWORD : MUBUF_Pseudo_Store_Lds <"buffer_store_lds_dword">; } @@ -1040,7 +1040,7 @@ defm TBUFFER_STORE_FORMAT_D16_XYZW : MTBUF_Pseudo_Stores <"tbuffer_store_format_d16_xyzw", VReg_64>; } // End HasPackedD16VMem. -let SubtargetPredicate = isCIVI in { +let SubtargetPredicate = isGFX7Plus in { //===----------------------------------------------------------------------===// // Instruction definitions for CI and newer. @@ -1052,7 +1052,7 @@ def BUFFER_WBINVL1_VOL : MUBUF_Invalidate <"buffer_wbinvl1_vol", int_amdgcn_buffer_wbinvl1_vol>; -} // End let SubtargetPredicate = isCIVI +} // End let SubtargetPredicate = isGFX7Plus //===----------------------------------------------------------------------===// // MUBUF Patterns @@ -1319,7 +1319,7 @@ >; } -let SubtargetPredicate = isSICI in { +let SubtargetPredicate = isGFX6GFX7 in { def : MUBUFLoad_PatternADDR64 ; def : MUBUFLoad_PatternADDR64 ; def : MUBUFLoad_PatternADDR64 ; @@ -1327,7 +1327,7 @@ defm : MUBUFLoad_Atomic_Pattern ; defm : MUBUFLoad_Atomic_Pattern ; -} // End SubtargetPredicate = isSICI +} // End SubtargetPredicate = isGFX6GFX7 multiclass MUBUFLoad_Pattern { @@ -1457,10 +1457,10 @@ (Instr_OFFSET $val, $rsrc, $soffset, (as_i16imm $offset), 0, 0, 0) >; } -let SubtargetPredicate = isSICI in { +let SubtargetPredicate = isGFX6GFX7 in { defm : MUBUFStore_Atomic_Pattern ; defm : MUBUFStore_Atomic_Pattern ; -} // End Predicates = isSICI +} // End Predicates = isGFX6GFX7 multiclass MUBUFStore_Pattern , Enc64, SIMCInstr { - let AssemblerPredicate=isSICI; + let AssemblerPredicate=isGFX6GFX7; let DecoderNamespace="SICI"; let Inst{11-0} = !if(ps.has_offset, offset, ?); @@ -1771,7 +1771,7 @@ MTBUF_Real, Enc64, SIMCInstr { - let AssemblerPredicate=isSICI; + let AssemblerPredicate=isGFX6GFX7; let DecoderNamespace="SICI"; let Inst{11-0} = !if(ps.has_offset, offset, ?); @@ -1815,7 +1815,7 @@ class MUBUF_Real_ci op, MUBUF_Pseudo ps> : MUBUF_Real_si { - let AssemblerPredicate=isCIOnly; + let AssemblerPredicate=isGFX7; let DecoderNamespace="CI"; } @@ -1830,7 +1830,7 @@ MUBUF_Real, Enc64, SIMCInstr { - let AssemblerPredicate=isVI; + let AssemblerPredicate=isGFX8Plus; let DecoderNamespace="VI"; let Inst{11-0} = !if(ps.has_offset, offset, ?); @@ -2005,7 +2005,7 @@ MTBUF_Real, Enc64, SIMCInstr { - let AssemblerPredicate=isVI; + let AssemblerPredicate=isGFX8Plus; let DecoderNamespace="VI"; let Inst{11-0} = !if(ps.has_offset, offset, ?); Index: llvm/trunk/lib/Target/AMDGPU/DSInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/DSInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/DSInstructions.td @@ -547,7 +547,7 @@ // Instruction definitions for CI and newer. //===----------------------------------------------------------------------===// -let SubtargetPredicate = isCIVI in { +let SubtargetPredicate = isGFX7Plus in { defm DS_WRAP_RTN_B32 : DS_1A2D_RET_mc<"ds_wrap_rtn_b32", VGPR_32>; defm DS_CONDXCHG32_RTN_B64 : DS_1A1D_RET_mc<"ds_condxchg32_rtn_b64", VReg_64>; @@ -566,13 +566,13 @@ def DS_NOP : DS_VOID<"ds_nop">; -} // let SubtargetPredicate = isCIVI +} // let SubtargetPredicate = isGFX7Plus //===----------------------------------------------------------------------===// // Instruction definitions for VI and newer. //===----------------------------------------------------------------------===// -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { let Uses = [EXEC] in { def DS_PERMUTE_B32 : DS_1A1D_PERMUTE <"ds_permute_b32", @@ -583,7 +583,7 @@ def DS_ADD_SRC2_F32 : DS_1A<"ds_add_src2_f32">; -} // let SubtargetPredicate = isVI +} // let SubtargetPredicate = isGFX8Plus //===----------------------------------------------------------------------===// // DS Patterns @@ -727,7 +727,7 @@ // v2i32 loads are split into i32 loads on SI during lowering, due to a bug // related to bounds checking. -let OtherPredicates = [LDSRequiresM0Init, isCIVI] in { +let OtherPredicates = [LDSRequiresM0Init, isGFX7Plus] in { def : DS64Bit4ByteAlignedReadPat; def : DS64Bit4ByteAlignedWritePat; } @@ -830,7 +830,7 @@ class DS_Real_si op, DS_Pseudo ds> : DS_Real , SIMCInstr { - let AssemblerPredicates=[isSICI]; + let AssemblerPredicates=[isGFX6GFX7]; let DecoderNamespace="SICI"; // encoding @@ -1001,7 +1001,7 @@ class DS_Real_vi op, DS_Pseudo ds> : DS_Real , SIMCInstr { - let AssemblerPredicates = [isVI]; + let AssemblerPredicates = [isGFX8Plus]; let DecoderNamespace="VI"; // encoding Index: llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/FLATInstructions.td @@ -490,7 +490,7 @@ defm FLAT_ATOMIC_DEC_X2 : FLAT_Atomic_Pseudo <"flat_atomic_dec_x2", VReg_64, i64, atomic_dec_flat>; -let SubtargetPredicate = isCI in { // CI Only flat instructions : FIXME Only? +let SubtargetPredicate = isGFX7Plus in { // CI Only flat instructions : FIXME Only? defm FLAT_ATOMIC_FCMPSWAP : FLAT_Atomic_Pseudo <"flat_atomic_fcmpswap", VGPR_32, f32, null_frag, v2f32, VReg_64>; @@ -510,7 +510,7 @@ defm FLAT_ATOMIC_FMAX_X2 : FLAT_Atomic_Pseudo <"flat_atomic_fmax_x2", VReg_64, f64>; -} // End SubtargetPredicate = isCI +} // End SubtargetPredicate = isGFX7Plus let SubtargetPredicate = HasFlatGlobalInsts in { defm GLOBAL_LOAD_UBYTE : FLAT_Global_Load_Pseudo <"global_load_ubyte", VGPR_32>; @@ -916,7 +916,7 @@ class FLAT_Real_ci op, FLAT_Pseudo ps> : FLAT_Real , SIMCInstr { - let AssemblerPredicate = isCIOnly; + let AssemblerPredicate = isGFX7; let DecoderNamespace="CI"; } @@ -984,7 +984,7 @@ class FLAT_Real_vi op, FLAT_Pseudo ps> : FLAT_Real , SIMCInstr { - let AssemblerPredicate = isVI; + let AssemblerPredicate = isGFX8Plus; let DecoderNamespace="VI"; } Index: llvm/trunk/lib/Target/AMDGPU/MIMGInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/MIMGInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/MIMGInstructions.td @@ -263,14 +263,14 @@ def _si : MIMG_Atomic_Helper, SIMCInstr, MIMGe { - let AssemblerPredicates = [isSICI]; + let AssemblerPredicates = [isGFX6GFX7]; let DisableDecoder = DisableSIDecoder; } def _vi : MIMG_Atomic_Helper, SIMCInstr, MIMGe { - let AssemblerPredicates = [isVI]; + let AssemblerPredicates = [isGFX8Plus]; let DisableDecoder = DisableVIDecoder; let MIMGEncoding = MIMGEncGfx8; } Index: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td +++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td @@ -5,20 +5,12 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -def isCI : Predicate<"Subtarget->getGeneration() " - ">= AMDGPUSubtarget::SEA_ISLANDS">; -def isCIOnly : Predicate<"Subtarget->getGeneration() ==" - "AMDGPUSubtarget::SEA_ISLANDS">, - AssemblerPredicate <"FeatureSeaIslands">; -def isVIOnly : Predicate<"Subtarget->getGeneration() ==" - "AMDGPUSubtarget::VOLCANIC_ISLANDS">, - AssemblerPredicate <"FeatureVolcanicIslands">; def DisableInst : Predicate <"false">, AssemblerPredicate<"FeatureDisable">; class GCNPredicateControl : PredicateControl { - Predicate SIAssemblerPredicate = isSICI; - Predicate VIAssemblerPredicate = isVI; + Predicate SIAssemblerPredicate = isGFX6GFX7; + Predicate VIAssemblerPredicate = isGFX8Plus; } // Execpt for the NONE field, this must be kept in sync with the @@ -1045,7 +1037,7 @@ def _si : EXP_Helper, SIMCInstr <"exp"#!if(done, "_done", ""), SIEncodingFamily.SI>, EXPe { - let AssemblerPredicates = [isSICI]; + let AssemblerPredicates = [isGFX6GFX7]; let DecoderNamespace = "SICI"; let DisableDecoder = DisableSIDecoder; } @@ -1053,7 +1045,7 @@ def _vi : EXP_Helper, SIMCInstr <"exp"#!if(done, "_done", ""), SIEncodingFamily.VI>, EXPe_vi { - let AssemblerPredicates = [isVI]; + let AssemblerPredicates = [isGFX8Plus]; let DecoderNamespace = "VI"; let DisableDecoder = DisableVIDecoder; } Index: llvm/trunk/lib/Target/AMDGPU/SIInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/SIInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/SIInstructions.td @@ -1658,8 +1658,8 @@ def : FPMed3Pat; -let OtherPredicates = [isGFX9] in { +let OtherPredicates = [isGFX9Plus] in { def : FP16Med3Pat; defm : Int16Med3Pat; defm : Int16Med3Pat; -} // End Predicates = [isGFX9] +} // End Predicates = [isGFX9Plus] Index: llvm/trunk/lib/Target/AMDGPU/SMInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/SMInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/SMInstructions.td @@ -284,18 +284,18 @@ def S_MEMTIME : SM_Time_Pseudo <"s_memtime", int_amdgcn_s_memtime>; def S_DCACHE_INV : SM_Inval_Pseudo <"s_dcache_inv", int_amdgcn_s_dcache_inv>; -let SubtargetPredicate = isCIVI in { +let SubtargetPredicate = isGFX7Plus in { def S_DCACHE_INV_VOL : SM_Inval_Pseudo <"s_dcache_inv_vol", int_amdgcn_s_dcache_inv_vol>; -} // let SubtargetPredicate = isCIVI +} // let SubtargetPredicate = isGFX7Plus -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def S_DCACHE_WB : SM_Inval_Pseudo <"s_dcache_wb", int_amdgcn_s_dcache_wb>; def S_DCACHE_WB_VOL : SM_Inval_Pseudo <"s_dcache_wb_vol", int_amdgcn_s_dcache_wb_vol>; def S_MEMREALTIME : SM_Time_Pseudo <"s_memrealtime", int_amdgcn_s_memrealtime>; defm S_ATC_PROBE : SM_Pseudo_Probe <"s_atc_probe", SReg_64>; defm S_ATC_PROBE_BUFFER : SM_Pseudo_Probe <"s_atc_probe_buffer", SReg_128>; -} // SubtargetPredicate = isVI +} // SubtargetPredicate = isGFX8Plus let SubtargetPredicate = HasFlatScratchInsts, Uses = [FLAT_SCR] in { defm S_SCRATCH_LOAD_DWORD : SM_Pseudo_Loads <"s_scratch_load_dword", SReg_64, SReg_32_XM0_XEXEC>; @@ -367,7 +367,7 @@ } // let SubtargetPredicate = HasScalarAtomics -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { defm S_DCACHE_DISCARD : SM_Pseudo_Discards <"s_dcache_discard">; defm S_DCACHE_DISCARD_X2 : SM_Pseudo_Discards <"s_dcache_discard_x2">; } @@ -385,7 +385,7 @@ , SIMCInstr , Enc32 { - let AssemblerPredicates = [isSICI]; + let AssemblerPredicates = [isGFX6GFX7]; let DecoderNamespace = "SICI"; let Inst{7-0} = !if(ps.has_offset, offset{7-0}, ?); @@ -439,7 +439,7 @@ , Enc64 { bit glc; - let AssemblerPredicates = [isVI]; + let AssemblerPredicates = [isGFX8Plus]; let DecoderNamespace = "VI"; let Inst{5-0} = !if(ps.has_sbase, sbase{6-1}, ?); @@ -628,7 +628,7 @@ SM_Real, Enc64 { - let AssemblerPredicates = [isCIOnly]; + let AssemblerPredicates = [isGFX7]; let DecoderNamespace = "CI"; let InOperandList = (ins ps.BaseClass:$sbase, smrd_literal_offset:$offset, GLC:$glc); @@ -665,7 +665,7 @@ , SIMCInstr , Enc32 { - let AssemblerPredicates = [isCIOnly]; + let AssemblerPredicates = [isGFX7]; let DecoderNamespace = "CI"; let Inst{7-0} = !if(ps.has_offset, offset{7-0}, ?); @@ -717,7 +717,7 @@ def : GCNPat < (smrd_load (SMRDImm32 i64:$sbase, i32:$offset)), (vt (!cast(Instr#"_IMM_ci") $sbase, $offset, 0))> { - let OtherPredicates = [isCIOnly]; + let OtherPredicates = [isGFX7]; } // 3. SGPR offset @@ -744,7 +744,7 @@ def : GCNPat < (vt (SIsbuffer_load v4i32:$sbase, (SMRDBufferImm32 i32:$offset), i1:$glc)), (!cast(Instr#"_IMM_ci") $sbase, $offset, (as_i1imm $glc))> { - let OtherPredicates = [isCIOnly]; + let OtherPredicates = [isGFX7]; } // 3. Offset loaded in an 32bit SGPR @@ -778,18 +778,18 @@ defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX16", v16f32>; } // End let AddedComplexity = 100 -let OtherPredicates = [isSICI] in { +let OtherPredicates = [isGFX6GFX7] in { def : GCNPat < (i64 (readcyclecounter)), (S_MEMTIME) >; } -let OtherPredicates = [isVI] in { +let OtherPredicates = [isGFX8Plus] in { def : GCNPat < (i64 (readcyclecounter)), (S_MEMREALTIME) >; -} // let OtherPredicates = [isVI] +} // let OtherPredicates = [isGFX8Plus] Index: llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/SOPInstructions.td @@ -253,7 +253,7 @@ } } -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { let hasSideEffects = 1, Defs = [EXEC, SCC], Uses = [EXEC] in { def S_ANDN1_SAVEEXEC_B64 : SOP1_64<"s_andn1_saveexec_b64">; def S_ORN1_SAVEEXEC_B64 : SOP1_64<"s_orn1_saveexec_b64">; @@ -262,7 +262,7 @@ } // End hasSideEffects = 1, Defs = [EXEC, SCC], Uses = [EXEC] def S_BITREPLICATE_B64_B32 : SOP1_64_32<"s_bitreplicate_b64_b32">; -} // End SubtargetPredicate = isGFX9 +} // End SubtargetPredicate = isGFX9Plus //===----------------------------------------------------------------------===// // SOP2 Instructions @@ -518,7 +518,7 @@ def S_ABSDIFF_I32 : SOP2_32 <"s_absdiff_i32">; } // End Defs = [SCC] -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def S_RFE_RESTORE_B64 : SOP2_Pseudo < "s_rfe_restore_b64", (outs), (ins SSrc_b64:$src0, SSrc_b32:$src1), @@ -529,7 +529,7 @@ } } -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { def S_PACK_LL_B32_B16 : SOP2_32<"s_pack_ll_b32_b16">; def S_PACK_LH_B32_B16 : SOP2_32<"s_pack_lh_b32_b16">; def S_PACK_HH_B32_B16 : SOP2_32<"s_pack_hh_b32_b16">; @@ -719,7 +719,7 @@ } // End hasSideEffects = 1 -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { def S_CALL_B64 : SOPK_Pseudo< "s_call_b64", (outs SReg_64:$sdst), @@ -811,7 +811,7 @@ def S_BITCMP1_B64 : SOPC_64_32 <0x0f, "s_bitcmp1_b64">; def S_SETVSKIP : SOPC_32 <0x10, "s_setvskip">; -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def S_CMP_EQ_U64 : SOPC_CMP_64 <0x12, "s_cmp_eq_u64", COND_EQ>; def S_CMP_LG_U64 : SOPC_CMP_64 <0x13, "s_cmp_lg_u64", COND_NE>; } @@ -866,7 +866,7 @@ let isReturn = 1; } -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def S_ENDPGM_SAVED : SOPP <0x0000001B, (ins), "s_endpgm_saved"> { let simm16 = 0; let isBarrier = 1; @@ -874,12 +874,12 @@ } } -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { let isBarrier = 1, isReturn = 1, simm16 = 0 in { def S_ENDPGM_ORDERED_PS_DONE : SOPP<0x01e, (ins), "s_endpgm_ordered_ps_done">; } // End isBarrier = 1, isReturn = 1, simm16 = 0 -} // End SubtargetPredicate = isGFX9 +} // End SubtargetPredicate = isGFX9Plus let isBranch = 1, SchedRW = [WriteBranch] in { def S_BRANCH : SOPP < @@ -954,7 +954,7 @@ let isConvergent = 1; } -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def S_WAKEUP : SOPP <0x00000003, (ins), "s_wakeup"> { let simm16 = 0; let mayLoad = 1; @@ -1111,7 +1111,7 @@ class Select_si : SIMCInstr { - list AssemblerPredicates = [isSICI]; + list AssemblerPredicates = [isGFX6GFX7]; string DecoderNamespace = "SICI"; } @@ -1248,7 +1248,7 @@ class Select_vi : SIMCInstr { - list AssemblerPredicates = [isVI]; + list AssemblerPredicates = [isGFX8Plus]; string DecoderNamespace = "VI"; } Index: llvm/trunk/lib/Target/AMDGPU/VOP1Instructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP1Instructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP1Instructions.td @@ -303,7 +303,7 @@ defm V_MOV_FED_B32 : VOP1Inst <"v_mov_fed_b32", VOP_I32_I32>; // These instruction only exist on SI and CI -let SubtargetPredicate = isSICI in { +let SubtargetPredicate = isGFX6GFX7 in { let SchedRW = [WriteQuarterRate32] in { defm V_LOG_CLAMP_F32 : VOP1Inst <"v_log_clamp_f32", VOP_F32_F32, int_amdgcn_log_clamp>; @@ -318,10 +318,10 @@ defm V_RSQ_CLAMP_F64 : VOP1Inst <"v_rsq_clamp_f64", VOP_F64_F64, AMDGPUrsq_clamp>; } // End SchedRW = [WriteDouble] -} // End SubtargetPredicate = isSICI +} // End SubtargetPredicate = isGFX6GFX7 -let SubtargetPredicate = isCIVI in { +let SubtargetPredicate = isGFX7Plus in { let SchedRW = [WriteDoubleAdd] in { defm V_TRUNC_F64 : VOP1Inst <"v_trunc_f64", VOP_F64_F64, ftrunc>; @@ -335,7 +335,7 @@ defm V_EXP_LEGACY_F32 : VOP1Inst <"v_exp_legacy_f32", VOP_F32_F32>; } // End SchedRW = [WriteQuarterRate32] -} // End SubtargetPredicate = isCIVI +} // End SubtargetPredicate = isGFX7Plus let SubtargetPredicate = Has16BitInsts in { @@ -390,7 +390,7 @@ let Ins64 = (ins); } -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { let Constraints = "$vdst = $src1, $vdst1 = $src0", DisableEncoding="$vdst1,$src1", SchedRW = [Write64Bit, Write64Bit] in { @@ -404,7 +404,7 @@ defm V_CVT_NORM_I16_F16 : VOP1Inst<"v_cvt_norm_i16_f16", VOP_I16_F16>; defm V_CVT_NORM_U16_F16 : VOP1Inst<"v_cvt_norm_u16_f16", VOP_I16_F16>; -} // End SubtargetPredicate = isGFX9 +} // End SubtargetPredicate = isGFX9Plus //===----------------------------------------------------------------------===// // Target @@ -415,7 +415,7 @@ //===----------------------------------------------------------------------===// multiclass VOP1_Real_si op> { - let AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" in { + let AssemblerPredicates = [isGFX6GFX7], DecoderNamespace = "SICI" in { def _e32_si : VOP1_Real(NAME#"_e32"), SIEncodingFamily.SI>, VOP1e(NAME#"_e32").Pfl>; @@ -490,7 +490,7 @@ //===----------------------------------------------------------------------===// multiclass VOP1_Real_ci op> { - let AssemblerPredicates = [isCIOnly], DecoderNamespace = "CI" in { + let AssemblerPredicates = [isGFX7], DecoderNamespace = "CI" in { def _e32_ci : VOP1_Real(NAME#"_e32"), SIEncodingFamily.SI>, VOP1e(NAME#"_e32").Pfl>; @@ -521,7 +521,7 @@ } multiclass VOP1Only_Real_vi op> { - let AssemblerPredicates = [isVI], DecoderNamespace = "VI" in { + let AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" in { def _vi : VOP1_Real(NAME), SIEncodingFamily.VI>, VOP1e(NAME).Pfl>; @@ -529,7 +529,7 @@ } multiclass VOP1_Real_e32e64_vi op> { - let AssemblerPredicates = [isVI], DecoderNamespace = "VI" in { + let AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" in { def _e32_vi : VOP1_Real(NAME#"_e32"), SIEncodingFamily.VI>, VOP1e(NAME#"_e32").Pfl>; @@ -646,7 +646,7 @@ PseudoInstExpansion<(V_MOV_B32_e32_vi getVALUDstForVT.ret:$vdst, getVOPSrc0ForVT.ret:$src0)> { let VOP1 = 1; - let SubtargetPredicate = isVI; + let SubtargetPredicate = isGFX8Plus; } // This is a pseudo variant of the v_movreld_b32 instruction in which the @@ -669,7 +669,7 @@ def V_MOVRELD_B32_V8 : V_MOVRELD_B32_pseudo; def V_MOVRELD_B32_V16 : V_MOVRELD_B32_pseudo; -let OtherPredicates = [isVI] in { +let OtherPredicates = [isGFX8Plus] in { def : GCNPat < (i32 (int_amdgcn_mov_dpp i32:$src, imm:$dpp_ctrl, imm:$row_mask, imm:$bank_mask, @@ -709,14 +709,14 @@ (EXTRACT_SUBREG $src, sub0) >; -} // End OtherPredicates = [isVI] +} // End OtherPredicates = [isGFX8Plus] //===----------------------------------------------------------------------===// // GFX9 //===----------------------------------------------------------------------===// multiclass VOP1_Real_gfx9 op> { - let AssemblerPredicates = [isGFX9], DecoderNamespace = "GFX9" in { + let AssemblerPredicates = [isGFX9Plus], DecoderNamespace = "GFX9" in { defm NAME : VOP1_Real_e32e64_vi ; } Index: llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td @@ -480,7 +480,7 @@ >; // These instructions only exist on SI and CI -let SubtargetPredicate = isSICI, Predicates = [isSICI] in { +let SubtargetPredicate = isGFX6GFX7, Predicates = [isGFX6GFX7] in { defm V_MIN_LEGACY_F32 : VOP2Inst <"v_min_legacy_f32", VOP_F32_F32_F32, AMDGPUfmin_legacy>; defm V_MAX_LEGACY_F32 : VOP2Inst <"v_max_legacy_f32", VOP_F32_F32_F32, AMDGPUfmax_legacy>; @@ -492,7 +492,7 @@ defm V_LSHL_B32 : VOP2Inst <"v_lshl_b32", VOP_PAT_GEN, shl>; } // End isCommutable = 1 -} // End let SubtargetPredicate = SICI, Predicates = [isSICI] +} // End let SubtargetPredicate = SICI, Predicates = [isGFX6GFX7] class DivergentBinOp : GCNPat< @@ -698,7 +698,7 @@ // SI //===----------------------------------------------------------------------===// -let AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" in { +let AssemblerPredicates = [isGFX6GFX7], DecoderNamespace = "SICI" in { multiclass VOP2_Real_si op> { def _si : @@ -729,7 +729,7 @@ VOP3be_si <{1, 0, 0, op{5-0}}, !cast(NAME#"_e64").Pfl>; } -} // End AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" +} // End AssemblerPredicates = [isGFX6GFX7], DecoderNamespace = "SICI" defm V_CNDMASK_B32 : VOP2_Real_e32e64_si <0x0>; defm V_ADD_F32 : VOP2_Real_e32e64_si <0x3>; @@ -804,7 +804,7 @@ let Inst{31} = 0x0; //encoding } -let AssemblerPredicates = [isVI], DecoderNamespace = "VI" in { +let AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" in { multiclass VOP2_Real_MADK_vi op> { def _vi : VOP2_Real(NAME), SIEncodingFamily.VI>, @@ -838,7 +838,7 @@ VOP2_Real_e32_vi, VOP2_Real_e64_vi<{0, 1, 0, 0, op{5-0}}>; -} // End AssemblerPredicates = [isVI], DecoderNamespace = "VI" +} // End AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" multiclass VOP2_SDWA_Real op> { def _sdwa_vi : @@ -852,7 +852,7 @@ VOP2_SDWA9Ae (NAME#"_sdwa").Pfl>; } -let AssemblerPredicates = [isVIOnly] in { +let AssemblerPredicates = [isGFX8] in { multiclass VOP2be_Real_e32e64_vi_only op, string OpName, string AsmName> { def _e32_vi : @@ -885,7 +885,7 @@ } } -let AssemblerPredicates = [isGFX9] in { +let AssemblerPredicates = [isGFX9Plus] in { multiclass VOP2be_Real_e32e64_gfx9 op, string OpName, string AsmName> { def _e32_gfx9 : @@ -941,7 +941,7 @@ } } -} // AssemblerPredicates = [isGFX9] +} // AssemblerPredicates = [isGFX9Plus] multiclass VOP2_Real_e32e64_vi op> : Base_VOP2_Real_e32e64_vi, VOP2_SDWA_Real, VOP2_SDWA9_Real { @@ -1030,7 +1030,7 @@ defm V_MIN_I16 : VOP2_Real_e32e64_vi <0x32>; defm V_LDEXP_F16 : VOP2_Real_e32e64_vi <0x33>; -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { // Aliases to simplify matching of floating-point instructions that // are VOP2 on SI and VOP3 on VI. @@ -1050,7 +1050,7 @@ def : SI2_VI3Alias <"v_cvt_pknorm_u16_f32", V_CVT_PKNORM_U16_F32_e64_vi>; def : SI2_VI3Alias <"v_cvt_pkrtz_f16_f32", V_CVT_PKRTZ_F16_F32_e64_vi>; -} // End SubtargetPredicate = isVI +} // End SubtargetPredicate = isGFX8Plus let SubtargetPredicate = HasDLInsts in { Index: llvm/trunk/lib/Target/AMDGPU/VOP3Instructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOP3Instructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOP3Instructions.td @@ -386,21 +386,21 @@ let SchedRW = [Write64Bit] in { // These instructions only exist on SI and CI -let SubtargetPredicate = isSICI, Predicates = [isSICI] in { +let SubtargetPredicate = isGFX6GFX7, Predicates = [isGFX6GFX7] in { def V_LSHL_B64 : VOP3Inst <"v_lshl_b64", VOP3_Profile>, shl>; def V_LSHR_B64 : VOP3Inst <"v_lshr_b64", VOP3_Profile>, srl>; def V_ASHR_I64 : VOP3Inst <"v_ashr_i64", VOP3_Profile>, sra>; def V_MULLIT_F32 : VOP3Inst <"v_mullit_f32", VOP3_Profile>; -} // End SubtargetPredicate = isSICI, Predicates = [isSICI] +} // End SubtargetPredicate = isGFX6GFX7, Predicates = [isGFX6GFX7] -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def V_LSHLREV_B64 : VOP3Inst <"v_lshlrev_b64", VOP3_Profile>; def V_LSHRREV_B64 : VOP3Inst <"v_lshrrev_b64", VOP3_Profile>; def V_ASHRREV_I64 : VOP3Inst <"v_ashrrev_i64", VOP3_Profile>; -} // End SubtargetPredicate = isVI +} // End SubtargetPredicate = isGFX8Plus } // End SchedRW = [Write64Bit] -let Predicates = [isVI] in { +let Predicates = [isGFX8Plus] in { def : GCNPat < (getDivergentFrag.ret i64:$x, i32:$y), (V_LSHLREV_B64 $y, $x) @@ -416,7 +416,7 @@ } -let SubtargetPredicate = isCIVI in { +let SubtargetPredicate = isGFX7Plus in { let Constraints = "@earlyclobber $vdst", SchedRW = [WriteQuarterRate32] in { def V_QSAD_PK_U16_U8 : VOP3Inst <"v_qsad_pk_u16_u8", VOP3_Profile>; @@ -430,27 +430,27 @@ } // End SchedRW = [WriteDouble, WriteSALU] } // End isCommutable = 1 -} // End SubtargetPredicate = isCIVI +} // End SubtargetPredicate = isGFX7Plus def V_DIV_FIXUP_F16 : VOP3Inst <"v_div_fixup_f16", VOP3_Profile, AMDGPUdiv_fixup> { - let Predicates = [Has16BitInsts, isVIOnly]; + let Predicates = [Has16BitInsts, isGFX8]; let FPDPRounding = 1; } def V_DIV_FIXUP_F16_gfx9 : VOP3Inst <"v_div_fixup_f16_gfx9", VOP3_Profile, AMDGPUdiv_fixup> { let renamedInGFX9 = 1; - let Predicates = [Has16BitInsts, isGFX9]; + let Predicates = [Has16BitInsts, isGFX9Plus]; let FPDPRounding = 1; } def V_FMA_F16 : VOP3Inst <"v_fma_f16", VOP3_Profile, fma> { - let Predicates = [Has16BitInsts, isVIOnly]; + let Predicates = [Has16BitInsts, isGFX8]; let FPDPRounding = 1; } def V_FMA_F16_gfx9 : VOP3Inst <"v_fma_f16_gfx9", VOP3_Profile, fma> { let renamedInGFX9 = 1; - let Predicates = [Has16BitInsts, isGFX9]; + let Predicates = [Has16BitInsts, isGFX9Plus]; let FPDPRounding = 1; } @@ -474,14 +474,14 @@ } // End FPDPRounding = 1 } // End renamedInGFX9 = 1 -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { def V_MAD_F16_gfx9 : VOP3Inst <"v_mad_f16_gfx9", VOP3_Profile> { let FPDPRounding = 1; } def V_MAD_U16_gfx9 : VOP3Inst <"v_mad_u16_gfx9", VOP3_Profile>; def V_MAD_I16_gfx9 : VOP3Inst <"v_mad_i16_gfx9", VOP3_Profile>; def V_INTERP_P2_F16_gfx9 : VOP3Interp <"v_interp_p2_f16_gfx9", VOP3_INTERP16<[f16, f32, i32, f32]>>; -} // End SubtargetPredicate = isGFX9 +} // End SubtargetPredicate = isGFX9Plus let Uses = [M0, EXEC], FPDPRounding = 1 in { def V_INTERP_P1LL_F16 : VOP3Interp <"v_interp_p1ll_f16", VOP3_INTERP16<[f32, f32, i32, untyped]>, @@ -504,13 +504,13 @@ } // End SubtargetPredicate = Has16BitInsts, isCommutable = 1 -let SubtargetPredicate = isVI in { +let SubtargetPredicate = isGFX8Plus in { def V_INTERP_P1_F32_e64 : VOP3Interp <"v_interp_p1_f32", VOP3_INTERP>; def V_INTERP_P2_F32_e64 : VOP3Interp <"v_interp_p2_f32", VOP3_INTERP>; def V_INTERP_MOV_F32_e64 : VOP3Interp <"v_interp_mov_f32", VOP3_INTERP_MOV>; def V_PERM_B32 : VOP3Inst <"v_perm_b32", VOP3_Profile, AMDGPUperm>; -} // End SubtargetPredicate = isVI +} // End SubtargetPredicate = isGFX8Plus let Predicates = [Has16BitInsts] in { @@ -559,7 +559,7 @@ let PredicateCodeUsesOperands = 1; } -let SubtargetPredicate = isGFX9 in { +let SubtargetPredicate = isGFX9Plus in { def V_PACK_B32_F16 : VOP3Inst <"v_pack_b32_f16", VOP3_Profile>; def V_LSHL_ADD_U32 : VOP3Inst <"v_lshl_add_u32", VOP3_Profile>; def V_ADD_LSHL_U32 : VOP3Inst <"v_add_lshl_u32", VOP3_Profile>; @@ -609,7 +609,7 @@ def : ThreeOp_i32_Pats; def : ThreeOp_i32_Pats; -} // End SubtargetPredicate = isGFX9 +} // End SubtargetPredicate = isGFX9Plus //===----------------------------------------------------------------------===// // Integer Clamp Patterns @@ -659,7 +659,7 @@ // SI //===----------------------------------------------------------------------===// -let AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" in { +let AssemblerPredicates = [isGFX6GFX7], DecoderNamespace = "SICI" in { multiclass VOP3_Real_si op> { def _si : VOP3_Real(NAME), SIEncodingFamily.SI>, @@ -671,7 +671,7 @@ VOP3be_si (NAME).Pfl>; } -} // End AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" +} // End AssemblerPredicates = [isGFX6GFX7], DecoderNamespace = "SICI" defm V_MAD_LEGACY_F32 : VOP3_Real_si <0x140>; defm V_MAD_F32 : VOP3_Real_si <0x141>; @@ -733,7 +733,7 @@ multiclass VOP3_Real_ci op> { def _ci : VOP3_Real(NAME), SIEncodingFamily.SI>, VOP3e_si (NAME).Pfl> { - let AssemblerPredicates = [isCIOnly]; + let AssemblerPredicates = [isGFX7]; let DecoderNamespace = "CI"; } } @@ -741,7 +741,7 @@ multiclass VOP3be_Real_ci op> { def _ci : VOP3_Real(NAME), SIEncodingFamily.SI>, VOP3be_si (NAME).Pfl> { - let AssemblerPredicates = [isCIOnly]; + let AssemblerPredicates = [isGFX7]; let DecoderNamespace = "CI"; } } @@ -755,7 +755,7 @@ // VI //===----------------------------------------------------------------------===// -let AssemblerPredicates = [isVI], DecoderNamespace = "VI" in { +let AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" in { multiclass VOP3_Real_vi op> { def _vi : VOP3_Real(NAME), SIEncodingFamily.VI>, @@ -777,9 +777,9 @@ VOP3Interp_vi (NAME).Pfl>; } -} // End AssemblerPredicates = [isVI], DecoderNamespace = "VI" +} // End AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" -let AssemblerPredicates = [isVIOnly], DecoderNamespace = "VI" in { +let AssemblerPredicates = [isGFX8], DecoderNamespace = "VI" in { multiclass VOP3_F16_Real_vi op> { def _vi : VOP3_Real(NAME), SIEncodingFamily.VI>, @@ -791,9 +791,9 @@ VOP3Interp_vi (NAME).Pfl>; } -} // End AssemblerPredicates = [isVIOnly], DecoderNamespace = "VI" +} // End AssemblerPredicates = [isGFX8], DecoderNamespace = "VI" -let AssemblerPredicates = [isGFX9], DecoderNamespace = "GFX9" in { +let AssemblerPredicates = [isGFX9Plus], DecoderNamespace = "GFX9" in { multiclass VOP3_F16_Real_gfx9 op, string OpName, string AsmName> { def _gfx9 : VOP3_Real(OpName), SIEncodingFamily.GFX9>, @@ -827,7 +827,7 @@ } } -} // End AssemblerPredicates = [isGFX9], DecoderNamespace = "GFX9" +} // End AssemblerPredicates = [isGFX9Plus], DecoderNamespace = "GFX9" defm V_MAD_U64_U32 : VOP3be_Real_vi <0x1E8>; defm V_MAD_I64_I32 : VOP3be_Real_vi <0x1E9>; Index: llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td +++ llvm/trunk/lib/Target/AMDGPU/VOPCInstructions.td @@ -306,7 +306,7 @@ defm V_CMPX_NLT_F64 : VOPCX_F64 <"v_cmpx_nlt_f64">; defm V_CMPX_TRU_F64 : VOPCX_F64 <"v_cmpx_tru_f64">; -let SubtargetPredicate = isSICI in { +let SubtargetPredicate = isGFX6GFX7 in { defm V_CMPS_F_F32 : VOPC_F32 <"v_cmps_f_f32">; defm V_CMPS_LT_F32 : VOPC_F32 <"v_cmps_lt_f32", COND_NULL, "v_cmps_gt_f32">; @@ -376,7 +376,7 @@ defm V_CMPSX_NLT_F64 : VOPCX_F64 <"v_cmpsx_nlt_f64">; defm V_CMPSX_TRU_F64 : VOPCX_F64 <"v_cmpsx_tru_f64">; -} // End SubtargetPredicate = isSICI +} // End SubtargetPredicate = isGFX6GFX7 let SubtargetPredicate = Has16BitInsts in { @@ -702,7 +702,7 @@ //===----------------------------------------------------------------------===// multiclass VOPC_Real_si op> { - let AssemblerPredicates = [isSICI], DecoderNamespace = "SICI" in { + let AssemblerPredicates = [isGFX6GFX7], DecoderNamespace = "SICI" in { def _e32_si : VOPC_Real(NAME#"_e32"), SIEncodingFamily.SI>, VOPCe; @@ -718,7 +718,7 @@ } def : VOPCInstAlias (NAME#"_e64"), !cast(NAME#"_e32_si")> { - let AssemblerPredicate = isSICI; + let AssemblerPredicate = isGFX6GFX7; } } @@ -940,7 +940,7 @@ //===----------------------------------------------------------------------===// multiclass VOPC_Real_vi op> { - let AssemblerPredicates = [isVI], DecoderNamespace = "VI" in { + let AssemblerPredicates = [isGFX8Plus], DecoderNamespace = "VI" in { def _e32_vi : VOPC_Real(NAME#"_e32"), SIEncodingFamily.VI>, VOPCe; @@ -965,7 +965,7 @@ def : VOPCInstAlias (NAME#"_e64"), !cast(NAME#"_e32_vi")> { - let AssemblerPredicate = isVI; + let AssemblerPredicate = isGFX8Plus; } }