diff options
| author | Ahmed El-Shafiey <[email protected]> | 2012-08-14 13:53:25 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:48:54 -0700 |
| commit | 0ce06988a6a13f9a8f48f2230b1b9727ee86081e (patch) | |
| tree | 08a4f172a71b3a9b0de5bea1b1c74f38d97036cb /cuobjdump_to_ptxplus/cuobjdumpInst.cc | |
| parent | 8f2b4a6f61ef30d86b9bae7c92ed62f223550a76 (diff) | |
Fixing bugs 169, 170, 171
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13761]
Diffstat (limited to 'cuobjdump_to_ptxplus/cuobjdumpInst.cc')
| -rw-r--r-- | cuobjdump_to_ptxplus/cuobjdumpInst.cc | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/cuobjdump_to_ptxplus/cuobjdumpInst.cc b/cuobjdump_to_ptxplus/cuobjdumpInst.cc index dd9bb99..22dbdd3 100644 --- a/cuobjdump_to_ptxplus/cuobjdumpInst.cc +++ b/cuobjdump_to_ptxplus/cuobjdumpInst.cc @@ -539,7 +539,8 @@ void cuobjdumpInst::printCuobjdumpOperand(std::string currentPiece, std::string (m_base == "R2G") || (m_base == "GLD") || (m_base == "GST") || - (m_base == "LST") ))) { + (m_base == "LST") || + (m_base == "LLD")))) { std::string modsub = mod.substr(1); int regNumInt = atoi(modsub.c_str()); std::stringstream temp; @@ -576,8 +577,7 @@ void cuobjdumpInst::printCuobjdumpOperand(std::string currentPiece, std::string std::string modsub2; std::string modsub3; modsub = mod.c_str(); - int localFlag = 0; - + int const_sharedFlag =0; if(mod.find("global14") != std::string::npos) { //Those instructions don't need the dereferencing done by g [*] if( base == "GRED" || @@ -590,15 +590,23 @@ void cuobjdumpInst::printCuobjdumpOperand(std::string currentPiece, std::string } else if(mod[0]=='g') { //Shared memory output("s["); + const_sharedFlag=1; } else if(mod.find("local") != std::string::npos) { - modsub3 = modsub.substr(4, modsub.length()-10); - output(modsub3.c_str()); + if((base=="LST")|| + (base=="LLD")) output("["); - localFlag = 1; + else + output("l["); + //modsub3 = modsub.substr(4, modsub.length()-10); + //output(modsub3.c_str()); + //output("["); + //localFlag = 1; } else if(mod.substr(0,9) == "constant1") { output(modsub.substr(0, modsub.find_first_of("[]")+1).c_str()); + const_sharedFlag=1; } else if(mod.substr(0,9)=="constant0"){ output("constant0["); + const_sharedFlag=1; } else { printf("Unidentified modifier: %s\n", mod.c_str()); assert(0); @@ -636,14 +644,17 @@ void cuobjdumpInst::printCuobjdumpOperand(std::string currentPiece, std::string std::stringstream hexStringConvert; hexStringConvert << std::hex << modsub2; hexStringConvert >> addrValue; - unsigned chunksize = 4; - if ( this->m_typeModifiers->size()>0 && - ( m_typeModifiers->back() == ".S16" || - m_typeModifiers->back() == ".U16")) chunksize = 2; - if ( this->m_typeModifiers->size()>0 && - ( m_typeModifiers->back() == ".U8" || - m_typeModifiers->back() == ".S8")) chunksize = 1; - addrValue = addrValue*chunksize; + if(const_sharedFlag == 1) + { + unsigned chunksize = 4; + if ( this->m_typeModifiers->size()>0 && + ( m_typeModifiers->back() == ".S16" || + m_typeModifiers->back() == ".U16")) chunksize = 2; + if ( this->m_typeModifiers->size()>0 && + ( m_typeModifiers->back() == ".U8" || + m_typeModifiers->back() == ".S8")) chunksize = 1; + addrValue = addrValue*chunksize; + } char outputHex[10]; sprintf(outputHex, "%x", addrValue); std::stringstream outputhex; @@ -669,7 +680,7 @@ void cuobjdumpInst::printCuobjdumpOperand(std::string currentPiece, std::string hexStringConvert << std::hex << modsub; hexStringConvert >> addrValue; - if(localFlag == 0) + if(const_sharedFlag == 1) { unsigned chunksize = 4; if ( m_typeModifiers->size()>0 && |
