summaryrefslogtreecommitdiff
path: root/src/gpu-compute
diff options
context:
space:
mode:
authorTony Gutierrez <anthony.gutierrez@amd.com>2016-10-26 22:47:05 -0400
committerTony Gutierrez <anthony.gutierrez@amd.com>2016-10-26 22:47:05 -0400
commite1ad8035a379cea98ecef92e78d2894f60b2eedd (patch)
tree2d40294b1706bc4af45c8fae89f381bf7e99bfa7 /src/gpu-compute
parent0a6cdff1760572bfa3cf9dffaa4a0df9fb4ae6a4 (diff)
downloadgem5-e1ad8035a379cea98ecef92e78d2894f60b2eedd.tar.xz
gpu-compute: move disassemle() implementation to GPUStaticInst
Diffstat (limited to 'src/gpu-compute')
-rw-r--r--src/gpu-compute/gpu_static_inst.cc10
-rw-r--r--src/gpu-compute/gpu_static_inst.hh2
2 files changed, 11 insertions, 1 deletions
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;