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;
233 : name(_name), offset(_offset), size(_size), brigSymbol(sym)
240 typedef std::map<const Brig::BrigDirectiveVariable*, StorageElement*>
374 case MemorySegment::NONE:
377 case MemorySegment::FLAT:
380 case MemorySegment::GLOBAL:
383 case MemorySegment::READONLY:
386 case MemorySegment::KERNARG:
389 case MemorySegment::GROUP:
392 case MemorySegment::PRIVATE:
395 case MemorySegment::SPILL:
398 case MemorySegment::ARG:
401 case MemorySegment::EXTSPACE0:
405 fatal(
"Unknown BrigSegment type.\n");
408 return getSize(brigSeg);
421 return storageMap->
getSize(segment);
435 private_size = _private_size;
445 #endif // __HSAIL_CODE_HH__
StorageElement(const char *_name, uint64_t _offset, int _size, const Brig::BrigDirectiveVariable *sym)
int getSize(Brig::BrigSegment segment)
#define fatal(...)
This implements a cprintf based fatal() function.
Label * refLabel(const Brig::BrigDirectiveLabel *lbl, const BrigObject *obj)
Label * refLabel(const Brig::BrigDirectiveLabel *lbl, const BrigObject *obj)
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)
T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
int getSize(MemorySegment segment) const
void generateHsaKernelInfo(HsaKernelInfo *hsaKernelInfo) const
const Brig::BrigDirectiveVariable * brigSymbol
void define(std::string &_name, int _value)
int getSize(Brig::BrigSegment segment) const
StorageElement * findSymbol(Brig::BrigSegment8_t segment, std::string name)
StorageElement * findSymbol(Brig::BrigSegment segment, uint64_t addr)
The AddrRangeMap uses an STL map to implement an interval tree for address decoding.
uint32_t private_mem_size
const char * segmentNames[]
uint64_t bitrev(uint64_t src, int sz)
std::list< StorageElement * > elements
TheGpuISA::Decoder decoder
AddrRangeMap< StorageElement * > elements_by_addr
int signbit(uint64_t src, int sz)
std::map< std::string, Label > map
StorageMap * outerScopeMap
StorageSpace(Brig::BrigSegment _class)
int firstbit(uint64_t src, int sz)
uint64_t mul_hi(uint32_t a, uint32_t b)
const FlagsType init
This Stat is Initialized.
int popcount(uint64_t src, int sz)
std::map< const Brig::BrigDirectiveVariable *, StorageElement * > DirVarToSE_map