CLRX  1
An unofficial OpenCL extensions designed for Radeon GPUs
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CLRX::AsmFormatHandler Class Referenceabstract

assdembler format handler More...

#include <AsmFormats.h>

Inheritance diagram for CLRX::AsmFormatHandler:
CLRX::NonCopyableAndNonMovable CLRX::AsmAmdCL2Handler CLRX::AsmAmdHandler CLRX::AsmGalliumHandler CLRX::AsmRawCodeHandler CLRX::AsmROCmHandler

Classes

struct  SectionInfo
 section information More...
 

Public Member Functions

bool isSectionDiffsResolvable () const
 return true if format handler can resolve differences between sections
 
virtual cxuint addKernel (const char *kernelName)=0
 add/set kernel More...
 
virtual cxuint addSection (const char *sectionName, cxuint kernelId)=0
 add section More...
 
virtual cxuint getSectionId (const char *sectionName) const =0
 get section id if exists in current context, otherwise returns ASMSECT_NONE
 
virtual void setCurrentKernel (cxuint kernel)=0
 set current kernel
 
virtual void setCurrentSection (cxuint sectionId)=0
 set current section, this method can change current kernel if that required
 
virtual SectionInfo getSectionInfo (cxuint sectionId) const =0
 get current section flags and type
 
virtual bool parsePseudoOp (const CString &firstName, const char *stmtPlace, const char *linePtr)=0
 parse pseudo-op (return true if recognized pseudo-op)
 
virtual void handleLabel (const CString &label)
 handle labels
 
virtual bool resolveSymbol (const AsmSymbol &symbol, uint64_t &value, cxuint &sectionId)
 resolve symbol if needed (for example that comes from unresolvable sections)
 
virtual bool resolveRelocation (const AsmExpression *expr, uint64_t &value, cxuint &sectionId)
 resolve relocation for specified expression
 
virtual bool prepareBinary ()=0
 prepare binary for use
 
virtual void writeBinary (std::ostream &os) const =0
 write binary to output stream
 
virtual void writeBinary (Array< cxbyte > &array) const =0
 write binary to array
 
virtual bool prepareSectionDiffsResolving ()
 prepare before section diference resolving
 
- Public Member Functions inherited from CLRX::NonCopyableAndNonMovable
 NonCopyableAndNonMovable ()
 constructor
 
 NonCopyableAndNonMovable (const NonCopyableAndNonMovable &)=delete
 copy-constructor
 
 NonCopyableAndNonMovable (NonCopyableAndNonMovable &&)=delete
 move-constructor
 
NonCopyableAndNonMovableoperator= (const NonCopyableAndNonMovable &)=delete
 copy-assignment
 
NonCopyableAndNonMovableoperator= (NonCopyableAndNonMovable &&)=delete
 move-asignment
 

Protected Member Functions

 AsmFormatHandler (Assembler &assembler)
 constructor
 
bool resolveLoHiRelocExpression (const AsmExpression *expr, RelocType &relType, cxuint &relSectionId, uint64_t &relValue)
 

Protected Attributes

Assemblerassembler
 assembler reference
 
bool sectionDiffsResolvable
 

Detailed Description

assdembler format handler

Member Function Documentation

virtual cxuint CLRX::AsmFormatHandler::addKernel ( const char *  kernelName)
pure virtual

add/set kernel

adds new kernel. throw AsmFormatException when addition failed. Method should handles any constraint that doesn't allow to add kernel except duplicate of name.

Parameters
kernelNamekernel name
Returns
kernel id

Implemented in CLRX::AsmROCmHandler, CLRX::AsmGalliumHandler, CLRX::AsmAmdCL2Handler, CLRX::AsmAmdHandler, and CLRX::AsmRawCodeHandler.

virtual cxuint CLRX::AsmFormatHandler::addSection ( const char *  sectionName,
cxuint  kernelId 
)
pure virtual

add section

adds new section . throw AsmFormatException when addition failed. Method should handles any constraint that doesn't allow to add section except duplicate of name.

Parameters
sectionNamesection name
kernelIdkernel id (may ASMKERN_GLOBAL)
Returns
section id

Implemented in CLRX::AsmROCmHandler, CLRX::AsmGalliumHandler, CLRX::AsmAmdCL2Handler, CLRX::AsmAmdHandler, and CLRX::AsmRawCodeHandler.


The documentation for this class was generated from the following file: