1 /*
2 * Copyright © 2010 Intel Corporation
3 * SPDX-License-Identifier: MIT
4 */
5
6 #include "brw_cfg.h"
7 #include "brw_disasm.h"
8 #include "brw_fs.h"
9 #include "brw_private.h"
10 #include "dev/intel_debug.h"
11 #include "util/half_float.h"
12
13 using namespace brw;
14
15 void
brw_print_instructions_to_file(const fs_visitor & s,FILE * file)16 brw_print_instructions_to_file(const fs_visitor &s, FILE *file)
17 {
18 if (s.cfg && s.grf_used == 0) {
19 const brw::def_analysis &defs = s.def_analysis.require();
20 const register_pressure *rp =
21 INTEL_DEBUG(DEBUG_REG_PRESSURE) ? &s.regpressure_analysis.require() : NULL;
22
23 unsigned ip = 0, max_pressure = 0;
24 unsigned cf_count = 0;
25 foreach_block(block, s.cfg) {
26 fprintf(file, "START B%d", block->num);
27 foreach_list_typed(bblock_link, link, link, &block->parents) {
28 fprintf(file, " <%cB%d",
29 link->kind == bblock_link_logical ? '-' : '~',
30 link->block->num);
31 }
32 fprintf(file, "\n");
33
34 foreach_inst_in_block(fs_inst, inst, block) {
35 if (inst->is_control_flow_end())
36 cf_count -= 1;
37
38 if (rp) {
39 max_pressure = MAX2(max_pressure, rp->regs_live_at_ip[ip]);
40 fprintf(file, "{%3d} ", rp->regs_live_at_ip[ip]);
41 }
42
43 for (unsigned i = 0; i < cf_count; i++)
44 fprintf(file, " ");
45 brw_print_instruction(s, inst, file, &defs);
46 ip++;
47
48 if (inst->is_control_flow_begin())
49 cf_count += 1;
50 }
51
52 fprintf(file, "END B%d", block->num);
53 foreach_list_typed(bblock_link, link, link, &block->children) {
54 fprintf(file, " %c>B%d",
55 link->kind == bblock_link_logical ? '-' : '~',
56 link->block->num);
57 }
58 fprintf(file, "\n");
59 }
60 if (rp)
61 fprintf(file, "Maximum %3d registers live at once.\n", max_pressure);
62 } else if (s.cfg && exec_list_is_empty(&s.instructions)) {
63 foreach_block_and_inst(block, fs_inst, inst, s.cfg) {
64 brw_print_instruction(s, inst, file);
65 }
66 } else {
67 foreach_in_list(fs_inst, inst, &s.instructions) {
68 brw_print_instruction(s, inst, file);
69 }
70 }
71 }
72
73 void
brw_print_instructions(const fs_visitor & s,const char * name)74 brw_print_instructions(const fs_visitor &s, const char *name)
75 {
76 FILE *file = stderr;
77 if (name && __normal_user()) {
78 file = fopen(name, "w");
79 if (!file)
80 file = stderr;
81 }
82
83 brw_print_instructions_to_file(s, file);
84
85 if (file != stderr) {
86 fclose(file);
87 }
88 }
89
90 static const char *
brw_instruction_name(const struct brw_isa_info * isa,enum opcode op)91 brw_instruction_name(const struct brw_isa_info *isa, enum opcode op)
92 {
93 const struct intel_device_info *devinfo = isa->devinfo;
94
95 switch (op) {
96 case 0 ... NUM_BRW_OPCODES - 1:
97 /* The DO instruction doesn't exist on Gfx9+, but we use it to mark the
98 * start of a loop in the IR.
99 */
100 if (op == BRW_OPCODE_DO)
101 return "do";
102
103 /* DPAS instructions may transiently exist on platforms that do not
104 * support DPAS. They will eventually be lowered, but in the meantime it
105 * must be possible to query the instruction name.
106 */
107 if (devinfo->verx10 < 125 && op == BRW_OPCODE_DPAS)
108 return "dpas";
109
110 assert(brw_opcode_desc(isa, op)->name);
111 return brw_opcode_desc(isa, op)->name;
112 case FS_OPCODE_FB_WRITE_LOGICAL:
113 return "fb_write_logical";
114 case FS_OPCODE_FB_READ_LOGICAL:
115 return "fb_read_logical";
116
117 case SHADER_OPCODE_RCP:
118 return "rcp";
119 case SHADER_OPCODE_RSQ:
120 return "rsq";
121 case SHADER_OPCODE_SQRT:
122 return "sqrt";
123 case SHADER_OPCODE_EXP2:
124 return "exp2";
125 case SHADER_OPCODE_LOG2:
126 return "log2";
127 case SHADER_OPCODE_POW:
128 return "pow";
129 case SHADER_OPCODE_INT_QUOTIENT:
130 return "int_quot";
131 case SHADER_OPCODE_INT_REMAINDER:
132 return "int_rem";
133 case SHADER_OPCODE_SIN:
134 return "sin";
135 case SHADER_OPCODE_COS:
136 return "cos";
137
138 case SHADER_OPCODE_SEND:
139 return "send";
140
141 case SHADER_OPCODE_UNDEF:
142 return "undef";
143
144 case SHADER_OPCODE_TEX_LOGICAL:
145 return "tex_logical";
146 case SHADER_OPCODE_TXD_LOGICAL:
147 return "txd_logical";
148 case SHADER_OPCODE_TXF_LOGICAL:
149 return "txf_logical";
150 case SHADER_OPCODE_TXL_LOGICAL:
151 return "txl_logical";
152 case SHADER_OPCODE_TXS_LOGICAL:
153 return "txs_logical";
154 case FS_OPCODE_TXB_LOGICAL:
155 return "txb_logical";
156 case SHADER_OPCODE_TXF_CMS_W_LOGICAL:
157 return "txf_cms_w_logical";
158 case SHADER_OPCODE_TXF_CMS_W_GFX12_LOGICAL:
159 return "txf_cms_w_gfx12_logical";
160 case SHADER_OPCODE_TXF_MCS_LOGICAL:
161 return "txf_mcs_logical";
162 case SHADER_OPCODE_LOD_LOGICAL:
163 return "lod_logical";
164 case SHADER_OPCODE_TG4_LOGICAL:
165 return "tg4_logical";
166 case SHADER_OPCODE_TG4_OFFSET_LOGICAL:
167 return "tg4_offset_logical";
168 case SHADER_OPCODE_TG4_OFFSET_LOD_LOGICAL:
169 return "tg4_offset_lod_logical";
170 case SHADER_OPCODE_TG4_OFFSET_BIAS_LOGICAL:
171 return "tg4_offset_bias_logical";
172 case SHADER_OPCODE_TG4_BIAS_LOGICAL:
173 return "tg4_b_logical";
174 case SHADER_OPCODE_TG4_EXPLICIT_LOD_LOGICAL:
175 return "tg4_l_logical";
176 case SHADER_OPCODE_TG4_IMPLICIT_LOD_LOGICAL:
177 return "tg4_i_logical";
178 case SHADER_OPCODE_SAMPLEINFO_LOGICAL:
179 return "sampleinfo_logical";
180
181 case SHADER_OPCODE_IMAGE_SIZE_LOGICAL:
182 return "image_size_logical";
183
184 case SHADER_OPCODE_MEMORY_FENCE:
185 return "memory_fence";
186 case FS_OPCODE_SCHEDULING_FENCE:
187 return "scheduling_fence";
188 case SHADER_OPCODE_INTERLOCK:
189 /* For an interlock we actually issue a memory fence via sendc. */
190 return "interlock";
191
192 case SHADER_OPCODE_LOAD_PAYLOAD:
193 return "load_payload";
194 case FS_OPCODE_PACK:
195 return "pack";
196
197 case SHADER_OPCODE_SCRATCH_HEADER:
198 return "scratch_header";
199
200 case SHADER_OPCODE_URB_WRITE_LOGICAL:
201 return "urb_write_logical";
202 case SHADER_OPCODE_URB_READ_LOGICAL:
203 return "urb_read_logical";
204
205 case SHADER_OPCODE_FIND_LIVE_CHANNEL:
206 return "find_live_channel";
207 case SHADER_OPCODE_FIND_LAST_LIVE_CHANNEL:
208 return "find_last_live_channel";
209 case SHADER_OPCODE_LOAD_LIVE_CHANNELS:
210 return "load_live_channels";
211 case FS_OPCODE_LOAD_LIVE_CHANNELS:
212 return "fs_load_live_channels";
213
214 case SHADER_OPCODE_BROADCAST:
215 return "broadcast";
216 case SHADER_OPCODE_SHUFFLE:
217 return "shuffle";
218 case SHADER_OPCODE_SEL_EXEC:
219 return "sel_exec";
220 case SHADER_OPCODE_QUAD_SWIZZLE:
221 return "quad_swizzle";
222 case SHADER_OPCODE_CLUSTER_BROADCAST:
223 return "cluster_broadcast";
224
225 case SHADER_OPCODE_GET_BUFFER_SIZE:
226 return "get_buffer_size";
227
228 case FS_OPCODE_DDX_COARSE:
229 return "ddx_coarse";
230 case FS_OPCODE_DDX_FINE:
231 return "ddx_fine";
232 case FS_OPCODE_DDY_COARSE:
233 return "ddy_coarse";
234 case FS_OPCODE_DDY_FINE:
235 return "ddy_fine";
236
237 case FS_OPCODE_PIXEL_X:
238 return "pixel_x";
239 case FS_OPCODE_PIXEL_Y:
240 return "pixel_y";
241
242 case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD:
243 return "uniform_pull_const";
244 case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_LOGICAL:
245 return "varying_pull_const_logical";
246
247 case FS_OPCODE_PACK_HALF_2x16_SPLIT:
248 return "pack_half_2x16_split";
249
250 case SHADER_OPCODE_HALT_TARGET:
251 return "halt_target";
252
253 case FS_OPCODE_INTERPOLATE_AT_SAMPLE:
254 return "interp_sample";
255 case FS_OPCODE_INTERPOLATE_AT_SHARED_OFFSET:
256 return "interp_shared_offset";
257 case FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET:
258 return "interp_per_slot_offset";
259
260 case SHADER_OPCODE_BARRIER:
261 return "barrier";
262 case SHADER_OPCODE_MULH:
263 return "mulh";
264 case SHADER_OPCODE_ISUB_SAT:
265 return "isub_sat";
266 case SHADER_OPCODE_USUB_SAT:
267 return "usub_sat";
268 case SHADER_OPCODE_MOV_INDIRECT:
269 return "mov_indirect";
270 case SHADER_OPCODE_MOV_RELOC_IMM:
271 return "mov_reloc_imm";
272
273 case RT_OPCODE_TRACE_RAY_LOGICAL:
274 return "rt_trace_ray_logical";
275
276 case SHADER_OPCODE_RND_MODE:
277 return "rnd_mode";
278 case SHADER_OPCODE_FLOAT_CONTROL_MODE:
279 return "float_control_mode";
280 case SHADER_OPCODE_BTD_SPAWN_LOGICAL:
281 return "btd_spawn_logical";
282 case SHADER_OPCODE_BTD_RETIRE_LOGICAL:
283 return "btd_retire_logical";
284 case SHADER_OPCODE_READ_ARCH_REG:
285 return "read_arch_reg";
286 case SHADER_OPCODE_LOAD_SUBGROUP_INVOCATION:
287 return "load_subgroup_invocation";
288 case SHADER_OPCODE_MEMORY_LOAD_LOGICAL:
289 return "memory_load";
290 case SHADER_OPCODE_MEMORY_STORE_LOGICAL:
291 return "memory_store";
292 case SHADER_OPCODE_MEMORY_ATOMIC_LOGICAL:
293 return "memory_atomic";
294 }
295
296 unreachable("not reached");
297 }
298
299 /**
300 * Pretty-print a source for a SHADER_OPCODE_MEMORY_LOGICAL instruction.
301 *
302 * Returns true if the value is fully printed (i.e. an enum) and false if
303 * we only printed a label, and the actual source value still needs printing.
304 */
305 static bool
print_memory_logical_source(FILE * file,const fs_inst * inst,unsigned i)306 print_memory_logical_source(FILE *file, const fs_inst *inst, unsigned i)
307 {
308 if (inst->is_control_source(i)) {
309 assert(inst->src[i].file == IMM && inst->src[i].type == BRW_TYPE_UD);
310 assert(!inst->src[i].negate);
311 assert(!inst->src[i].abs);
312 }
313
314 switch (i) {
315 case MEMORY_LOGICAL_OPCODE:
316 fprintf(file, " %s", brw_lsc_op_to_string(inst->src[i].ud));
317 return true;
318 case MEMORY_LOGICAL_MODE: {
319 static const char *modes[] = {
320 [MEMORY_MODE_TYPED] = "typed",
321 [MEMORY_MODE_UNTYPED] = "untyped",
322 [MEMORY_MODE_SHARED_LOCAL] = "shared",
323 [MEMORY_MODE_SCRATCH] = "scratch",
324 };
325 assert(inst->src[i].ud < ARRAY_SIZE(modes));
326 fprintf(file, " %s", modes[inst->src[i].ud]);
327 return true;
328 }
329 case MEMORY_LOGICAL_BINDING_TYPE:
330 fprintf(file, " %s", brw_lsc_addr_surftype_to_string(inst->src[i].ud));
331 if (inst->src[i].ud != LSC_ADDR_SURFTYPE_FLAT)
332 fprintf(file, ":");
333 return true;
334 case MEMORY_LOGICAL_BINDING:
335 return inst->src[i].file == BAD_FILE;
336 case MEMORY_LOGICAL_ADDRESS:
337 fprintf(file, " addr: ");
338 return false;
339 case MEMORY_LOGICAL_COORD_COMPONENTS:
340 fprintf(file, " coord_comps:");
341 return false;
342 case MEMORY_LOGICAL_ALIGNMENT:
343 fprintf(file, " align:");
344 return false;
345 case MEMORY_LOGICAL_DATA_SIZE:
346 fprintf(file, " %s", brw_lsc_data_size_to_string(inst->src[i].ud));
347 return true;
348 case MEMORY_LOGICAL_COMPONENTS:
349 fprintf(file, " comps:");
350 return false;
351 case MEMORY_LOGICAL_FLAGS:
352 if (inst->src[i].ud & MEMORY_FLAG_TRANSPOSE)
353 fprintf(file, " transpose");
354 if (inst->src[i].ud & MEMORY_FLAG_INCLUDE_HELPERS)
355 fprintf(file, " helpers");
356 return true;
357 case MEMORY_LOGICAL_DATA0:
358 fprintf(file, " data0: ");
359 return false;
360 case MEMORY_LOGICAL_DATA1:
361 if (inst->src[i].file == BAD_FILE)
362 return true;
363 fprintf(file, " data1: ");
364 return false;
365 default:
366 unreachable("invalid source");
367 }
368 }
369
370 void
brw_print_instruction_to_file(const fs_visitor & s,const fs_inst * inst,FILE * file,const brw::def_analysis * defs)371 brw_print_instruction_to_file(const fs_visitor &s, const fs_inst *inst, FILE *file, const brw::def_analysis *defs)
372 {
373 if (inst->predicate) {
374 fprintf(file, "(%cf%d.%d) ",
375 inst->predicate_inverse ? '-' : '+',
376 inst->flag_subreg / 2,
377 inst->flag_subreg % 2);
378 }
379
380 fprintf(file, "%s", brw_instruction_name(&s.compiler->isa, inst->opcode));
381 if (inst->saturate)
382 fprintf(file, ".sat");
383 if (inst->conditional_mod) {
384 fprintf(file, "%s", conditional_modifier[inst->conditional_mod]);
385 if (!inst->predicate &&
386 (inst->opcode != BRW_OPCODE_SEL &&
387 inst->opcode != BRW_OPCODE_CSEL &&
388 inst->opcode != BRW_OPCODE_IF &&
389 inst->opcode != BRW_OPCODE_WHILE)) {
390 fprintf(file, ".f%d.%d", inst->flag_subreg / 2,
391 inst->flag_subreg % 2);
392 }
393 }
394 fprintf(file, "(%d) ", inst->exec_size);
395
396 if (inst->mlen) {
397 fprintf(file, "(mlen: %d) ", inst->mlen);
398 }
399
400 if (inst->ex_mlen) {
401 fprintf(file, "(ex_mlen: %d) ", inst->ex_mlen);
402 }
403
404 if (inst->eot) {
405 fprintf(file, "(EOT) ");
406 }
407
408 switch (inst->dst.file) {
409 case VGRF:
410 if (defs && defs->get(inst->dst))
411 fprintf(file, "%%%d", inst->dst.nr);
412 else
413 fprintf(file, "v%d", inst->dst.nr);
414 break;
415 case FIXED_GRF:
416 fprintf(file, "g%d", inst->dst.nr);
417 if (inst->dst.subnr != 0)
418 fprintf(file, ".%d", inst->dst.subnr / brw_type_size_bytes(inst->dst.type));
419 break;
420 case BAD_FILE:
421 fprintf(file, "(null)");
422 break;
423 case UNIFORM:
424 fprintf(file, "***u%d***", inst->dst.nr);
425 break;
426 case ATTR:
427 fprintf(file, "***attr%d***", inst->dst.nr);
428 break;
429 case ARF:
430 switch (inst->dst.nr & 0xF0) {
431 case BRW_ARF_NULL:
432 fprintf(file, "null");
433 break;
434 case BRW_ARF_ADDRESS:
435 fprintf(file, "a0.%d", inst->dst.subnr);
436 break;
437 case BRW_ARF_ACCUMULATOR:
438 if (inst->dst.subnr == 0)
439 fprintf(file, "acc%d", inst->dst.nr & 0x0F);
440 else
441 fprintf(file, "acc%d.%d", inst->dst.nr & 0x0F, inst->dst.subnr);
442
443 break;
444 case BRW_ARF_FLAG:
445 fprintf(file, "f%d.%d", inst->dst.nr & 0xf, inst->dst.subnr);
446 break;
447 default:
448 fprintf(file, "arf%d.%d", inst->dst.nr & 0xf, inst->dst.subnr);
449 break;
450 }
451 break;
452 case IMM:
453 unreachable("not reached");
454 }
455
456 if (inst->dst.offset ||
457 (!s.grf_used && inst->dst.file == VGRF &&
458 s.alloc.sizes[inst->dst.nr] * REG_SIZE != inst->size_written)) {
459 const unsigned reg_size = (inst->dst.file == UNIFORM ? 4 : REG_SIZE);
460 fprintf(file, "+%d.%d", inst->dst.offset / reg_size,
461 inst->dst.offset % reg_size);
462 }
463
464 if (inst->dst.stride != 1)
465 fprintf(file, "<%u>", inst->dst.stride);
466 fprintf(file, ":%s", brw_reg_type_to_letters(inst->dst.type));
467
468 for (int i = 0; i < inst->sources; i++) {
469 if (inst->opcode == SHADER_OPCODE_MEMORY_LOAD_LOGICAL ||
470 inst->opcode == SHADER_OPCODE_MEMORY_STORE_LOGICAL ||
471 inst->opcode == SHADER_OPCODE_MEMORY_ATOMIC_LOGICAL) {
472 if (print_memory_logical_source(file, inst, i))
473 continue;
474 } else {
475 fprintf(file, ", ");
476 }
477
478 if (inst->src[i].negate)
479 fprintf(file, "-");
480 if (inst->src[i].abs)
481 fprintf(file, "|");
482 switch (inst->src[i].file) {
483 case VGRF:
484 if (defs && defs->get(inst->src[i]))
485 fprintf(file, "%%%d", inst->src[i].nr);
486 else
487 fprintf(file, "v%d", inst->src[i].nr);
488 break;
489 case FIXED_GRF:
490 fprintf(file, "g%d", inst->src[i].nr);
491 break;
492 case ATTR:
493 fprintf(file, "attr%d", inst->src[i].nr);
494 break;
495 case UNIFORM:
496 fprintf(file, "u%d", inst->src[i].nr);
497 break;
498 case BAD_FILE:
499 fprintf(file, "(null)");
500 break;
501 case IMM:
502 switch (inst->src[i].type) {
503 case BRW_TYPE_HF:
504 fprintf(file, "%-ghf", _mesa_half_to_float(inst->src[i].ud & 0xffff));
505 break;
506 case BRW_TYPE_F:
507 fprintf(file, "%-gf", inst->src[i].f);
508 break;
509 case BRW_TYPE_DF:
510 fprintf(file, "%fdf", inst->src[i].df);
511 break;
512 case BRW_TYPE_W:
513 fprintf(file, "%dw", (int)(int16_t)inst->src[i].d);
514 break;
515 case BRW_TYPE_D:
516 fprintf(file, "%dd", inst->src[i].d);
517 break;
518 case BRW_TYPE_UW:
519 fprintf(file, "%duw", inst->src[i].ud & 0xffff);
520 break;
521 case BRW_TYPE_UD:
522 fprintf(file, "%uu", inst->src[i].ud);
523 break;
524 case BRW_TYPE_Q:
525 fprintf(file, "%" PRId64 "q", inst->src[i].d64);
526 break;
527 case BRW_TYPE_UQ:
528 fprintf(file, "%" PRIu64 "uq", inst->src[i].u64);
529 break;
530 case BRW_TYPE_VF:
531 fprintf(file, "[%-gF, %-gF, %-gF, %-gF]",
532 brw_vf_to_float((inst->src[i].ud >> 0) & 0xff),
533 brw_vf_to_float((inst->src[i].ud >> 8) & 0xff),
534 brw_vf_to_float((inst->src[i].ud >> 16) & 0xff),
535 brw_vf_to_float((inst->src[i].ud >> 24) & 0xff));
536 break;
537 case BRW_TYPE_V:
538 case BRW_TYPE_UV:
539 fprintf(file, "%08x%s", inst->src[i].ud,
540 inst->src[i].type == BRW_TYPE_V ? "V" : "UV");
541 break;
542 default:
543 fprintf(file, "???");
544 break;
545 }
546 break;
547 case ARF:
548 switch (inst->src[i].nr & 0xF0) {
549 case BRW_ARF_NULL:
550 fprintf(file, "null");
551 break;
552 case BRW_ARF_ADDRESS:
553 fprintf(file, "a0.%d", inst->src[i].subnr);
554 break;
555 case BRW_ARF_ACCUMULATOR:
556 if (inst->src[i].subnr == 0)
557 fprintf(file, "acc%d", inst->src[i].nr & 0x0F);
558 else
559 fprintf(file, "acc%d.%d", inst->src[i].nr & 0x0F, inst->src[i].subnr);
560
561 break;
562 case BRW_ARF_FLAG:
563 fprintf(file, "f%d.%d", inst->src[i].nr & 0xf, inst->src[i].subnr);
564 break;
565 default:
566 fprintf(file, "arf%d.%d", inst->src[i].nr & 0xf, inst->src[i].subnr);
567 break;
568 }
569 break;
570 }
571
572 if (inst->src[i].file == FIXED_GRF && inst->src[i].subnr != 0) {
573 assert(inst->src[i].offset == 0);
574
575 fprintf(file, ".%d", inst->src[i].subnr / brw_type_size_bytes(inst->src[i].type));
576 } else if (inst->src[i].offset ||
577 (!s.grf_used && inst->src[i].file == VGRF &&
578 s.alloc.sizes[inst->src[i].nr] * REG_SIZE != inst->size_read(i))) {
579 const unsigned reg_size = (inst->src[i].file == UNIFORM ? 4 : REG_SIZE);
580 fprintf(file, "+%d.%d", inst->src[i].offset / reg_size,
581 inst->src[i].offset % reg_size);
582 }
583
584 if (inst->src[i].abs)
585 fprintf(file, "|");
586
587 if (inst->src[i].file != IMM) {
588 unsigned stride;
589 if (inst->src[i].file == ARF || inst->src[i].file == FIXED_GRF) {
590 unsigned hstride = inst->src[i].hstride;
591 stride = (hstride == 0 ? 0 : (1 << (hstride - 1)));
592 } else {
593 stride = inst->src[i].stride;
594 }
595 if (stride != 1)
596 fprintf(file, "<%u>", stride);
597
598 fprintf(file, ":%s", brw_reg_type_to_letters(inst->src[i].type));
599 }
600 }
601
602 fprintf(file, " ");
603
604 if (inst->force_writemask_all)
605 fprintf(file, "NoMask ");
606
607 if (inst->exec_size != s.dispatch_width)
608 fprintf(file, "group%d ", inst->group);
609
610 if (inst->has_no_mask_send_params)
611 fprintf(file, "NoMaskParams ");
612
613 if (inst->sched.pipe != TGL_PIPE_NONE) {
614 fprintf(file, "{ ");
615 brw_print_swsb(file, s.devinfo, inst->sched);
616 fprintf(file, " } ");
617 }
618
619 fprintf(file, "\n");
620 }
621
622
623 void
brw_print_swsb(FILE * f,const struct intel_device_info * devinfo,const tgl_swsb swsb)624 brw_print_swsb(FILE *f, const struct intel_device_info *devinfo, const tgl_swsb swsb)
625 {
626 if (swsb.pipe == TGL_PIPE_NONE)
627 return;
628
629 if (swsb.regdist) {
630 fprintf(f, "%s@%d",
631 (devinfo && devinfo->verx10 < 125 ? "" :
632 swsb.pipe == TGL_PIPE_FLOAT ? "F" :
633 swsb.pipe == TGL_PIPE_INT ? "I" :
634 swsb.pipe == TGL_PIPE_LONG ? "L" :
635 swsb.pipe == TGL_PIPE_ALL ? "A" :
636 swsb.pipe == TGL_PIPE_MATH ? "M" : "" ),
637 swsb.regdist);
638 }
639
640 if (swsb.mode) {
641 if (swsb.regdist)
642 fprintf(f, " ");
643
644 fprintf(f, "$%d%s", swsb.sbid,
645 (swsb.mode & TGL_SBID_SET ? "" :
646 swsb.mode & TGL_SBID_DST ? ".dst" : ".src"));
647 }
648 }
649
650