From c43d08310f779c29fd545c723b098054cacbfc5a Mon Sep 17 00:00:00 2001 From: Stanislav Mekhanoshin Date: Thu, 17 Oct 2019 21:46:56 +0000 Subject: [PATCH] [AMDGPU] drop getIsFP td helper We already have isFloatType helper, and they are out of sync. Drop one and merge the type list. Differential Revision: https://reviews.llvm.org/D69138 llvm-svn: 375175 --- lib/Target/AMDGPU/BUFInstructions.td | 4 ++-- lib/Target/AMDGPU/FLATInstructions.td | 6 +++--- lib/Target/AMDGPU/SIInstrInfo.td | 26 ++++++++------------------ 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/lib/Target/AMDGPU/BUFInstructions.td b/lib/Target/AMDGPU/BUFInstructions.td index 9141dca5f10..1b12550aed8 100644 --- a/lib/Target/AMDGPU/BUFInstructions.td +++ b/lib/Target/AMDGPU/BUFInstructions.td @@ -715,7 +715,7 @@ multiclass MUBUF_Pseudo_Atomics_NO_RTN .ret> { + bit isFP = isFloatType.ret> { let FPAtomic = isFP in def _OFFSET : MUBUF_AtomicNoRet_Pseudo , MUBUFAddr64Table <0, NAME>; @@ -739,7 +739,7 @@ multiclass MUBUF_Pseudo_Atomics_RTN .ret> { + bit isFP = isFloatType.ret> { let FPAtomic = isFP in def _OFFSET_RTN : MUBUF_AtomicRet_Pseudo .ret> { + bit isFP = isFloatType.ret> { def "" : FLAT_AtomicNoRet_Pseudo .ret> { + bit isFP = isFloatType.ret> { def "" : FLAT_AtomicNoRet_Pseudo .ret> { + bit isFP = isFloatType.ret> { def _RTN : FLAT_AtomicRet_Pseudo { !if(!eq(SrcVT.Value, f64.Value), 1, !if(!eq(SrcVT.Value, v2f16.Value), 1, !if(!eq(SrcVT.Value, v4f16.Value), 1, - 0))))); + !if(!eq(SrcVT.Value, v2f32.Value), 1, + !if(!eq(SrcVT.Value, v2f64.Value), 1, + 0))))))); } class isIntType { @@ -1424,18 +1426,6 @@ class getVALUDstForVT { VOPDstS64orS32)))); // else VT == i1 } -// Returns true if VT is floating point. -class getIsFP { - bit ret = !if(!eq(VT.Value, f16.Value), 1, - !if(!eq(VT.Value, v2f16.Value), 1, - !if(!eq(VT.Value, v4f16.Value), 1, - !if(!eq(VT.Value, f32.Value), 1, - !if(!eq(VT.Value, v2f32.Value), 1, - !if(!eq(VT.Value, f64.Value), 1, - !if(!eq(VT.Value, v2f64.Value), 1, - 0))))))); -} - // Returns the register class to use for the destination of VOP[12C] // instructions with SDWA extension class getSDWADstForVT { @@ -1447,7 +1437,7 @@ class getSDWADstForVT { // Returns the register class to use for source 0 of VOP[12C] // instructions for the given VT. class getVOPSrc0ForVT { - bit isFP = getIsFP.ret; + bit isFP = isFloatType.ret; RegisterOperand ret = !if(isFP, @@ -1487,7 +1477,7 @@ class getVregSrcForVT { } class getSDWASrcForVT { - bit isFP = getIsFP.ret; + bit isFP = isFloatType.ret; RegisterOperand retFlt = !if(!eq(VT.Size, 16), SDWASrc_f16, SDWASrc_f32); RegisterOperand retInt = !if(!eq(VT.Size, 16), SDWASrc_i16, SDWASrc_i32); RegisterOperand ret = !if(isFP, retFlt, retInt); @@ -1496,7 +1486,7 @@ class getSDWASrcForVT { // Returns the register class to use for sources of VOP3 instructions for the // given VT. class getVOP3SrcForVT { - bit isFP = getIsFP.ret; + bit isFP = isFloatType.ret; RegisterOperand ret = !if(!eq(VT.Size, 128), VSrc_128, @@ -1543,7 +1533,7 @@ class isModifierType { // Return type of input modifiers operand for specified input operand class getSrcMod { - bit isFP = getIsFP.ret; + bit isFP = isFloatType.ret; bit isPacked = isPackedType.ret; Operand ret = !if(!eq(VT.Size, 64), !if(isFP, FP64InputMods, Int64InputMods), @@ -1562,7 +1552,7 @@ class getOpSelMod { // Return type of input modifiers operand specified input operand for DPP class getSrcModExt { - bit isFP = getIsFP.ret; + bit isFP = isFloatType.ret; Operand ret = !if(isFP, FPVRegInputMods, IntVRegInputMods); }