gpu-compute: move disassemle() implementation to GPUStaticInst

This commit is contained in:
Tony Gutierrez 2016-10-26 22:47:05 -04:00
parent 0a6cdff176
commit e1ad8035a3
4 changed files with 11 additions and 13 deletions

View file

@ -50,15 +50,4 @@ namespace HsailISA
{ {
disassembly = opcode; disassembly = opcode;
} }
const std::string&
HsailGPUStaticInst::disassemble()
{
if (disassembly.empty()) {
generateDisassembly();
assert(!disassembly.empty());
}
return disassembly;
}
} // namespace HsailISA } // namespace HsailISA

View file

@ -54,7 +54,6 @@ namespace HsailISA
public: public:
HsailGPUStaticInst(const BrigObject *obj, const std::string &opcode); HsailGPUStaticInst(const BrigObject *obj, const std::string &opcode);
void generateDisassembly(); void generateDisassembly();
const std::string &disassemble();
uint32_t instSize() { return 4; } uint32_t instSize() { return 4; }
bool isValid() const override { return true; } bool isValid() const override { return true; }

View file

@ -40,3 +40,13 @@ GPUStaticInst::GPUStaticInst(const std::string &opcode)
_instNum(0), _scalarOp(false) _instNum(0), _scalarOp(false)
{ {
} }
const std::string&
GPUStaticInst::disassemble()
{
if (disassembly.empty()) {
generateDisassembly();
assert(!disassembly.empty());
}
return disassembly;
}

View file

@ -72,7 +72,7 @@ class GPUStaticInst
virtual void execute(GPUDynInstPtr gpuDynInst) = 0; virtual void execute(GPUDynInstPtr gpuDynInst) = 0;
virtual void generateDisassembly() = 0; virtual void generateDisassembly() = 0;
virtual const std::string &disassemble() = 0; const std::string& disassemble();
virtual int getNumOperands() = 0; virtual int getNumOperands() = 0;
virtual bool isCondRegister(int operandIndex) = 0; virtual bool isCondRegister(int operandIndex) = 0;
virtual bool isScalarRegister(int operandIndex) = 0; virtual bool isScalarRegister(int operandIndex) = 0;