23 #ifndef __CLRX_ASSEMBLER_H__ 24 #define __CLRX_ASSEMBLER_H__ 37 #include <unordered_set> 38 #include <unordered_map> 54 ASM_POLICY_UNIFIED_SGPR_COUNT = CLRX_POLICY_UNIFIED_SGPR_COUNT
106 std::vector<RegVarUsageInt> items;
109 std::vector<Chunk> chunks;
123 {
return readPos.chunkPos < chunks.size() && (readPos.chunkPos+1 != chunks.size() ||
124 readPos.itemPos < chunks.back().items.size());; }
128 ReadPos findPositionByOffset(
size_t offset)
const;
132 cxbyte* linearDeps)
const = 0;
139 std::vector<AsmRegVarLinearDep> regVarLinDeps;
146 { regVarLinDeps.push_back(linearDep); }
149 {
return regVarLinDeps.size(); }
152 {
return regVarLinDeps[pos]; }
154 size_t findPositionByOffset(
size_t offset)
const;
172 cxbyte* linearDeps)
const;
191 std::vector<AsmDelayedOp> delayedOps;
192 std::vector<AsmWaitInstr> waitInstrs;
199 { delayedOps.push_back(delOp); }
202 { waitInstrs.push_back(waitInstr); }
205 {
return readPos.delOpPos < delayedOps.size() ||
206 readPos.waitInstrPos < waitInstrs.size(); }
210 ReadPos findPositionByOffset(
size_t offset)
const;
222 void printWarning(
const char* linePtr,
const char* message);
224 void printError(
const char* linePtr,
const char* message);
226 void printWarning(
const AsmSourcePos& sourcePos,
const char* message);
228 void printError(
const AsmSourcePos& sourcePos,
const char* message);
231 cxbyte signess = WS_BOTH);
242 virtual void assemble(
const CString& mnemonic,
const char* mnemPlace,
243 const char* linePtr,
const char* lineEnd, std::vector<cxbyte>& output,
250 virtual bool checkMnemonic(
const CString& mnemonic)
const = 0;
251 virtual Flags getImportantCodeFlags()
const = 0;
253 virtual void setAllocatedRegisters(
const cxuint* regs =
nullptr,
254 Flags regFlags = 0) = 0;
255 void setCodeFlags(
Flags codeFlags);
257 virtual const cxuint* getAllocatedRegisters(
size_t& regTypesNum,
258 Flags& regFlags)
const = 0;
259 Flags getCodeFlags()
const;
261 virtual void getMaxRegistersNum(
size_t& regTypesNum,
cxuint* maxRegs)
const = 0;
263 virtual void getRegisterRanges(
size_t& regTypesNum,
cxuint* regRanges)
const = 0;
265 virtual void fillAlignment(
size_t size,
cxbyte* output) = 0;
267 virtual bool parseRegisterRange(
const char*& linePtr,
cxuint& regStart,
272 virtual bool parseRegisterType(
const char*& linePtr,
273 const char* end,
cxuint& type) = 0;
275 virtual size_t getInstructionSize(
size_t codeSize,
const cxbyte* code)
const = 0;
290 friend struct GCNAsmUtils;
302 void resetInstrRVUs()
306 rvu.useRegMode =
false;
307 rvu.regField = ASMFIELD_NONE;
310 void resetWaitInstrs()
312 hasWaitInstr =
false;
314 op.delayedOpType = op.delayedOpType2 = ASMDELOP_NONE;
317 void setCurrentRVU(
cxbyte idx)
318 { currentRVUIndex = idx; }
322 void moveRVUToNext(
cxbyte index);
328 if (rvu.regField != ASMFIELD_NONE)
334 if (op.delayedOpType != ASMDELOP_NONE)
349 void assemble(
const CString& mnemonic,
const char* mnemPlace,
const char* linePtr,
350 const char* lineEnd, std::vector<cxbyte>& output,
355 bool checkMnemonic(
const CString& mnemonic)
const;
356 Flags getImportantCodeFlags()
const;
357 void setAllocatedRegisters(
const cxuint* regs,
Flags regFlags);
358 const cxuint* getAllocatedRegisters(
size_t& regTypesNum,
Flags& regFlags)
const;
359 void getMaxRegistersNum(
size_t& regTypesNum,
cxuint* maxRegs)
const;
360 void getRegisterRanges(
size_t& regTypesNum,
cxuint* regRanges)
const;
361 void fillAlignment(
size_t size,
cxbyte* output);
362 bool parseRegisterRange(
const char*& linePtr,
cxuint& regStart,
cxuint& regEnd,
365 bool parseRegisterType(
const char*& linePtr,
const char* end,
cxuint& type);
366 size_t getInstructionSize(
size_t codeSize,
const cxbyte* code)
const;
388 SSAInfo(
size_t _bssaId = SIZE_MAX,
size_t _ssaIdF = SIZE_MAX,
389 size_t _ssaId = SIZE_MAX,
size_t _ssaIdL = SIZE_MAX,
390 size_t _ssaIdChange = 0,
bool _readBeforeWrite =
false)
391 : ssaIdBefore(_bssaId), ssaIdFirst(_ssaIdF), ssaId(_ssaId),
392 ssaIdLast(_ssaIdL), ssaIdChange(_ssaIdChange),
393 readBeforeWrite(_readBeforeWrite)
416 typedef std::pair<size_t, size_t> SSAReplace;
417 typedef std::unordered_map<AsmSingleVReg, VectorSet<SSAReplace> > SSAReplacesMap;
420 typedef std::unordered_map<AsmSingleVReg, std::vector<size_t> > VarIndexMap;
434 std::vector<CodeBlock> codeBlocks;
435 SSAReplacesMap ssaReplacesMap;
439 size_t graphVregsCounts[MAX_REGTYPES_NUM];
440 VarIndexMap vregIndexMaps[MAX_REGTYPES_NUM];
441 InterGraph interGraphs[MAX_REGTYPES_NUM];
443 std::unordered_map<size_t, LinearDep> linearDepMaps[MAX_REGTYPES_NUM];
445 std::unordered_map<size_t, VIdxSetEntry> vidxRoutineMap;
447 std::unordered_map<size_t, VIdxSetEntry> vidxCallMap;
453 const SSAReplacesMap& ssaReplacesMap);
455 void createCodeStructure(
const std::vector<AsmCodeFlowEntry>& codeFlow,
456 size_t codeSize,
const cxbyte* code);
459 void applySSAReplaces();
462 void createInterferenceGraph();
463 void colorInterferenceGraph();
467 const std::vector<CodeBlock>& getCodeBlocks()
const 468 {
return codeBlocks; }
469 const SSAReplacesMap& getSSAReplacesMap()
const 470 {
return ssaReplacesMap; }
472 {
return outLivenesses; }
474 const std::unordered_map<size_t, LinearDep>* getLinearDepMaps()
const 475 {
return linearDepMaps; }
477 const VarIndexMap* getVregIndexMaps()
const 478 {
return vregIndexMaps; }
480 const std::unordered_map<size_t, VIdxSetEntry>& getVIdxRoutineMap()
const 481 {
return vidxRoutineMap; }
482 const std::unordered_map<size_t, VIdxSetEntry>& getVIdxCallMap()
const 483 {
return vidxCallMap; }
492 const std::vector<AsmRegAllocator::CodeBlock>& codeBlocks;
493 const AsmRegAllocator::VarIndexMap* vregIndexMaps;
496 std::vector<AsmWaitInstr> neededWaitInstrs;
499 const std::vector<AsmRegAllocator::CodeBlock>& codeBlocks,
500 const AsmRegAllocator::VarIndexMap* vregIndexMaps,
505 const std::vector<AsmWaitInstr>& getNeededWaitInstrs()
const 506 {
return neededWaitInstrs; }
533 typedef std::pair<CString, uint64_t>
DefSym;
535 typedef std::unordered_map<CString, AsmKernelId>
KernelMap;
552 friend struct AsmParseUtils;
553 friend struct AsmPseudoOps;
554 friend struct AsmKcodePseudoOps;
555 friend struct AsmGalliumPseudoOps;
556 friend struct AsmAmdPseudoOps;
557 friend struct AsmAmdCL2PseudoOps;
558 friend struct AsmROCmPseudoOps;
559 friend struct GCNAsmUtils;
564 uint32_t driverVersion;
565 uint32_t llvmVersion;
567 bool newROCmBinFormat;
568 bool llvm10BinFormat;
571 bool resolvingRelocs;
572 bool doNotRemoveFromSymbolClones;
575 std::vector<DefSym> defSyms;
576 std::vector<CString> includeDirs;
577 std::vector<AsmSection> sections;
578 std::vector<Array<AsmSectionId> > relSpacesSections;
579 std::unordered_set<AsmSymbolEntry*> symbolSnapshots;
580 std::unordered_set<AsmSymbolEntry*> symbolClones;
581 std::vector<AsmExpression*> unevalExpressions;
582 std::vector<AsmRelocation> relocations;
583 std::unordered_map<const AsmRegVar*, AsmRegVarLinears> regVarLinearsMap;
586 std::stack<AsmScope*> scopeStack;
587 std::vector<AsmScope*> abandonedScopes;
590 std::vector<AsmKernel> kernels;
603 bool lineAlreadyRead;
608 bool sectionDiffsPrepared;
609 bool collectSourcePoses;
612 std::stack<AsmInputFilter*> asmInputFilters;
615 std::ostream& messageStream;
616 std::ostream& printStream;
620 std::stack<AsmClause> clauses;
624 uint64_t& currentOutPos;
626 bool withSectionDiffs()
const 638 {
return getSourcePos(linePtr-line); }
640 void printWarning(
const AsmSourcePos& pos,
const char* message);
641 void printError(
const AsmSourcePos& pos,
const char* message);
643 void printWarning(
const char* linePtr,
const char* message)
644 { printWarning(getSourcePos(linePtr), message); }
645 void printError(
const char* linePtr,
const char* message)
646 { printError(getSourcePos(linePtr), message); }
648 void printWarning(
LineCol lineCol,
const char* message)
649 { printWarning(getSourcePos(lineCol), message); }
650 void printError(
LineCol lineCol,
const char* message)
651 { printError(getSourcePos(lineCol), message); }
653 LineCol translatePos(
const char* linePtr)
const 654 {
return currentInputFilter->
translatePos(linePtr-line); }
655 LineCol translatePos(
size_t pos)
const 658 bool parseLiteral(uint64_t& value,
const char*& linePtr);
659 bool parseLiteralNoError(uint64_t& value,
const char*& linePtr);
660 bool parseString(std::string& outString,
const char*& linePtr);
662 enum class ParseState
672 ParseState parseSymbol(
const char*& linePtr,
AsmSymbolEntry*& entry,
673 bool localLabel =
true,
bool dontCreateSymbol =
false);
674 bool skipSymbol(
const char*& linePtr);
678 bool assignSymbol(
const CString& symbolName,
const char* symbolPlace,
679 const char* linePtr,
bool reassign =
true,
bool baseExpr =
false);
681 bool assignOutputCounter(
const char* symbolPlace, uint64_t value,
684 void parsePseudoOps(
const CString& firstName,
const char* stmtPlace,
685 const char* linePtr);
688 bool skipClauses(
bool exitm =
false);
690 bool putRepetitionContent(
AsmRepeat& repeat);
692 void initializeOutputFormat();
694 bool pushClause(
const char*
string,
AsmClauseType clauseType)
697 return pushClause(
string, clauseType,
true, included);
699 bool pushClause(
const char*
string,
AsmClauseType clauseType,
700 bool satisfied,
bool& included);
702 bool popClause(
const char*
string,
AsmClauseType clauseType);
706 std::unordered_set<AsmScope*>& scopeSet);
708 AsmScope* getRecurScope(
const CString& scopePlace,
bool ignoreLast =
false,
709 const char** lastStep =
nullptr);
713 std::unordered_set<AsmScope*>& scopeSet);
716 CString& sameSymName,
bool insertMode =
false);
718 std::pair<AsmSymbolEntry*, bool> insertSymbolInScope(
const CString& symName,
723 std::unordered_set<AsmScope*>& scopeSet);
726 CString& sameRvName,
bool insertMode =
false);
728 std::pair<AsmRegVarEntry*, bool> insertRegVarInScope(
const CString& rvName,
734 bool pushScope(
const CString& scopeName);
738 bool includeFile(
const char* pseudoOpPlace,
const std::string& filename);
740 ParseState makeMacroSubstitution(
const char*
string);
742 bool parseMacroArgValue(
const char*& linePtr, std::string& outStr);
744 void putData(
size_t size,
const cxbyte* data)
746 AsmSection& section = sections[currentSection];
748 currentOutPos += size;
753 void goToMain(
const char* pseudoOpPlace);
754 void goToKernel(
const char* pseudoOpPlace,
const char* kernelName);
755 void goToSection(
const char* pseudoOpPlace,
const char* sectionName, uint64_t align=0);
756 void goToSection(
const char* pseudoOpPlace,
const char* sectionName,
758 void goToSection(
const char* pseudoOpPlace,
AsmSectionId sectionId, uint64_t align=0);
761 cxbyte signess = WS_BOTH);
763 bool isAddressableSection()
const 766 (sections[currentSection].flags & ASMSECT_ADDRESSABLE) != 0;
768 bool isWriteableSection()
const 771 (sections[currentSection].flags & ASMSECT_WRITEABLE) != 0;
773 bool isResolvableSection()
const 785 void handleRegionsOnKernels(
const std::vector<AsmKernelId>& newKernels,
786 const std::vector<AsmKernelId>& oldKernels,
AsmSectionId codeSection);
789 void tryToResolveSymbols(
AsmScope* scope);
790 void printUnresolvedSymbols(
AsmScope* scope);
792 bool resolveExprTarget(
const AsmExpression* expr, uint64_t value,
816 std::ostream& msgStream = std::cerr, std::ostream& printStream = std::cout);
830 std::ostream& msgStream = std::cerr, std::ostream& printStream = std::cout);
838 void writeBinary(
const char* filename)
const;
840 void writeBinary(std::ostream& outStream)
const;
846 {
return driverVersion; }
849 { this->driverVersion = driverVersion; }
853 {
return llvmVersion; }
856 { this->llvmVersion = llvmVersion; }
860 {
return deviceType; }
863 { this->deviceType = deviceType; }
869 { format = binFormat; }
875 { _64bit = this64Bit; }
878 {
return newROCmBinFormat; }
881 { newROCmBinFormat = newFmt; }
884 {
return llvm10BinFormat; }
887 { llvm10BinFormat = newFmt; }
890 {
return rocmMetadataV3; }
893 { rocmMetadataV3 = newFmt; }
896 {
return policyVersion; }
899 { policyVersion = pv; }
905 { this->flags = flags; }
908 {
return codeFlags; }
911 { this->codeFlags = flags; }
914 {
return alternateMacro; }
917 {
return macroCase; }
920 {
return oldModParam; }
923 {
return buggyFPLit; }
926 {
return includeDirs; }
928 void addIncludeDir(
const CString& includeDir);
936 const std::vector<Array<AsmSectionId> >& getRelSpacesSections()
const 937 {
return relSpacesSections; }
940 {
return kernelMap; }
949 {
return insertRegVarInScope(name, var).second; }
955 {
return globalScope; }
958 bool isAbsoluteSymbol(
const AsmSymbol& symbol)
const;
961 void addInitialDefSym(
const CString& symName, uint64_t value);
965 {
return formatHandler; }
968 {
return isaAssembler; }
972 { assembler.printWarning(linePtr, message); }
975 { assembler.printError(linePtr, message); }
979 { assembler.printWarningForRange(bits, value, pos, signess); }
982 { assembler.printWarning(sourcePos, message); }
985 { assembler.printError(sourcePos, message); }
987 inline void ISAAssembler::addCodeFlowEntry(
AsmSectionId sectionId,
989 { assembler.sections[sectionId].addCodeFlowEntry(entry); }
991 inline void ISAAssembler::setCodeFlags(
Flags codeFlags)
992 { assembler.setCodeFlags(codeFlags); }
994 inline Flags ISAAssembler::getCodeFlags()
const 995 {
return assembler.getCodeFlags(); }
AsmRepeatInputFilter or AsmIRPInputFilter.
bool is64Bit() const
get bitness (true if 64-bit)
Definition: Assembler.h:871
void set64Bit(bool this64Bit)
set bitness (true if 64-bit)
Definition: Assembler.h:874
AsmRegVarMap regVarMap
regvar map
Definition: AsmDefs.h:652
common definitions for assembler and disassembler
Definition: Assembler.h:373
main class of assembler
Definition: Assembler.h:529
bool haveReturn
code have return from routine
Definition: Assembler.h:406
AsmRegField regField
place in instruction
Definition: Assembler.h:96
bool isLLVM10BinFormat() const
is new ROCm LLVM10 binary format
Definition: Assembler.h:883
non copyable and non movable base structure (class)
Definition: Utilities.h:46
assembler expression class
Definition: AsmDefs.h:286
uint16_t rstart
register start
Definition: Assembler.h:94
uint32_t Flags
type for declaring various flags
Definition: Utilities.h:100
Flags getFlags() const
get flags
Definition: Assembler.h:901
std::unordered_map< CString, AsmRegVar > AsmRegVarMap
regvar map
Definition: AsmDefs.h:535
assembler repeat
Definition: AsmSource.h:236
virtual ~ISAUsageHandler()
destructor
size_t ssaIdChange
number of SSA id changes
Definition: Assembler.h:384
GPUDeviceType getDeviceType() const
get GPU device type
Definition: Assembler.h:859
AsmRegVarMap::value_type AsmRegVarEntry
regvar entry
Definition: AsmDefs.h:537
BinaryFormat
binary format for Assembler/Disassembler
Definition: Commons.h:38
const std::vector< AsmSection > & getSections() const
get sections
Definition: Assembler.h:933
ColNo colNo
column number, for macro substitution and IRP points to column preprocessed line
Definition: AsmSource.h:50
void setDriverVersion(uint32_t driverVersion)
set AMD driver version
Definition: Assembler.h:848
reference pointer based on Glibmm refptr
Definition: Utilities.h:860
uint16_t GPUArchMask
GPU architecture mask (one bit represents single GPU architecture)
Definition: GPUId.h:110
AsmClauseType
type of clause
Definition: Assembler.h:510
Assembler & assembler
assembler
Definition: Assembler.h:219
const AsmRegVarMap & getRegVarMap() const
get regvar map
Definition: Assembler.h:945
delayed result for register for instruction with delayed results
Definition: AsmDefs.h:600
assembler section
Definition: AsmDefs.h:692
DTree container (kind of B-Tree)
std::pair< CString, uint64_t > DefSym
defined symbol entry
Definition: Assembler.h:533
bool isBuggyFPLit() const
get true if buggyFPLit enabled
Definition: Assembler.h:922
AsmRegVarUsage nextUsage(ReadPos &readPos)
get next usage
handles raw code format
Definition: AsmFormats.h:251
Definition: Assembler.h:428
assembler scope for symbol, macros, regvars
Definition: AsmDefs.h:648
bool isNewROCmBinFormat() const
is new ROCm binary format
Definition: Assembler.h:877
Regvar info structure.
Definition: AsmDefs.h:510
void pushLinearDep(const AsmRegVarLinearDep &linearDep)
push linear dependency
Definition: Assembler.h:145
void printError(const char *linePtr, const char *message)
print error for position pointed by line pointer
Definition: Assembler.h:974
bool hasNext(const ReadPos &readPos) const
return true if has next instruction
Definition: Assembler.h:204
void printWarning(const char *linePtr, const char *message)
print warning for position pointed by line pointer
Definition: Assembler.h:971
cxuint sgprsNum
SGPRs number.
Definition: Assembler.h:285
virtual ISAUsageHandler * copy() const =0
copy this usage handler
an array class
Definition: Containers.h:41
std::vector< NextBlock > nexts
nexts blocks, if empty then direct next block
Definition: Assembler.h:404
Flags regFlags
define what extra register must be included
Definition: Assembler.h:287
void pushUsage(const AsmRegVarUsage &rvu)
push regvar or register usage
cxuint AsmSectionId
type for Asm section id (index)
Definition: Commons.h:35
handles ROCM binary format
Definition: AsmFormats.h:564
size_t firstPos
first position in code block (section offset)
Definition: Assembler.h:385
Assembler Wait scheduler.
Definition: Assembler.h:487
size_t ssaId
original SSA id
Definition: Assembler.h:382
void setROCmMetadataV3(bool newFmt)
is new ROCm metadata V3 format
Definition: Assembler.h:892
line and column
Definition: AsmSource.h:45
std::unordered_map< CString, AsmSymbol > AsmSymbolMap
assembler symbol map
Definition: AsmDefs.h:206
internal structure for regvar linear dependencies
Definition: AsmDefs.h:562
virtual void getUsageDependencies(cxuint rvusNum, const AsmRegVarUsage *rvus, cxbyte *linearDeps) const =0
get usage dependencies around single instruction
void setFlags(Flags flags)
set flags
Definition: Assembler.h:904
void pushWaitInstr(const AsmWaitInstr &waitInstr)
wait instruction
Definition: Assembler.h:201
all flags
Definition: Assembler.h:68
AsmSourcePos sourcePos
position in source code
Definition: Assembler.h:523
void setCodeFlags(Flags flags)
set code flags
Definition: Assembler.h:910
Definition: Assembler.h:185
cxuint getPolicyVersion() const
get policy version
Definition: Assembler.h:895
#define CLRX_VERSION_NUMBER
CLRadeonExtender version number.
Definition: Config.h:39
wait handler
Definition: Assembler.h:182
if failed now, no later trial
AsmSectionType
assembler section type
Definition: AsmFormats.h:47
void setPolicyVersion(cxuint pv)
set policy version
Definition: Assembler.h:898
enable altmacro mode
Definition: Assembler.h:61
unsigned char cxbyte
unsigned byte
Definition: Config.h:229
enable resolving symbols if ASM_TESTRUN enabled
Definition: Assembler.h:66
const std::vector< CString > & getIncludeDirs() const
get include directory list
Definition: Assembler.h:925
cxuint vgprsNum
VGPRs number.
Definition: Assembler.h:286
std::unordered_map< CString, RefPtr< const AsmMacro > > AsmMacroMap
assembler macro map
Definition: AsmDefs.h:640
AsmSourcePos prevIfPos
position of previous if-clause
Definition: Assembler.h:525
size_t ssaIdLast
last SSA id in last
Definition: Assembler.h:383
main namespace
Definition: AsmDefs.h:38
const AsmRegVar * regVar
if null, then usage of called register
Definition: Assembler.h:93
size_t lastPos
last position in code block (section offset)
Definition: Assembler.h:386
void setNewROCmBinFormat(bool newFmt)
set new ROCm binary format
Definition: Assembler.h:880
bool isAltMacro() const
get true if altMacro enabled
Definition: Assembler.h:913
bool isMacroCase() const
get true if macroCase enabled
Definition: Assembler.h:916
AsmClauseType type
type of clause
Definition: Assembler.h:522
Definition: Assembler.h:370
format handler with Kcode (kernel-code) handling
Definition: AsmFormats.h:221
unsigned int cxuint
unsigned int
Definition: Config.h:237
const KernelMap & getKernelMap() const
get kernel map
Definition: Assembler.h:939
Definition: Assembler.h:103
BinaryFormat getBinaryFormat() const
get binary format
Definition: Assembler.h:865
buggy handling of fpliterals (including fp constants)
Definition: Assembler.h:62
const AsmSymbolMap & getSymbolMap() const
get symbols map
Definition: Assembler.h:930
std::unordered_map< CString, AsmKernelId > KernelMap
kernel map type
Definition: Assembler.h:535
cxbyte AsmExprTargetType
expression target type (one byte)
Definition: AsmDefs.h:59
std::vector< cxbyte > content
content of section
Definition: AsmDefs.h:702
AsmSymbolMap::value_type AsmSymbolEntry
assembler symbol entry
Definition: AsmDefs.h:208
use WAVESIZE32
Definition: Assembler.h:65
cxuint AsmKernelId
type for Asm kernel id (index)
Definition: Commons.h:33
Definition: Assembler.h:421
GCN (register and regvar) Usage handler.
Definition: Assembler.h:160
AsmRegVarLinearDep getLinearDep(size_t pos) const
get next linear dependency
Definition: Assembler.h:151
GPUDeviceType
type of GPU device
Definition: GPUId.h:51
bool hasNext(const ReadPos &readPos) const
has next regvar usage
Definition: Assembler.h:122
void setLLVM10BinFormat(bool newFmt)
set new ROCm LLVM10 binary format
Definition: Assembler.h:886
size_t size() const
return true if has next
Definition: Assembler.h:148
only for running tests
Definition: Assembler.h:67
enable all warnings for assembler
Definition: Assembler.h:59
void setDeviceType(const GPUDeviceType deviceType)
set GPU device type
Definition: Assembler.h:862
utilities for other libraries and programs
bool haveCalls
code have calls at its end
Definition: Assembler.h:405
bool readBeforeWrite
have read before write
Definition: Assembler.h:387
disable case-insensitive naming (default)
Definition: Assembler.h:64
GCN arch assembler.
Definition: Assembler.h:280
size_t ssaIdBefore
SSA id before first SSA in block.
Definition: Assembler.h:380
AsmSymbolMap symbolMap
symbol map
Definition: AsmDefs.h:651
register pool numbers
Definition: Assembler.h:284
Definition: Assembler.h:91
uint32_t getLLVMVersion() const
get LLVM version
Definition: Assembler.h:852
assembler's clause (if,else,macro,rept)
Definition: Assembler.h:520
regvar usage in code
Definition: AsmDefs.h:549
Definition: Assembler.h:378
GPU identification utilities.
LineNo lineNo
line number
Definition: AsmSource.h:47
bool addRegVar(const CString &name, const AsmRegVar &var)
add regvar
Definition: Assembler.h:948
const ISAAssembler * getISAAssembler() const
get ISA assembler
Definition: Assembler.h:967
stgructure that hold read position to store later
Definition: Assembler.h:84
section is unresolvable
Definition: AsmFormats.h:101
code flow entry
Definition: AsmDefs.h:632
uint32_t getDriverVersion() const
get AMD driver version
Definition: Assembler.h:845
const AsmFormatHandler * getFormatHandler() const
get format handler
Definition: Assembler.h:964
description of the WAIT instruction (for waiting for results)
Definition: AsmDefs.h:614
bool haveEnd
code have end
Definition: Assembler.h:407
ISAUsageHandler()
constructor
void printWarningForRange(cxuint bits, uint64_t value, const AsmSourcePos &pos, cxbyte signess=WS_BOTH)
print warning about integer out of range
Definition: Assembler.h:977
handles GalliumCompute format
Definition: AsmFormats.h:477
const AsmScope & getGlobalScope() const
get global scope
Definition: Assembler.h:954
void pushDelayedOp(const AsmDelayedOp &delOp)
push delayed result
Definition: Assembler.h:198
absolute section id
Definition: AsmFormats.h:86
an assembler sources handling
void setLLVMVersion(uint32_t llvmVersion)
set LLVM version
Definition: Assembler.h:855
assembler symbol structure
Definition: AsmDefs.h:143
asm wait system configuration
Definition: AsmDefs.h:586
bool isOldModParam() const
get true if oldModParam enabled (old modifier parametrization)
Definition: Assembler.h:919
cxbyte AsmRegField
type of register field
Definition: AsmDefs.h:500
ISA regvar linear handler.
Definition: Assembler.h:136
force add symbols to binary
Definition: Assembler.h:60
ISA (register and regvar) Usage handler.
Definition: Assembler.h:80
handles AMD Catalyst format
Definition: AsmFormats.h:277
handles AMD OpenCL 2.0 binary format
Definition: AsmFormats.h:373
Definition: Assembler.h:396
Flags getCodeFlags() const
get code flags
Definition: Assembler.h:907
ISA assembler class.
Definition: Assembler.h:216
simple C-string container
Definition: CString.h:38
an assembler for Radeon GPU's
containers and other utils for other libraries and programs
void setBinaryFormat(BinaryFormat binFormat)
set binary format
Definition: Assembler.h:868
uint16_t rend
register end
Definition: Assembler.h:95
bool condSatisfied
if conditional clause has already been satisfied
Definition: Assembler.h:524
bool isROCmMetadataV3() const
is new ROCm metadata V3 format
Definition: Assembler.h:889
const std::vector< AsmKernel > & getKernels() const
get kernels
Definition: Assembler.h:942
assembler source position
Definition: AsmSource.h:150