From: Tony Gutierrez Date: Thu, 27 Oct 2016 02:47:05 +0000 (-0400) Subject: gpu-compute: move disassemle() implementation to GPUStaticInst X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e1ad8035a379cea98ecef92e78d2894f60b2eedd;p=gem5.git gpu-compute: move disassemle() implementation to GPUStaticInst --- diff --git a/src/arch/hsail/insts/gpu_static_inst.cc b/src/arch/hsail/insts/gpu_static_inst.cc index bbaeb13e6..dba2756d0 100644 --- a/src/arch/hsail/insts/gpu_static_inst.cc +++ b/src/arch/hsail/insts/gpu_static_inst.cc @@ -50,15 +50,4 @@ namespace HsailISA { disassembly = opcode; } - - const std::string& - HsailGPUStaticInst::disassemble() - { - if (disassembly.empty()) { - generateDisassembly(); - assert(!disassembly.empty()); - } - - return disassembly; - } } // namespace HsailISA diff --git a/src/arch/hsail/insts/gpu_static_inst.hh b/src/arch/hsail/insts/gpu_static_inst.hh index 6a5ad5003..5dcfe78d5 100644 --- a/src/arch/hsail/insts/gpu_static_inst.hh +++ b/src/arch/hsail/insts/gpu_static_inst.hh @@ -54,7 +54,6 @@ namespace HsailISA public: HsailGPUStaticInst(const BrigObject *obj, const std::string &opcode); void generateDisassembly(); - const std::string &disassemble(); uint32_t instSize() { return 4; } bool isValid() const override { return true; } diff --git a/src/gpu-compute/gpu_static_inst.cc b/src/gpu-compute/gpu_static_inst.cc index bcb8a5f3d..83b429e62 100644 --- a/src/gpu-compute/gpu_static_inst.cc +++ b/src/gpu-compute/gpu_static_inst.cc @@ -40,3 +40,13 @@ GPUStaticInst::GPUStaticInst(const std::string &opcode) _instNum(0), _scalarOp(false) { } +const std::string& +GPUStaticInst::disassemble() +{ + if (disassembly.empty()) { + generateDisassembly(); + assert(!disassembly.empty()); + } + + return disassembly; +} diff --git a/src/gpu-compute/gpu_static_inst.hh b/src/gpu-compute/gpu_static_inst.hh index 447e1efa3..911e4f308 100644 --- a/src/gpu-compute/gpu_static_inst.hh +++ b/src/gpu-compute/gpu_static_inst.hh @@ -72,7 +72,7 @@ class GPUStaticInst virtual void execute(GPUDynInstPtr gpuDynInst) = 0; virtual void generateDisassembly() = 0; - virtual const std::string &disassemble() = 0; + const std::string& disassemble(); virtual int getNumOperands() = 0; virtual bool isCondRegister(int operandIndex) = 0; virtual bool isScalarRegister(int operandIndex) = 0;