From: Eric Anholt Date: Wed, 20 May 2020 20:16:41 +0000 (-0700) Subject: freedreno: Fix printing of unused src in disasm of cat6 RESINFO. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d4a911d8c3d9e3f218ea136179c4cbf9a91b07d;p=mesa.git freedreno: Fix printing of unused src in disasm of cat6 RESINFO. Compare to QC's disasm right next to ours, and we clearly had an extra src that wouldn't make sense. Part-of: --- diff --git a/src/freedreno/ir3/disasm-a3xx.c b/src/freedreno/ir3/disasm-a3xx.c index 82ecb7c4e49..3db422f0d6f 100644 --- a/src/freedreno/ir3/disasm-a3xx.c +++ b/src/freedreno/ir3/disasm-a3xx.c @@ -987,7 +987,8 @@ static void print_instr_cat6_a6xx(struct disasm_ctx *ctx, instr_t *instr) { instr_cat6_a6xx_t *cat6 = &instr->cat6_a6xx; struct reginfo src1, src2, ssbo; - bool uses_type = _OPC(6, cat6->opc) != OPC_LDC; + uint32_t opc = _OPC(6, cat6->opc); + bool uses_type = opc != OPC_LDC; static const struct { bool indirect; @@ -1049,10 +1050,13 @@ static void print_instr_cat6_a6xx(struct disasm_ctx *ctx, instr_t *instr) print_src(ctx, &src2); fprintf(ctx->out, ", "); - src1.reg = (reg_t)(cat6->src1); - src1.full = true; // XXX - print_src(ctx, &src1); - fprintf(ctx->out, ", "); + if (opc != OPC_RESINFO) { + src1.reg = (reg_t)(cat6->src1); + src1.full = true; // XXX + print_src(ctx, &src1); + fprintf(ctx->out, ", "); + } + ssbo.reg = (reg_t)(cat6->ssbo); ssbo.im = !indirect_ssbo; ssbo.full = true; diff --git a/src/freedreno/ir3/tests/disasm.c b/src/freedreno/ir3/tests/disasm.c index 3ab1e392cc6..ef43ac3673c 100644 --- a/src/freedreno/ir3/tests/disasm.c +++ b/src/freedreno/ir3/tests/disasm.c @@ -76,8 +76,8 @@ static const struct test { /* cat6 */ INSTR_6XX(c0c00000_00000000, "stg.f16 g[hr0.x], hr0.x, hr0.x"), INSTR_6XX(c1100000_c1000000, "stl.f16 l[0], hr0.x, hr48.y"), - INSTR_6XX(c0260000_0063c200, "resinfo.untyped.2d.u32.1.imm r0.x, r0.x, 0"), /* resinfo.u32.2d.mode0.base0 r0.x, 0 */ - INSTR_6XX(c0260000_0063c000, "resinfo.untyped.1d.u32.1.imm r0.x, r0.x, 0"), /* resinfo.u32.1d.mode0.base0 r0.x, 0 */ + INSTR_6XX(c0260000_0063c200, "resinfo.untyped.2d.u32.1.imm r0.x, 0"), /* resinfo.u32.2d.mode0.base0 r0.x, 0 */ + INSTR_6XX(c0260000_0063c000, "resinfo.untyped.1d.u32.1.imm r0.x, 0"), /* resinfo.u32.1d.mode0.base0 r0.x, 0 */ /* discard stuff */ INSTR_6XX(42b400f8_20010004, "cmps.s.eq p0.x, r1.x, 1"),