Skip to content

Commit 3cfa49c

Browse files
Pravin JagtapPravin Jagtap
authored andcommitted
Merged two search tables of fp4 and fp8
1 parent b34afa8 commit 3cfa49c

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.td

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,22 +3250,13 @@ def isMFMA_F8F6F4Table : GenericTable {
32503250
let PrimaryKeyName = "isMFMA_F8F6F4" ;
32513251
}
32523252

3253-
def FP8DstByteSelTable : GenericTable {
3253+
def FP4FP8DstByteSelTable : GenericTable {
32543254
let FilterClass = "VOP3_Pseudo";
3255-
let CppTypeName = "FP8DstByteSelInfo";
3256-
let Fields = ["Opcode", "HasFP8DstByteSel"];
3255+
let CppTypeName = "FP4FP8DstByteSelInfo";
3256+
let Fields = ["Opcode", "HasFP8DstByteSel", "HasFP4DstByteSel"];
32573257

32583258
let PrimaryKey = ["Opcode"];
3259-
let PrimaryKeyName = "getFP8DstByteSelHelper";
3260-
}
3261-
3262-
def FP4DstByteSelTable : GenericTable {
3263-
let FilterClass = "VOP3_Pseudo";
3264-
let CppTypeName = "FP4DstByteSelInfo";
3265-
let Fields = ["Opcode", "HasFP4DstByteSel"];
3266-
3267-
let PrimaryKey = ["Opcode"];
3268-
let PrimaryKeyName = "getFP4DstByteSelHelper";
3259+
let PrimaryKeyName = "getFP4FP8DstByteSelHelper";
32693260
}
32703261

32713262
def VOPDComponentTable : GenericTable {

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -378,23 +378,17 @@ struct VOPTrue16Info {
378378
bool IsTrue16;
379379
};
380380

381-
#define GET_FP8DstByteSelTable_DECL
382-
#define GET_FP8DstByteSelTable_IMPL
383-
#define GET_FP4DstByteSelTable_DECL
384-
#define GET_FP4DstByteSelTable_IMPL
381+
#define GET_FP4FP8DstByteSelTable_DECL
382+
#define GET_FP4FP8DstByteSelTable_IMPL
385383

386384
struct DPMACCInstructionInfo {
387385
uint16_t Opcode;
388386
bool IsDPMACCInstruction;
389387
};
390388

391-
struct FP8DstByteSelInfo {
389+
struct FP4FP8DstByteSelInfo {
392390
uint16_t Opcode;
393391
bool HasFP8DstByteSel;
394-
};
395-
396-
struct FP4DstByteSelInfo {
397-
uint16_t Opcode;
398392
bool HasFP4DstByteSel;
399393
};
400394

@@ -665,15 +659,13 @@ bool isTrue16Inst(unsigned Opc) {
665659
}
666660

667661
FPType getFPDstSelType(unsigned Opc) {
668-
const FP8DstByteSelInfo *Info8 = getFP8DstByteSelHelper(Opc);
669-
if (Info8 && Info8->HasFP8DstByteSel)
662+
const FP4FP8DstByteSelInfo *Info = getFP4FP8DstByteSelHelper(Opc);
663+
if (Info && Info->HasFP8DstByteSel)
670664
return FPType::FP8;
671-
672-
const FP4DstByteSelInfo *Info4 = getFP4DstByteSelHelper(Opc);
673-
if (Info4 && Info4->HasFP4DstByteSel)
665+
else if (Info && Info->HasFP4DstByteSel)
674666
return FPType::FP4;
675-
676-
return FPType::None;
667+
else
668+
return FPType::None;
677669
}
678670

679671
unsigned mapWMMA2AddrTo3AddrOpcode(unsigned Opc) {

0 commit comments

Comments
 (0)