Skip to content

Commit c167de6

Browse files
anikaushikigcbot
authored andcommitted
Minor refactoring of functions for better readability
Minor refactoring of functions for better readability
1 parent 4aef434 commit c167de6

File tree

4 files changed

+98
-30
lines changed

4 files changed

+98
-30
lines changed

visa/BuildCISAIR.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ class CISA_IR_Builder : public VISABuilder
599599
unsigned int numParameters,
600600
VISA_RawOpnd** params,
601601
int lineNum);
602+
602603
bool create3DSampleInstruction(
603604
VISA_opnd* pred,
604605
VISASampler3DSubOpCode subOpcode,

visa/BuildCISAIRImpl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3678,7 +3678,6 @@ bool CISA_IR_Builder::createSample4Instruction(
36783678
}
36793679

36803680

3681-
36823681
bool CISA_IR_Builder::create3DLoadInstruction(
36833682
VISA_opnd* pred,
36843683
VISASampler3DSubOpCode subOpcode,
@@ -3705,7 +3704,6 @@ bool CISA_IR_Builder::create3DLoadInstruction(
37053704
VISA_RESULT_CALL_TO_BOOL(status);
37063705
return true;
37073706
}
3708-
37093707
bool CISA_IR_Builder::create3DSampleInstruction(
37103708
VISA_opnd* pred,
37113709
VISASampler3DSubOpCode subOpcode,
@@ -3743,7 +3741,6 @@ bool CISA_IR_Builder::create3DSampleInstruction(
37433741
VISA_RESULT_CALL_TO_BOOL(status);
37443742
return true;
37453743
}
3746-
37473744
bool CISA_IR_Builder::CISA_create_sample_instruction(
37483745
ISA_Opcode opcode,
37493746
ChannelMask channel,

visa/BuildIRImpl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,6 @@ G4_InstSend* IR_Builder::createInternalSendInst(
20702070
//
20712071

20722072

2073-
20742073
G4_InstSend* IR_Builder::createSplitSendInst(
20752074
G4_Predicate* prd,
20762075
G4_opcode op,

visa/VISAKernel.h

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -778,30 +778,65 @@ class VISAKernelImpl : public VISAFunction
778778
int numMsgSpecificOpnds,
779779
VISA_RawOpnd ** opndArray) override;
780780

781-
VISA_BUILDER_API int AppendVISA3dInfo(VISASampler3DSubOpCode subOpcode, VISA_EMask_Ctrl emask, VISA_Exec_Size executionSize, VISAChannelMask srcChannel, VISA_StateOpndHandle *surface, VISA_RawOpnd *lod, VISA_RawOpnd *dst) override;
781+
VISA_BUILDER_API int AppendVISA3dInfo(
782+
VISASampler3DSubOpCode subOpcode,
783+
VISA_EMask_Ctrl emask,
784+
VISA_Exec_Size executionSize,
785+
VISAChannelMask srcChannel,
786+
VISA_StateOpndHandle *surface,
787+
VISA_RawOpnd *lod,
788+
VISA_RawOpnd *dst) override;
782789

783790
VISA_BUILDER_API int AppendVISA3dRTWrite(
784-
VISA_PredOpnd *pred, VISA_EMask_Ctrl emask, VISA_Exec_Size executionSize, VISA_VectorOpnd* renderTargetIndex, vISA_RT_CONTROLS cntrls,
785-
VISA_StateOpndHandle *surface, VISA_RawOpnd *r1HeaderOpnd, VISA_VectorOpnd *sampleIndex,
786-
uint8_t numMsgSpecificOpnds, VISA_RawOpnd **opndArray) override;
791+
VISA_PredOpnd *pred,
792+
VISA_EMask_Ctrl emask,
793+
VISA_Exec_Size executionSize,
794+
VISA_VectorOpnd* renderTargetIndex,
795+
vISA_RT_CONTROLS cntrls,
796+
VISA_StateOpndHandle *surface,
797+
VISA_RawOpnd *r1HeaderOpnd,
798+
VISA_VectorOpnd *sampleIndex,
799+
uint8_t numMsgSpecificOpnds,
800+
VISA_RawOpnd **opndArray) override;
787801

788802
VISA_BUILDER_API int AppendVISA3dRTWriteCPS(
789-
VISA_PredOpnd *pred, VISA_EMask_Ctrl emask, VISA_Exec_Size executionSize, VISA_VectorOpnd* renderTargetIndex, vISA_RT_CONTROLS cntrls,
790-
VISA_StateOpndHandle *surface, VISA_RawOpnd *r1HeaderOpnd, VISA_VectorOpnd *sampleIndex,
791-
VISA_VectorOpnd *cPSCounter, uint8_t numMsgSpecificOpnds, VISA_RawOpnd **opndArray) override;
803+
VISA_PredOpnd *pred,
804+
VISA_EMask_Ctrl emask,
805+
VISA_Exec_Size executionSize,
806+
VISA_VectorOpnd* renderTargetIndex,
807+
vISA_RT_CONTROLS cntrls,
808+
VISA_StateOpndHandle *surface,
809+
VISA_RawOpnd *r1HeaderOpnd,
810+
VISA_VectorOpnd *sampleIndex,
811+
VISA_VectorOpnd *cPSCounter,
812+
uint8_t numMsgSpecificOpnds,
813+
VISA_RawOpnd **opndArray) override;
792814

793815
VISA_BUILDER_API int AppendVISA3dURBWrite(
794-
VISA_PredOpnd *pred, VISA_EMask_Ctrl emask,
795-
VISA_Exec_Size executionSize, unsigned char numberOutputParams,
796-
VISA_RawOpnd *channelMask, unsigned short globalOffset, VISA_RawOpnd *URBHandle,
797-
VISA_RawOpnd *perSLotOffset, VISA_RawOpnd *vertexData) override;
816+
VISA_PredOpnd *pred,
817+
VISA_EMask_Ctrl emask,
818+
VISA_Exec_Size executionSize,
819+
unsigned char numberOutputParams,
820+
VISA_RawOpnd *channelMask,
821+
unsigned short globalOffset,
822+
VISA_RawOpnd *URBHandle,
823+
VISA_RawOpnd *perSLotOffset,
824+
VISA_RawOpnd *vertexData) override;
798825

799826
VISA_BUILDER_API int AppendVISA3dTypedAtomic(
800-
VISAAtomicOps subOp, bool is16Bit, VISA_PredOpnd *pred,
801-
VISA_EMask_Ctrl emask, VISA_Exec_Size executionSize,
802-
VISA_StateOpndHandle *surface, VISA_RawOpnd *u, VISA_RawOpnd *v,
803-
VISA_RawOpnd *r, VISA_RawOpnd *lod, VISA_RawOpnd *src0,
804-
VISA_RawOpnd *src1, VISA_RawOpnd *dst) override;
827+
VISAAtomicOps subOp,
828+
bool is16Bit,
829+
VISA_PredOpnd *pred,
830+
VISA_EMask_Ctrl emask,
831+
VISA_Exec_Size executionSize,
832+
VISA_StateOpndHandle *surface,
833+
VISA_RawOpnd *u,
834+
VISA_RawOpnd *v,
835+
VISA_RawOpnd *r,
836+
VISA_RawOpnd *lod,
837+
VISA_RawOpnd *src0,
838+
VISA_RawOpnd *src1,
839+
VISA_RawOpnd *dst) override;
805840

806841
/********** APPEND 3D Instructions END ******************/
807842

@@ -813,7 +848,8 @@ class VISAKernelImpl : public VISAFunction
813848
VISA_BUILDER_API int GetErrorMessage(const char *&errorMsg) const override;
814849
VISA_BUILDER_API virtual int GetGenxDebugInfo(void *&buffer, unsigned int &size) const override;
815850
/// GetGenRelocEntryBuffer -- allocate and return a buffer of all GenRelocEntry that are created by vISA
816-
VISA_BUILDER_API int GetGenRelocEntryBuffer(void *&buffer, unsigned int &byteSize, unsigned int &numEntries) override;
851+
VISA_BUILDER_API int GetGenRelocEntryBuffer(void *&buffer,
852+
unsigned int &byteSize, unsigned int &numEntries) override;
817853
/// GetRelocations -- add vISA created relocations into given relocation list
818854
/// This get the same information as GetGenRelocEntryBuffer, but in different foramt
819855
VISA_BUILDER_API int GetRelocations(RelocListType &relocs) override;
@@ -872,17 +908,35 @@ class VISAKernelImpl : public VISAFunction
872908

873909
int CreateVISAPredicateDstOperand(VISA_VectorOpnd *& opnd, VISA_PredVar *decl, uint32_t size);
874910

875-
int CreateVISAAddressOperand(VISA_VectorOpnd *&opnd, VISA_AddrVar *decl, unsigned int offset, unsigned int width, bool isDst);
911+
int CreateVISAAddressOperand(
912+
VISA_VectorOpnd *&opnd,
913+
VISA_AddrVar *decl,
914+
unsigned int offset,
915+
unsigned int width,
916+
bool isDst);
876917

877-
int CreateVISAPredicateOperandvISA(VISA_PredOpnd *& opnd, VISA_PredVar *decl, VISA_PREDICATE_STATE state, VISA_PREDICATE_CONTROL cntrl);
918+
int CreateVISAPredicateOperandvISA(
919+
VISA_PredOpnd *& opnd,
920+
VISA_PredVar *decl,
921+
VISA_PREDICATE_STATE state,
922+
VISA_PREDICATE_CONTROL cntrl);
878923

879924
int CreateGenNullRawOperand(VISA_RawOpnd *& opnd, bool isDst);
880925

881926
int CreateGenRawSrcOperand(VISA_RawOpnd *& cisa_opnd);
882927
int CreateGenRawDstOperand(VISA_RawOpnd *& cisa_opnd);
883928

884-
int CreateVISAIndirectGeneralOperand(VISA_VectorOpnd *& opnd, VISA_AddrVar *cisa_decl, VISA_Modifier mod, unsigned int addrOffset, unsigned short immediateOffset,
885-
unsigned short verticalStride, unsigned short width, unsigned short horizontalStride, VISA_Type type, bool isDst);
929+
int CreateVISAIndirectGeneralOperand(
930+
VISA_VectorOpnd *& opnd,
931+
VISA_AddrVar *cisa_decl,
932+
VISA_Modifier mod,
933+
unsigned int addrOffset,
934+
unsigned short immediateOffset,
935+
unsigned short verticalStride,
936+
unsigned short width,
937+
unsigned short horizontalStride,
938+
VISA_Type type,
939+
bool isDst);
886940

887941
int AppendVISA3dSamplerMsgGeneric(ISA_Opcode opcode,
888942
VISASampler3DSubOpCode subOpcode,
@@ -911,15 +965,32 @@ class VISAKernelImpl : public VISAFunction
911965

912966
int AddAttributeToVarGeneric(CISA_GEN_VAR *decl, const char* varName, unsigned int size, const void *val);
913967

914-
int CreateStateVar(CISA_GEN_VAR *&decl, Common_ISA_Var_Class type, const char* name, unsigned int numberElements);
968+
int CreateStateVar(
969+
CISA_GEN_VAR *&decl,
970+
Common_ISA_Var_Class type,
971+
const char* name,
972+
unsigned int numberElements);
915973

916974
int CreateVISAInputVar(CISA_GEN_VAR *decl, uint16_t offset, uint16_t size, uint8_t implicitKind);
917975

918-
int CreateVISAAddressOfOperandGeneric(VISA_VectorOpnd *&cisa_opnd, CISA_GEN_VAR *decl, unsigned int offset);
919-
920-
int CreateVISAStateOperand(VISA_VectorOpnd *& opnd, CISA_GEN_VAR *decl, Common_ISA_State_Opnd_Class opnd_class, uint8_t size, unsigned char offset, bool useAsDst);
976+
int CreateVISAAddressOfOperandGeneric(
977+
VISA_VectorOpnd *&cisa_opnd,
978+
CISA_GEN_VAR *decl,
979+
unsigned int offset);
980+
981+
int CreateVISAStateOperand(
982+
VISA_VectorOpnd *& opnd,
983+
CISA_GEN_VAR *decl,
984+
Common_ISA_State_Opnd_Class opnd_class,
985+
uint8_t size,
986+
unsigned char offset,
987+
bool useAsDst);
988+
989+
void setGenxBinaryBuffer(void *buffer, int size) {
990+
m_genx_binary_buffer = static_cast<char *>(buffer);
991+
m_genx_binary_size = size;
992+
}
921993

922-
void setGenxBinaryBuffer(void *buffer, int size) { m_genx_binary_buffer = static_cast<char *>(buffer); m_genx_binary_size = size; }
923994
void setJitInfo(FINALIZER_INFO* jitInfo) { m_jitInfo = jitInfo; }
924995

925996
std::string getOutputAsmPath() const { return m_asmName; }

0 commit comments

Comments
 (0)