diff --git a/src/imagination/rogue/rogue_backend_instrs.def b/src/imagination/rogue/rogue_backend_instrs.def index 011c320be4c..cd82279d693 100644 --- a/src/imagination/rogue/rogue_backend_instrs.def +++ b/src/imagination/rogue/rogue_backend_instrs.def @@ -53,6 +53,10 @@ #define ROGUE_BUILDER_DEFINE_BACKEND14(...) #endif /* ROGUE_BUILDER_DEFINE_BACKEND14 */ +#ifndef ROGUE_BUILDER_DEFINE_BACKEND06 +#define ROGUE_BUILDER_DEFINE_BACKEND06(...) +#endif /* ROGUE_BUILDER_DEFINE_BACKEND06 */ + #ifndef ROGUE_BUILDER_DEFINE_BACKEND16 #define ROGUE_BUILDER_DEFINE_BACKEND16(...) #endif /* ROGUE_BUILDER_DEFINE_BACKEND16 */ @@ -62,21 +66,24 @@ ROGUE_BUILDER_DEFINE_BACKEND00(UVSW_ENDTASK) ROGUE_BUILDER_DEFINE_BACKEND00(UVSW_EMITTHENENDTASK) ROGUE_BUILDER_DEFINE_BACKEND02(EMITPIX) +ROGUE_BUILDER_DEFINE_BACKEND02(IDF) ROGUE_BUILDER_DEFINE_BACKEND11(UVSW_WRITE) ROGUE_BUILDER_DEFINE_BACKEND11(UVSW_WRITETHENEMITTHENENDTASK) -ROGUE_BUILDER_DEFINE_BACKEND11(IDF) ROGUE_BUILDER_DEFINE_BACKEND13(LD) ROGUE_BUILDER_DEFINE_BACKEND13(FITR_PIXEL) ROGUE_BUILDER_DEFINE_BACKEND14(FITRP_PIXEL) +ROGUE_BUILDER_DEFINE_BACKEND06(ST) + ROGUE_BUILDER_DEFINE_BACKEND16(SMP1D) ROGUE_BUILDER_DEFINE_BACKEND16(SMP2D) ROGUE_BUILDER_DEFINE_BACKEND16(SMP3D) #undef ROGUE_BUILDER_DEFINE_BACKEND16 +#undef ROGUE_BUILDER_DEFINE_BACKEND06 #undef ROGUE_BUILDER_DEFINE_BACKEND14 #undef ROGUE_BUILDER_DEFINE_BACKEND13 #undef ROGUE_BUILDER_DEFINE_BACKEND11 diff --git a/src/imagination/rogue/rogue_builder.c b/src/imagination/rogue/rogue_builder.c index 63f1ba1a4d5..27eee2acc58 100644 --- a/src/imagination/rogue/rogue_builder.c +++ b/src/imagination/rogue/rogue_builder.c @@ -320,6 +320,20 @@ rogue_build_backend14(rogue_builder *b, return rogue_build_backend(b, op, 1, dsts, 4, srcs); } +static inline rogue_backend_instr * +rogue_build_backend06(rogue_builder *b, + enum rogue_backend_op op, + rogue_ref src0, + rogue_ref src1, + rogue_ref src2, + rogue_ref src3, + rogue_ref src4, + rogue_ref src5) +{ + rogue_ref srcs[] = { src0, src1, src2, src3, src4, src5 }; + return rogue_build_backend(b, op, 0, NULL, 6, srcs); +} + static inline rogue_backend_instr * rogue_build_backend16(rogue_builder *b, enum rogue_backend_op op, @@ -405,6 +419,28 @@ rogue_build_backend16(rogue_builder *b, src3); \ } +#define ROGUE_BUILDER_DEFINE_BACKEND06(op) \ + PUBLIC \ + rogue_backend_instr *rogue_##op(rogue_builder *b, \ + rogue_ref src0, \ + rogue_ref src1, \ + rogue_ref src2, \ + rogue_ref src3, \ + rogue_ref src4, \ + rogue_ref src5) \ + { \ + assert(rogue_backend_op_infos[ROGUE_BACKEND_OP_##op].num_dsts == 0); \ + assert(rogue_backend_op_infos[ROGUE_BACKEND_OP_##op].num_srcs == 6); \ + return rogue_build_backend06(b, \ + ROGUE_BACKEND_OP_##op, \ + src0, \ + src1, \ + src2, \ + src3, \ + src4, \ + src5); \ + } + #define ROGUE_BUILDER_DEFINE_BACKEND16(op) \ PUBLIC \ rogue_backend_instr *rogue_##op(rogue_builder *b, \ diff --git a/src/imagination/rogue/rogue_builder.h b/src/imagination/rogue/rogue_builder.h index eb8b0425a77..9517f9ee9f8 100644 --- a/src/imagination/rogue/rogue_builder.h +++ b/src/imagination/rogue/rogue_builder.h @@ -166,6 +166,15 @@ static inline rogue_block *rogue_push_block(rogue_builder *b) rogue_ref src2, \ rogue_ref src3); +#define ROGUE_BUILDER_DEFINE_BACKEND06(op) \ + rogue_backend_instr *rogue_##op(rogue_builder *b, \ + rogue_ref src0, \ + rogue_ref src1, \ + rogue_ref src2, \ + rogue_ref src3, \ + rogue_ref src4, \ + rogue_ref src5); + #define ROGUE_BUILDER_DEFINE_BACKEND16(op) \ rogue_backend_instr *rogue_##op(rogue_builder *b, \ rogue_ref dst0, \ diff --git a/src/imagination/rogue/rogue_encode.c b/src/imagination/rogue/rogue_encode.c index d610e0fefb9..b56f3301368 100644 --- a/src/imagination/rogue/rogue_encode.c +++ b/src/imagination/rogue/rogue_encode.c @@ -597,7 +597,7 @@ static void rogue_encode_backend_instr(const rogue_backend_instr *backend, instr_encoding->backend.op = BACKENDOP_DMA; instr_encoding->backend.dma.dmaop = DMAOP_ST; instr_encoding->backend.dma.st.drc = - rogue_ref_get_drc_index(&backend->src[1].ref); + rogue_ref_get_drc_index(&backend->src[2].ref); bool imm_burstlen = rogue_ref_is_val(&backend->src[3].ref); @@ -752,9 +752,9 @@ static void rogue_encode_backend_instr(const rogue_backend_instr *backend, instr_encoding->backend.op = BACKENDOP_DMA; instr_encoding->backend.dma.dmaop = DMAOP_IDF; instr_encoding->backend.dma.idf.drc = - rogue_ref_get_drc_index(&backend->dst[0].ref); + rogue_ref_get_drc_index(&backend->src[0].ref); instr_encoding->backend.dma.idf.srcseladd = - rogue_ref_get_io_src_index(&backend->src[0].ref); + rogue_ref_get_io_src_index(&backend->src[1].ref); break; case ROGUE_BACKEND_OP_EMITPIX: diff --git a/src/imagination/rogue/rogue_info.c b/src/imagination/rogue/rogue_info.c index 23853fa59df..ee7fab7e781 100644 --- a/src/imagination/rogue/rogue_info.c +++ b/src/imagination/rogue/rogue_info.c @@ -294,10 +294,12 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { .supported_dst_types = { [0] = T(REG), }, .supported_src_types = { [0] = T(REG), }, }, - [ROGUE_BACKEND_OP_IDF] = { .str = "idf", .num_dsts = 1, .num_srcs = 1, - .phase_io = { .src[0] = IO(S0), }, - .supported_dst_types = { [0] = T(DRC), }, - .supported_src_types = { [0] = T(REG), }, + [ROGUE_BACKEND_OP_IDF] = { .str = "idf", .num_srcs = 2, + .phase_io = { .src[1] = IO(S0), }, + .supported_src_types = { [0] = T(DRC), [1] = T(REGARRAY), }, + .src_stride = { + [1] = 1, + }, }, [ROGUE_BACKEND_OP_EMITPIX] = { .str = "emitpix", .num_srcs = 2, @@ -322,9 +324,9 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [2] = 1, }, }, - /* .src[0] and .src[3] can actually be S0-5. */ + /* .src[0] and .src[4] can actually be S0-5. */ [ROGUE_BACKEND_OP_ST] = { .str = "st", .num_srcs = 6, - .phase_io = { .src[0] = IO(S3), .src[3] = IO(S0), }, + .phase_io = { .src[0] = IO(S3), .src[4] = IO(S0), }, .supported_op_mods = OM(TILED) | OM(WRITETHROUGH) | OM(WRITEBACK) | OM(LAZYWRITEBACK) | OM(SLCBYPASS) | OM(SLCWRITEBACK) | OM(SLCWRITETHROUGH) | OM(SLCNOALLOC), .supported_src_types = { @@ -384,7 +386,7 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [1] = T(REGARRAY), [2] = T(REG) | T(REGARRAY), [3] = T(REGARRAY), - [4] = T(REG) | T(IO), + [4] = T(REGARRAY) | T(IO), [5] = T(VAL), }, /* TODO: This may depend on the other options set. */ @@ -392,6 +394,7 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [1] = 3, [2] = ~0U, [3] = 3, + [4] = 1, }, .dst_stride = { [0] = ~0U, @@ -411,7 +414,7 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [1] = T(REGARRAY), [2] = T(REG) | T(REGARRAY), [3] = T(REGARRAY), - [4] = T(REG) | T(IO), + [4] = T(REGARRAY) | T(IO), [5] = T(VAL), }, /* TODO: This may depend on the other options set. */ @@ -419,6 +422,7 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [1] = 3, [2] = ~0U, [3] = 3, + [4] = 1, }, .dst_stride = { [0] = ~0U, @@ -438,7 +442,7 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [1] = T(REGARRAY), [2] = T(REG) | T(REGARRAY), [3] = T(REGARRAY), - [4] = T(REG) | T(IO), + [4] = T(REGARRAY) | T(IO), [5] = T(VAL), }, /* TODO: This may depend on the other options set. */ @@ -446,6 +450,7 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { [1] = 3, [2] = ~0U, [3] = 3, + [4] = 1, }, .dst_stride = { [0] = ~0U,