36 #ifndef __HSAIL_CODE_HH__
37 #define __HSAIL_CODE_HH__
45 #include "arch/gpu_decoder.hh"
49 #include "config/the_gpu_isa.hh"
62 for (
int i = 0;
i < sz; ++
i) {
76 for (i = 0; i < sz; ++
i) {
90 for (
int i = 0;
i < sz; ++
i) {
104 if (src & (1 << (sz - 1))) {
105 for (
int i = 0;
i < sz - 1; ++
i) {
111 for (
int i = 0;
i < sz - 1; ++
i) {
126 for (
int i = 0;
i < sz; ++
i) {
139 return ((uint64_t)a * (uint64_t)b) >> 32;
145 return ((int64_t)a * (int64_t)b) >> 32;
151 return ((uint64_t)a * (uint64_t)b) >> 32;
157 return ((int64_t)a * (int64_t)b) >> 32;
184 assert(
name == _name);
192 assert(_value != -1);
207 std::map<std::string, Label>
map;
240 typedef std::map<const Brig::BrigDirectiveVariable*, StorageElement*>
407 fatal(
"Unknown BrigSegment type.\n");
447 #endif // __HSAIL_CODE_HH__
StorageElement(const char *_name, uint64_t _offset, int _size, const Brig::BrigDirectiveVariable *sym)
int getSize(Brig::BrigSegment segment)
int getSize(MemorySegment segment) const
const std::string & name()
Label * refLabel(const Brig::BrigDirectiveLabel *lbl, const BrigObject *obj)
Label * refLabel(const Brig::BrigDirectiveLabel *lbl, const BrigObject *obj)
StorageElement * addSymbol(const Brig::BrigDirectiveVariable *sym, const BrigObject *obj)
void generateHsaKernelInfo(HsaKernelInfo *hsaKernelInfo) const
void checkName(std::string &_name)
int lastbit(uint64_t src, int sz)
DirVarToSE_map elements_by_brigptr
void setPrivateSize(int32_t _private_size)
StorageElement * findSymbol(Brig::BrigSegment segment, std::string name)
Brig::BrigSegment segment
T roundUp(const T &val, const U &align)
StorageSpace * space[NumSegments]
StorageElement * addSymbol(const Brig::BrigDirectiveVariable *sym, const BrigObject *obj)
const Brig::BrigDirectiveVariable * brigSymbol
void define(std::string &_name, int _value)
void resetOffset(Brig::BrigSegment segment)
StorageElement * findSymbol(Brig::BrigSegment8_t segment, std::string name)
StorageElement * findSymbol(Brig::BrigSegment segment, uint64_t addr)
StorageElement * findSymbol(std::string name)
uint32_t private_mem_size
const char * segmentNames[]
StorageMap(StorageMap *outerScope=nullptr)
uint64_t bitrev(uint64_t src, int sz)
std::list< StorageElement * > elements
TheGpuISA::Decoder decoder
AddrRangeMap< StorageElement * > elements_by_addr
int getSize(Brig::BrigSegment segment) const
void init(const Brig::BrigDirectiveExecutable *code_dir, const BrigObject *obj, StorageMap *objStorageMap)
int signbit(uint64_t src, int sz)
std::map< std::string, Label > map
HsailCode(const std::string &name_str, const Brig::BrigDirectiveExecutable *code_dir, const BrigObject *obj, StorageMap *objStorageMap)
StorageMap * outerScopeMap
StorageSpace(Brig::BrigSegment _class)
int firstbit(uint64_t src, int sz)
uint64_t mul_hi(uint32_t a, uint32_t b)
int popcount(uint64_t src, int sz)
std::map< const Brig::BrigDirectiveVariable *, StorageElement * > DirVarToSE_map
void addLabel(const Brig::BrigDirectiveLabel *lbl, int inst_index, const BrigObject *obj)