class BrnInstBase : public HsailGPUStaticInst
{
public:
- void generateDisassembly();
+ void generateDisassembly() override;
Brig::BrigWidth8_t width;
TargetType target;
uint32_t getTargetPc() override { return target.getTarget(0, 0); }
bool unconditionalJumpInstruction() override { return true; }
- bool isVectorRegister(int operandIndex) {
+ bool isVectorRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.isVectorRegister();
}
- bool isCondRegister(int operandIndex) {
+ bool isCondRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.isCondRegister();
}
- bool isScalarRegister(int operandIndex) {
+ bool isScalarRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.isScalarRegister();
}
- bool isSrcOperand(int operandIndex) {
+ bool isSrcOperand(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return true;
}
- bool isDstOperand(int operandIndex) {
+ bool isDstOperand(int operandIndex) override {
return false;
}
- int getOperandSize(int operandIndex) {
+ int getOperandSize(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.opSize();
}
- int getRegisterIndex(int operandIndex) {
+ int getRegisterIndex(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.regIndex();
}
- int getNumOperands() {
+ int getNumOperands() override {
return 1;
}
- void execute(GPUDynInstPtr gpuDynInst);
+ void execute(GPUDynInstPtr gpuDynInst) override;
};
template<typename TargetType>
class CbrInstBase : public HsailGPUStaticInst
{
public:
- void generateDisassembly();
+ void generateDisassembly() override;
Brig::BrigWidth8_t width;
CRegOperand cond;
uint32_t getTargetPc() override { return target.getTarget(0, 0); }
- void execute(GPUDynInstPtr gpuDynInst);
+ void execute(GPUDynInstPtr gpuDynInst) override;
// Assumption: Target is operand 0, Condition Register is operand 1
- bool isVectorRegister(int operandIndex) {
+ bool isVectorRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
if (!operandIndex)
return target.isVectorRegister();
else
return false;
}
- bool isCondRegister(int operandIndex) {
+ bool isCondRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
if (!operandIndex)
return target.isCondRegister();
else
return true;
}
- bool isScalarRegister(int operandIndex) {
+ bool isScalarRegister(int operandIndex) override {
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (!operandIndex)
return target.isScalarRegister();
else
return false;
}
- bool isSrcOperand(int operandIndex) {
+ bool isSrcOperand(int operandIndex) override {
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex == 0)
return true;
return false;
}
// both Condition Register and Target are source operands
- bool isDstOperand(int operandIndex) {
+ bool isDstOperand(int operandIndex) override {
return false;
}
- int getOperandSize(int operandIndex) {
+ int getOperandSize(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
if (!operandIndex)
return target.opSize();
else
return 1;
}
- int getRegisterIndex(int operandIndex) {
+ int getRegisterIndex(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
if (!operandIndex)
return target.regIndex();
}
// Operands = Target, Condition Register
- int getNumOperands() {
+ int getNumOperands() override {
return 2;
}
};
class BrInstBase : public HsailGPUStaticInst
{
public:
- void generateDisassembly();
+ void generateDisassembly() override;
ImmOperand<uint32_t> width;
TargetType target;
bool unconditionalJumpInstruction() override { return true; }
- void execute(GPUDynInstPtr gpuDynInst);
- bool isVectorRegister(int operandIndex) {
+ void execute(GPUDynInstPtr gpuDynInst) override;
+ bool isVectorRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.isVectorRegister();
}
- bool isCondRegister(int operandIndex) {
+ bool isCondRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.isCondRegister();
}
- bool isScalarRegister(int operandIndex) {
+ bool isScalarRegister(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.isScalarRegister();
}
- bool isSrcOperand(int operandIndex) {
+ bool isSrcOperand(int operandIndex) override {
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return true;
}
- bool isDstOperand(int operandIndex) { return false; }
- int getOperandSize(int operandIndex) {
+ bool isDstOperand(int operandIndex) override { return false; }
+ int getOperandSize(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.opSize();
}
- int getRegisterIndex(int operandIndex) {
+ int getRegisterIndex(int operandIndex) override {
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return target.regIndex();
}
- int getNumOperands() { return 1; }
+ int getNumOperands() override { return 1; }
};
template<typename TargetType>
addr.init(op_offs, obj);
}
- int numSrcRegOperands() { return(this->addr.isVectorRegister()); }
- int numDstRegOperands() { return dest.isVectorRegister(); }
- bool isVectorRegister(int operandIndex)
+ int numSrcRegOperands() override
+ { return(this->addr.isVectorRegister()); }
+ int numDstRegOperands() override
+ { return dest.isVectorRegister(); }
+ bool isVectorRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.isVectorRegister() :
this->addr.isVectorRegister());
}
- bool isCondRegister(int operandIndex)
+ bool isCondRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.isCondRegister() :
this->addr.isCondRegister());
}
- bool isScalarRegister(int operandIndex)
+ bool isScalarRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.isScalarRegister() :
this->addr.isScalarRegister());
}
- bool isSrcOperand(int operandIndex)
+ bool isSrcOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex > 0)
return(this->addr.isVectorRegister());
return false;
}
- bool isDstOperand(int operandIndex) {
+ bool isDstOperand(int operandIndex) override {
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return(operandIndex == 0);
}
- int getOperandSize(int operandIndex)
+ int getOperandSize(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.opSize() :
this->addr.opSize());
}
- int getRegisterIndex(int operandIndex)
+ int getRegisterIndex(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.regIndex() :
this->addr.regIndex());
}
- int getNumOperands()
+ int getNumOperands() override
{
if (this->addr.isVectorRegister())
return 2;
}
}
- int numSrcRegOperands() { return(this->addr.isVectorRegister()); }
- int numDstRegOperands() { return dest.isVectorRegister(); }
- int getNumOperands()
+ int numSrcRegOperands() override
+ { return(this->addr.isVectorRegister()); }
+ int numDstRegOperands() override { return dest.isVectorRegister(); }
+ int getNumOperands() override
{
if (this->addr.isVectorRegister())
return 2;
else
return 1;
}
- bool isVectorRegister(int operandIndex)
+ bool isVectorRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.isVectorRegister() :
this->addr.isVectorRegister());
}
- bool isCondRegister(int operandIndex)
+ bool isCondRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.isCondRegister() :
this->addr.isCondRegister());
}
- bool isScalarRegister(int operandIndex)
+ bool isScalarRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.isScalarRegister() :
this->addr.isScalarRegister());
}
- bool isSrcOperand(int operandIndex)
+ bool isSrcOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex > 0)
return(this->addr.isVectorRegister());
return false;
}
- bool isDstOperand(int operandIndex)
+ bool isDstOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return(operandIndex == 0);
}
- int getOperandSize(int operandIndex)
+ int getOperandSize(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.opSize() :
this->addr.opSize());
}
- int getRegisterIndex(int operandIndex)
+ int getRegisterIndex(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return((operandIndex == 0) ? dest.regIndex() :
{
typename DestDataType::OperandType::DestOperand dest_vect[4];
uint16_t num_dest_operands;
- void generateDisassembly();
+ void generateDisassembly() override;
public:
LdInst(const Brig::BrigInstBase *ib, const BrigObject *obj,
return this->segment == Brig::BRIG_SEGMENT_GROUP;
}
- bool isVectorRegister(int operandIndex)
+ bool isVectorRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
}
return false;
}
- bool isCondRegister(int operandIndex)
+ bool isCondRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
AddrOperandType>::dest.isCondRegister();
return false;
}
- bool isScalarRegister(int operandIndex)
+ bool isScalarRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
AddrOperandType>::dest.isScalarRegister();
return false;
}
- bool isSrcOperand(int operandIndex)
+ bool isSrcOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
return(this->addr.isVectorRegister());
return false;
}
- bool isDstOperand(int operandIndex)
+ bool isDstOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
return false;
return true;
}
- int getOperandSize(int operandIndex)
+ int getOperandSize(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
AddrOperandType>::dest.opSize());
return 0;
}
- int getRegisterIndex(int operandIndex)
+ int getRegisterIndex(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if ((num_dest_operands != getNumOperands()) &&
AddrOperandType>::dest.regIndex());
return -1;
}
- int getNumOperands()
+ int getNumOperands() override
{
if (this->addr.isVectorRegister() || this->addr.isScalarRegister())
return(num_dest_operands+1);
else
return(num_dest_operands);
}
- void execute(GPUDynInstPtr gpuDynInst);
+ void execute(GPUDynInstPtr gpuDynInst) override;
};
template<typename MemDT, typename DestDT>
}
}
- int numDstRegOperands() { return 0; }
- int numSrcRegOperands()
+ int numDstRegOperands() override { return 0; }
+ int numSrcRegOperands() override
{
return src.isVectorRegister() + this->addr.isVectorRegister();
}
- int getNumOperands()
+ int getNumOperands() override
{
if (this->addr.isVectorRegister() || this->addr.isScalarRegister())
return 2;
else
return 1;
}
- bool isVectorRegister(int operandIndex)
+ bool isVectorRegister(int operandIndex) override
{
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return !operandIndex ? src.isVectorRegister() :
this->addr.isVectorRegister();
}
- bool isCondRegister(int operandIndex)
+ bool isCondRegister(int operandIndex) override
{
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return !operandIndex ? src.isCondRegister() :
this->addr.isCondRegister();
}
- bool isScalarRegister(int operandIndex)
+ bool isScalarRegister(int operandIndex) override
{
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return !operandIndex ? src.isScalarRegister() :
this->addr.isScalarRegister();
}
- bool isSrcOperand(int operandIndex)
+ bool isSrcOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return true;
}
- bool isDstOperand(int operandIndex) { return false; }
- int getOperandSize(int operandIndex)
+ bool isDstOperand(int operandIndex) override { return false; }
+ int getOperandSize(int operandIndex) override
{
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return !operandIndex ? src.opSize() : this->addr.opSize();
}
- int getRegisterIndex(int operandIndex)
+ int getRegisterIndex(int operandIndex) override
{
assert(operandIndex >= 0 && operandIndex < getNumOperands());
return !operandIndex ? src.regIndex() : this->addr.regIndex();
public:
typename SrcDataType::OperandType::SrcOperand src_vect[4];
uint16_t num_src_operands;
- void generateDisassembly();
+ void generateDisassembly() override;
StInst(const Brig::BrigInstBase *ib, const BrigObject *obj,
const char *_opcode, int srcIdx)
}
public:
- bool isVectorRegister(int operandIndex)
+ bool isVectorRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex == num_src_operands)
AddrOperandType>::src.isVectorRegister();
return false;
}
- bool isCondRegister(int operandIndex)
+ bool isCondRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex == num_src_operands)
AddrOperandType>::src.isCondRegister();
return false;
}
- bool isScalarRegister(int operandIndex)
+ bool isScalarRegister(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex == num_src_operands)
AddrOperandType>::src.isScalarRegister();
return false;
}
- bool isSrcOperand(int operandIndex)
+ bool isSrcOperand(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
return true;
}
- bool isDstOperand(int operandIndex) { return false; }
- int getOperandSize(int operandIndex)
+ bool isDstOperand(int operandIndex) override { return false; }
+ int getOperandSize(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex == num_src_operands)
AddrOperandType>::src.opSize();
return 0;
}
- int getRegisterIndex(int operandIndex)
+ int getRegisterIndex(int operandIndex) override
{
assert((operandIndex >= 0) && (operandIndex < getNumOperands()));
if (operandIndex == num_src_operands)
AddrOperandType>::src.regIndex();
return -1;
}
- int getNumOperands()
+ int getNumOperands() override
{
if (this->addr.isVectorRegister() || this->addr.isScalarRegister())
return num_src_operands + 1;
else
return num_src_operands;
}
- void execute(GPUDynInstPtr gpuDynInst);
+ void execute(GPUDynInstPtr gpuDynInst) override;
};
template<typename DataType, typename SrcDataType>
public MemInst
{
public:
- void generateDisassembly();
+ void generateDisassembly() override;
AtomicInst(const Brig::BrigInstBase *ib, const BrigObject *obj,
const char *_opcode)
}
- void execute(GPUDynInstPtr gpuDynInst);
+ void execute(GPUDynInstPtr gpuDynInst) override;
bool
isLocalMem() const override