36 #ifndef __ARCH_HSAIL_INSTS_BRANCH_HH__
37 #define __ARCH_HSAIL_INSTS_BRANCH_HH__
50 template<
typename TargetType>
73 return target.isVectorRegister();
77 return target.isCondRegister();
81 return target.isScalarRegister();
112 template<
typename TargetType>
116 std::string widthClause;
123 target.disassemble());
126 template<
typename TargetType>
132 if (getTargetPc() == w->
rpc()) {
136 w->
pc(getTargetPc());
165 template<
typename TargetType>
183 target.init(op_offs, obj);
193 return target.isVectorRegister();
200 return target.isCondRegister();
207 return target.isScalarRegister();
213 if (operandIndex == 0)
244 template<
typename TargetType>
248 std::string widthClause;
255 cond.disassemble(), target.disassemble());
258 template<
typename TargetType>
265 const uint32_t curr_rpc = w->
rpc();
275 const uint32_t rpc =
static_cast<uint32_t
>(ipdInstNum());
276 if (curr_rpc != rpc) {
281 const uint32_t true_pc = getTargetPc();
284 true_mask[lane] =
cond.get<
bool>(
w, lane) & curr_mask[lane];
288 const uint32_t false_pc = nextInstAddr();
289 assert(true_pc != false_pc);
290 if (false_pc != rpc && true_mask.count() < curr_mask.count()) {
291 VectorMask false_mask = curr_mask & ~true_mask;
295 if (true_pc != rpc && true_mask.count()) {
298 assert(w->
pc() != curr_pc);
334 template<
typename TargetType>
350 target.init(op_offs, obj);
358 return target.isVectorRegister();
362 return target.isCondRegister();
366 return target.isScalarRegister();
386 template<
typename TargetType>
390 std::string widthClause;
392 if (
width.bits != 1) {
397 target.disassemble());
400 template<
typename TargetType>
406 if (getTargetPc() == w->
rpc()) {
410 w->
pc(getTargetPc());
441 #endif // __ARCH_HSAIL_INSTS_BRANCH_HH__
uint32_t getTargetPc() override
BrnIndirectInst(const Brig::BrigInstBase *ib, const BrigObject *obj)
Defines classes encapsulating HSAIL instruction operands.
BrigDataOffsetOperandList32_t operands
bool isScalarRegister(int operandIndex) override
BrnInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj)
GPUStaticInst * decodeBrn(const Brig::BrigInstBase *ib, const BrigObject *obj)
CbrDirectInst(const Brig::BrigInstBase *ib, const BrigObject *obj)
std::bitset< std::numeric_limits< unsigned long long >::digits > VectorMask
bool isVectorRegister(int operandIndex) override
void pushToReconvergenceStack(uint32_t pc, uint32_t rpc, const VectorMask &exec_mask)
void execute(GPUDynInstPtr gpuDynInst) override
bool isCondRegister(int operandIndex) override
bool isSrcOperand(int operandIndex) override
BrnDirectInst(const Brig::BrigInstBase *ib, const BrigObject *obj)
uint32_t getTargetPc() override
CbrIndirectInst(const Brig::BrigInstBase *ib, const BrigObject *obj)
void generateDisassembly() override
GPUStaticInst * decodeBr(const Brig::BrigInstBase *ib, const BrigObject *obj)
ImmOperand< uint32_t > width
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
std::shared_ptr< GPUDynInst > GPUDynInstPtr
bool init(unsigned opOffset, const BrigObject *obj)
std::string csprintf(const char *format, const Args &...args)
int getNumOperands() override
int getNumOperands() override
bool isVectorRegister(int operandIndex) override
void execute(GPUDynInstPtr gpuDynInst) override
ComputeUnit * computeUnit
BrDirectInst(const Brig::BrigInstBase *ib, const BrigObject *obj)
bool isDstOperand(int operandIndex) override
void generateDisassembly() override
GPUStaticInst * decodeCbr(const Brig::BrigInstBase *ib, const BrigObject *obj)
int getOperandSize(int operandIndex) override
static const int NumArgumentRegs M5_VAR_USED
int getOperandSize(int operandIndex) override
unsigned getOperandPtr(int offs, int index) const
bool isDstOperand(int operandIndex) override
bool isSrcOperand(int operandIndex) override
bool isCondRegister(int operandIndex) override
VectorMask execMask() const
bool isCondRegister(int operandIndex) override
void generateDisassembly() override
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override
bool isDstOperand(int operandIndex) override
int getNumOperands() override
bool isScalarRegister(int operandIndex) override
Bitfield< 24, 21 > opcode
void popFromReconvergenceStack()
BrIndirectInst(const Brig::BrigInstBase *ib, const BrigObject *obj)
uint32_t getTargetPc() override
void execute(GPUDynInstPtr gpuDynInst) override
bool isSrcOperand(int operandIndex) override
CbrInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj)
bool isScalarRegister(int operandIndex) override
BrInstBase(const Brig::BrigInstBase *ib, const BrigObject *obj)
int getOperandSize(int operandIndex) override
bool init(unsigned opOffset, const BrigObject *obj)
bool isVectorRegister(int operandIndex) override
int getRegisterIndex(int operandIndex, GPUDynInstPtr gpuDynInst) override