diff options
author | Tony Gutierrez <anthony.gutierrez@amd.com> | 2016-10-26 22:47:49 -0400 |
---|---|---|
committer | Tony Gutierrez <anthony.gutierrez@amd.com> | 2016-10-26 22:47:49 -0400 |
commit | b63eb1302b006682bd227a5e236f7b3b95e9b8e8 (patch) | |
tree | 87d8422e6bbc7cd88e33d9408e2010c2bdd3c337 /src/arch/hsail/insts/decl.hh | |
parent | aa7364276f16bbe6aa300b43bc57ff1b73be42a7 (diff) | |
download | gem5-b63eb1302b006682bd227a5e236f7b3b95e9b8e8.tar.xz |
gpu-compute, hsail: pass GPUDynInstPtr to getRegisterIndex()
for HSAIL an operand's indices into the register files may be calculated
trivially, because the operands are always read from a register file, or are
an immediate.
for machine ISA, however, an op selector may specify special registers, or
may specify special SGPRs with an alias op selector value. the location of
some of the special registers values are dependent on the size of the RF
in some cases. here we add a way for the underlying getRegisterIndex()
method to know about the size of the RFs, so that it may find the relative
positions of the special register values.
Diffstat (limited to 'src/arch/hsail/insts/decl.hh')
-rw-r--r-- | src/arch/hsail/insts/decl.hh | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/src/arch/hsail/insts/decl.hh b/src/arch/hsail/insts/decl.hh index 94f23ac1f..c40411ace 100644 --- a/src/arch/hsail/insts/decl.hh +++ b/src/arch/hsail/insts/decl.hh @@ -178,7 +178,9 @@ namespace HsailISA else return dest.opSize(); } - int getRegisterIndex(int operandIndex) { + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { assert(operandIndex >= 0 && operandIndex < getNumOperands()); if (operandIndex < NumSrcOperands) @@ -313,7 +315,10 @@ namespace HsailISA else return dest.opSize(); } - int getRegisterIndex(int operandIndex) { + + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { assert((operandIndex >= 0) && (operandIndex < getNumOperands())); if (!operandIndex) return src0.regIndex(); @@ -477,7 +482,10 @@ namespace HsailISA else return dest.opSize(); } - int getRegisterIndex(int operandIndex) { + + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { assert((operandIndex >= 0) && (operandIndex < getNumOperands())); if (!operandIndex) return src0.regIndex(); @@ -643,7 +651,7 @@ namespace HsailISA return -1; //handle positive and negative numbers - T tmp = (src0 < 0) ? (~src0) : (src0); + T tmp = ((int64_t)src0 < 0) ? (~src0) : (src0); //the starting pos is MSB int pos = 8 * sizeof(T) - 1; @@ -732,7 +740,12 @@ namespace HsailISA bool isSrcOperand(int operandIndex) { return false; } bool isDstOperand(int operandIndex) { return false; } int getOperandSize(int operandIndex) { return 0; } - int getRegisterIndex(int operandIndex) { return -1; } + + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { + return -1; + } int numSrcRegOperands() { return 0; } int numDstRegOperands() { return 0; } @@ -777,10 +790,14 @@ namespace HsailISA assert((operandIndex >= 0) && (operandIndex < getNumOperands())); return dest.opSize(); } - int getRegisterIndex(int operandIndex) { + + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { assert((operandIndex >= 0) && (operandIndex < getNumOperands())); return dest.regIndex(); } + int numSrcRegOperands() { return 0; } int numDstRegOperands() { return dest.isVectorRegister(); } int getNumOperands() { return 1; } @@ -848,10 +865,14 @@ namespace HsailISA assert((operandIndex >= 0) && (operandIndex < getNumOperands())); return dest.opSize(); } - int getRegisterIndex(int operandIndex) { + + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { assert((operandIndex >= 0) && (operandIndex < getNumOperands())); return dest.regIndex(); } + int numSrcRegOperands() { return 0; } int numDstRegOperands() { return dest.isVectorRegister(); } int getNumOperands() { return 1; } @@ -1171,8 +1192,13 @@ namespace HsailISA bool isScalarRegister(int operandIndex) { return false; } bool isSrcOperand(int operandIndex) { return false; } bool isDstOperand(int operandIndex) { return false; } - int getOperandSize(int operandIndex) { return 0; } - int getRegisterIndex(int operandIndex) { return -1; } + int getOperandSize(int operandIndex) { return 0; } + + int + getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) + { + return -1; + } void execute(GPUDynInstPtr gpuDynInst) |