gpu-compute, arch: add some methods to the base inst classes for ISA support

This commit is contained in:
Tony Gutierrez 2016-10-26 22:47:01 -04:00
parent c7d4afd878
commit 0a6cdff176
2 changed files with 10 additions and 0 deletions

View file

@ -56,6 +56,7 @@ namespace HsailISA
void generateDisassembly(); void generateDisassembly();
const std::string &disassemble(); const std::string &disassemble();
uint32_t instSize() { return 4; } uint32_t instSize() { return 4; }
bool isValid() const override { return true; }
protected: protected:
HsailCode *hsailCode; HsailCode *hsailCode;

View file

@ -84,6 +84,8 @@ class GPUStaticInst
virtual int numDstRegOperands() = 0; virtual int numDstRegOperands() = 0;
virtual int numSrcRegOperands() = 0; virtual int numSrcRegOperands() = 0;
virtual bool isValid() const = 0;
/* /*
* Most instructions (including all HSAIL instructions) * Most instructions (including all HSAIL instructions)
* are vector ops, so _scalarOp will be false by default. * are vector ops, so _scalarOp will be false by default.
@ -109,6 +111,13 @@ class GPUStaticInst
fatal("calling initiateAcc() on a non-memory instruction.\n"); fatal("calling initiateAcc() on a non-memory instruction.\n");
} }
// only used for memory instructions
virtual void
completeAcc(GPUDynInstPtr gpuDynInst)
{
fatal("calling completeAcc() on a non-memory instruction.\n");
}
virtual uint32_t getTargetPc() { return 0; } virtual uint32_t getTargetPc() { return 0; }
/** /**