int eg_bytecode_gds_build(struct r600_bytecode *bc, struct r600_bytecode_gds *gds, unsigned id)
{
- unsigned opcode = r600_isa_fetch_opcode(bc->isa->hw_class, gds->op) >> 8;
+ unsigned gds_op = (r600_isa_fetch_opcode(bc->isa->hw_class, gds->op) >> 8) & 0x3f;
+ unsigned opcode;
+ if (gds->op == FETCH_OP_TF_WRITE)
+ opcode = 5;
+ else
+ opcode = 4;
bc->bytecode[id++] = S_SQ_MEM_GDS_WORD0_MEM_INST(2) |
S_SQ_MEM_GDS_WORD0_MEM_OP(opcode) |
S_SQ_MEM_GDS_WORD0_SRC_GPR(gds->src_gpr) |
bc->bytecode[id++] = S_SQ_MEM_GDS_WORD1_DST_GPR(gds->dst_gpr) |
S_SQ_MEM_GDS_WORD1_DST_REL(gds->dst_rel) |
- S_SQ_MEM_GDS_WORD1_GDS_OP(gds->gds_op) |
- S_SQ_MEM_GDS_WORD1_SRC_GPR(gds->src_gpr2);
+ S_SQ_MEM_GDS_WORD1_GDS_OP(gds_op) |
+ S_SQ_MEM_GDS_WORD1_SRC_GPR(gds->src_gpr2) |
+ S_SQ_MEM_GDS_WORD1_UAV_INDEX_MODE(gds->uav_index_mode) |
+ S_SQ_MEM_GDS_WORD1_UAV_ID(gds->uav_id) |
+ S_SQ_MEM_GDS_WORD1_ALLOC_CONSUME(gds->alloc_consume) |
+ S_SQ_MEM_GDS_WORD1_BCAST_FIRST_REQ(gds->bcast_first_req);
bc->bytecode[id++] = S_SQ_MEM_GDS_WORD2_DST_SEL_X(gds->dst_sel_x) |
S_SQ_MEM_GDS_WORD2_DST_SEL_Y(gds->dst_sel_y) |
return -ENOMEM;
memcpy(ngds, gds, sizeof(struct r600_bytecode_gds));
+ if (bc->chip_class >= EVERGREEN) {
+ if (gds->uav_index_mode)
+ egcm_load_index_reg(bc, gds->uav_index_mode - 1, false);
+ }
+
if (bc->cf_last == NULL ||
bc->cf_last->op != CF_OP_GDS ||
bc->force_add_cf) {
if (gds->op != FETCH_OP_TF_WRITE) {
o += fprintf(stderr, ", R%d.", gds->src_gpr2);
}
+ if (gds->alloc_consume) {
+ o += fprintf(stderr, " UAV: %d", gds->uav_id);
+ if (gds->uav_index_mode)
+ o += fprintf(stderr, "[%s]", index_mode[gds->uav_index_mode]);
+ }
fprintf(stderr, "\n");
id += 4;
}
struct r600_bytecode_gds {
struct list_head list;
unsigned op;
- unsigned gds_op;
unsigned src_gpr;
unsigned src_rel;
unsigned src_sel_x;
unsigned dst_sel_y;
unsigned dst_sel_z;
unsigned dst_sel_w;
+ unsigned uav_index_mode;
+ unsigned uav_id;
+ unsigned alloc_consume;
+ unsigned bcast_first_req;
};
struct r600_bytecode_output {