diff options
author | Brandon Potter <brandon.potter@amd.com> | 2016-12-02 18:01:52 -0500 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2016-12-02 18:01:52 -0500 |
commit | 3bb3db6194bae29f03dfa40f589ff024232ee96c (patch) | |
tree | 724a55ff07962b64299b65609b8563cde0d06bcd /src/arch | |
parent | 69c2d86d68456616e7b4bfeacc794175a26d5bba (diff) | |
download | gem5-3bb3db6194bae29f03dfa40f589ff024232ee96c.tar.xz |
hsail: add a wavesize case statement to register operand code
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/hsail/operand.cc | 78 |
1 files changed, 43 insertions, 35 deletions
diff --git a/src/arch/hsail/operand.cc b/src/arch/hsail/operand.cc index d0e6c5541..747382a33 100644 --- a/src/arch/hsail/operand.cc +++ b/src/arch/hsail/operand.cc @@ -224,43 +224,51 @@ findRegDataType(unsigned opOffset, const BrigObject *obj) } break; + case BRIG_KIND_OPERAND_WAVESIZE: + { + BrigRegisterKind reg_kind = BRIG_REGISTER_KIND_DOUBLE; + return BrigRegOperandInfo((BrigKind16_t)baseOp->kind, reg_kind); + } + case BRIG_KIND_OPERAND_OPERAND_LIST: { - const BrigOperandOperandList *op = - (BrigOperandOperandList*)baseOp; - const BrigData *data_p = (BrigData*)obj->getData(op->elements); - - - int num_operands = 0; - BrigRegisterKind reg_kind = (BrigRegisterKind)0; - for (int offset = 0; offset < data_p->byteCount; offset += 4) { - const BrigOperand *op_p = (const BrigOperand *) - obj->getOperand(((int *)data_p->bytes)[offset/4]); - - if (op_p->kind == BRIG_KIND_OPERAND_REGISTER) { - const BrigOperandRegister *brigRegOp = - (const BrigOperandRegister*)op_p; - reg_kind = (BrigRegisterKind)brigRegOp->regKind; - } else if (op_p->kind == BRIG_KIND_OPERAND_CONSTANT_BYTES) { - uint16_t num_bytes = - ((Brig::BrigOperandConstantBytes*)op_p)->base.byteCount - - sizeof(BrigBase); - if (num_bytes == sizeof(uint32_t)) { - reg_kind = BRIG_REGISTER_KIND_SINGLE; - } else if (num_bytes == sizeof(uint64_t)) { - reg_kind = BRIG_REGISTER_KIND_DOUBLE; - } else { - fatal("OperandList: bad operand size %d\n", num_bytes); - } - } else { - fatal("OperandList: bad operand kind %d\n", op_p->kind); - } - - num_operands++; - } - assert(baseOp->kind == BRIG_KIND_OPERAND_OPERAND_LIST); - - return BrigRegOperandInfo((BrigKind16_t)baseOp->kind, reg_kind); + const BrigOperandOperandList *op = + (BrigOperandOperandList*)baseOp; + const BrigData *data_p = (BrigData*)obj->getData(op->elements); + + + int num_operands = 0; + BrigRegisterKind reg_kind = (BrigRegisterKind)0; + for (int offset = 0; offset < data_p->byteCount; offset += 4) { + const BrigOperand *op_p = (const BrigOperand *) + obj->getOperand(((int *)data_p->bytes)[offset/4]); + + if (op_p->kind == BRIG_KIND_OPERAND_REGISTER) { + const BrigOperandRegister *brigRegOp = + (const BrigOperandRegister*)op_p; + reg_kind = (BrigRegisterKind)brigRegOp->regKind; + } else if (op_p->kind == BRIG_KIND_OPERAND_CONSTANT_BYTES) { + uint16_t num_bytes = + ((Brig::BrigOperandConstantBytes*)op_p)->base.byteCount + - sizeof(BrigBase); + if (num_bytes == sizeof(uint32_t)) { + reg_kind = BRIG_REGISTER_KIND_SINGLE; + } else if (num_bytes == sizeof(uint64_t)) { + reg_kind = BRIG_REGISTER_KIND_DOUBLE; + } else { + fatal("OperandList: bad operand size %d\n", num_bytes); + } + } else if (op_p->kind == BRIG_KIND_OPERAND_WAVESIZE) { + reg_kind = BRIG_REGISTER_KIND_DOUBLE; + } else { + fatal("OperandList: bad operand kind %d\n", op_p->kind); + } + + num_operands++; + } + assert(baseOp->kind == BRIG_KIND_OPERAND_OPERAND_LIST); + + return BrigRegOperandInfo((BrigKind16_t)baseOp->kind, reg_kind); } break; |