Lines Matching refs:fp
76 static void dump_header(FILE *fp, struct bifrost_header header, bool verbose)
78 fprintf(fp, "ds(%u) ", header.dependency_slot);
81 fprintf(fp, "osrb ");
83 fprintf(fp, "%s ", bi_flow_control_name(header.flow_control));
86 fprintf(fp, "inf_suppress ");
88 fprintf(fp, "nan_suppress ");
91 fprintf(fp, "ftz_dx11 ");
93 fprintf(fp, "ftz_hsa ");
95 fprintf(fp, "ftz_au ");
101 fprintf(fp, "fpe_ts ");
103 fprintf(fp, "fpe_pd ");
105 fprintf(fp, "fpe_psqr ");
108 fprintf(fp, "%s ", bi_message_type_name(header.message_type));
111 fprintf(fp, "td ");
114 fprintf(fp, "ncph ");
117 fprintf(fp, "next_%s ", bi_message_type_name(header.next_message_type));
119 fprintf(fp, "dwb(");
124 fprintf(fp, ", ");
126 fprintf(fp, "%u", i);
130 fprintf(fp, ") ");
133 fprintf(fp, "\n");
136 static struct bifrost_reg_ctrl DecodeRegCtrl(FILE *fp, struct bifrost_regs regs, bool first)
162 static void dump_regs(FILE *fp, struct bifrost_regs srcs, bool first)
164 struct bifrost_reg_ctrl ctrl = DecodeRegCtrl(fp, srcs, first);
165 fprintf(fp, " # ");
167 fprintf(fp, "slot 0: r%u ", get_reg0(srcs));
169 fprintf(fp, "slot 1: r%u ", get_reg1(srcs));
174 fprintf(fp, "slot 2: r%u (write FMA) ", srcs.reg2);
176 fprintf(fp, "slot 2: r%u (write lo FMA) ", srcs.reg2);
178 fprintf(fp, "slot 2: r%u (write hi FMA) ", srcs.reg2);
180 fprintf(fp, "slot 2: r%u (read) ", srcs.reg2);
183 fprintf(fp, "slot 3: r%u (write %s) ", srcs.reg3, slot3_fma);
185 fprintf(fp, "slot 3: r%u (write lo %s) ", srcs.reg3, slot3_fma);
187 fprintf(fp, "slot 3: r%u (write hi %s) ", srcs.reg3, slot3_fma);
190 fprintf(fp, "fau %X ", srcs.fau_idx);
192 fprintf(fp, "\n");
196 bi_disasm_dest_mask(FILE *fp, enum bifrost_reg_op op)
199 fprintf(fp, ".h0");
201 fprintf(fp, ".h1");
205 bi_disasm_dest_fma(FILE *fp, struct bifrost_regs *next_regs, bool last)
208 struct bifrost_reg_ctrl ctrl = DecodeRegCtrl(fp, *next_regs, last);
210 fprintf(fp, "r%u:t0", next_regs->reg2);
211 bi_disasm_dest_mask(fp, ctrl.slot23.slot2);
213 fprintf(fp, "r%u:t0", next_regs->reg3);
214 bi_disasm_dest_mask(fp, ctrl.slot23.slot3);
216 fprintf(fp, "t0");
220 bi_disasm_dest_add(FILE *fp, struct bifrost_regs *next_regs, bool last)
223 struct bifrost_reg_ctrl ctrl = DecodeRegCtrl(fp, *next_regs, last);
226 fprintf(fp, "r%u:t1", next_regs->reg3);
227 bi_disasm_dest_mask(fp, ctrl.slot23.slot3);
229 fprintf(fp, "t1");
232 static void dump_const_imm(FILE *fp, uint32_t imm)
239 fprintf(fp, "0x%08x /* %f */", imm, fi.f);
243 dump_pc_imm(FILE *fp, uint64_t imm, unsigned branch_offset, enum bi_constmod mod, bool high32)
246 dump_const_imm(fp, imm);
279 fprintf(fp, "clause_%" PRId64, branch_offset + (offs / 16));
282 fprintf(fp, " >> 32");
287 fprintf(fp, " /* XXX: likely an infinite loop */");
304 static void dump_fau_src(FILE *fp, struct bifrost_regs srcs, unsigned branch_offset, struct bi_constants *consts, bool high32)
308 fprintf(fp, "u%u.w%u", uniform, high32);
314 dump_pc_imm(fp, imm, branch_offset, consts->mods[idx], high32);
316 dump_const_imm(fp, imm >> 32);
318 dump_const_imm(fp, imm);
322 fprintf(fp, "#0");
325 fprintf(fp, "lane_id");
328 fprintf(fp, "warp_id");
331 fprintf(fp, "core_id");
334 fprintf(fp, "framebuffer_size");
337 fprintf(fp, "atest_datum");
340 fprintf(fp, "sample");
350 fprintf(fp, "blend_descriptor_%u", (unsigned) srcs.fau_idx - 8);
353 fprintf(fp, "XXX - reserved%u", (unsigned) srcs.fau_idx);
358 fprintf(fp, ".y");
360 fprintf(fp, ".x");
365 dump_src(FILE *fp, unsigned src, struct bifrost_regs srcs, unsigned branch_offset, struct bi_constants *consts, bool isFMA)
369 fprintf(fp, "r%u", get_reg0(srcs));
372 fprintf(fp, "r%u", get_reg1(srcs));
375 fprintf(fp, "r%u", srcs.reg2);
379 fprintf(fp, "#0");
381 fprintf(fp, "t"); // i.e. the output of FMA this cycle
384 dump_fau_src(fp, srcs, branch_offset, consts, false);
387 dump_fau_src(fp, srcs, branch_offset, consts, true);
390 fprintf(fp, "t0");
393 fprintf(fp, "t1");
441 static void dump_clause(FILE *fp, uint32_t *words, unsigned *size, unsigned offset, bool verbose)
453 fprintf(fp, "# ");
455 fprintf(fp, "%08x ", words[3 - j]); // low bit on the right
456 fprintf(fp, "\n");
476 fprintf(fp, "# tag: 0x%02x\n", tag);
643 fprintf(fp, "# header: %012" PRIx64 "\n", header_bits);
648 dump_header(fp, header, verbose);
650 fprintf(fp, "{\n");
664 fprintf(fp, " # regs: %016" PRIx64 "\n", instrs[i].reg_bits);
665 dump_regs(fp, regs, i == 0);
668 bi_disasm_fma(fp, instrs[i].fma_bits, ®s, &next_regs,
672 bi_disasm_add(fp, instrs[i].add_bits, ®s, &next_regs,
676 fprintf(fp, "}\n");
680 fprintf(fp, "# const%d: %08" PRIx64 "\n", 2 * i, consts.raw[i] & 0xffffffff);
681 fprintf(fp, "# const%d: %08" PRIx64 "\n", 2 * i + 1, consts.raw[i] >> 32);
685 fprintf(fp, "\n");
689 void disassemble_bifrost(FILE *fp, uint8_t *code, size_t size, bool verbose)
701 fprintf(fp, "clause_%u:\n", offset);
704 dump_clause(fp, words, &size, offset, verbose);