1/*
2 * Copyright (C) 2020 Collabora, Ltd.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24/* Autogenerated file, do not edit */
25
26#include <stdio.h>
27#include "compiler.h"
28
29static const char *
30bi_swizzle_as_str(enum bi_swizzle swz)
31{
32        switch (swz) {
33        case BI_SWIZZLE_H00: return ".h00";
34        case BI_SWIZZLE_H01: return "";
35        case BI_SWIZZLE_H10: return ".h10";
36        case BI_SWIZZLE_H11: return ".h11";
37        case BI_SWIZZLE_B0000: return ".b0";
38        case BI_SWIZZLE_B1111: return ".b1";
39        case BI_SWIZZLE_B2222: return ".b2";
40        case BI_SWIZZLE_B3333: return ".b3";
41        case BI_SWIZZLE_B0011: return ".b0011";
42        case BI_SWIZZLE_B2233: return ".b2233";
43        case BI_SWIZZLE_B1032: return ".b1032";
44        case BI_SWIZZLE_B3210: return ".b3210";
45        case BI_SWIZZLE_B0022: return ".b0022";
46        }
47
48        unreachable("Invalid swizzle");
49}
50
51static const char *
52bir_fau_name(unsigned fau_idx)
53{
54    const char *names[] = {
55            "zero", "lane-id", "wrap-id", "core-id", "fb-extent",
56            "atest-param", "sample-pos", "reserved",
57            "blend_descriptor_0", "blend_descriptor_1",
58            "blend_descriptor_2", "blend_descriptor_3",
59            "blend_descriptor_4", "blend_descriptor_5",
60            "blend_descriptor_6", "blend_descriptor_7",
61    };
62
63    assert(fau_idx < ARRAY_SIZE(names));
64    return names[fau_idx];
65}
66
67static const char *
68bir_passthrough_name(unsigned idx)
69{
70    const char *names[] = {
71            "s0", "s1", "s2", "t", "fau.x", "fau.y", "t0", "t1"
72    };
73
74    assert(idx < ARRAY_SIZE(names));
75    return names[idx];
76}
77
78static void
79bi_print_index(FILE *fp, bi_index index)
80{
81    if (index.discard)
82        fputs("`", fp);
83
84    if (bi_is_null(index))
85        fprintf(fp, "_");
86    else if (index.type == BI_INDEX_CONSTANT)
87        fprintf(fp, "#0x%x", index.value);
88    else if (index.type == BI_INDEX_FAU && index.value >= BIR_FAU_UNIFORM)
89        fprintf(fp, "u%u", index.value & ~BIR_FAU_UNIFORM);
90    else if (index.type == BI_INDEX_FAU)
91        fprintf(fp, "%s", bir_fau_name(index.value));
92    else if (index.type == BI_INDEX_PASS)
93        fprintf(fp, "%s", bir_passthrough_name(index.value));
94    else if (index.type == BI_INDEX_REGISTER)
95        fprintf(fp, "br%u", index.value);
96    else if (index.type == BI_INDEX_NORMAL && index.reg)
97        fprintf(fp, "r%u", index.value);
98    else if (index.type == BI_INDEX_NORMAL)
99        fprintf(fp, "%u", index.value);
100    else
101        unreachable("Invalid index");
102
103    if (index.offset)
104        fprintf(fp, "[%u]", index.offset);
105
106    if (index.abs)
107        fputs(".abs", fp);
108
109    if (index.neg)
110        fputs(".neg", fp);
111
112    fputs(bi_swizzle_as_str(index.swizzle), fp);
113}
114
115
116UNUSED static inline const char *
117bi_adj_as_str(enum bi_adj adj)
118{
119    switch (adj) {
120    case BI_ADJ_LOW: return ".low";
121    case BI_ADJ_NONE: return "";
122    case BI_ADJ_SMALL: return ".small";
123    }
124
125    unreachable("Invalid adj");
126};
127
128UNUSED static inline const char *
129bi_atom_opc_as_str(enum bi_atom_opc atom_opc)
130{
131    switch (atom_opc) {
132    case BI_ATOM_OPC_AADD: return ".aadd";
133    case BI_ATOM_OPC_AADDS: return ".aadds";
134    case BI_ATOM_OPC_AADDU: return ".aaddu";
135    case BI_ATOM_OPC_AAND: return ".aand";
136    case BI_ATOM_OPC_ADEC: return ".adec";
137    case BI_ATOM_OPC_AINC: return ".ainc";
138    case BI_ATOM_OPC_AOR: return ".aor";
139    case BI_ATOM_OPC_AOR1: return ".aor1";
140    case BI_ATOM_OPC_ASMAX: return ".asmax";
141    case BI_ATOM_OPC_ASMAX1: return ".asmax1";
142    case BI_ATOM_OPC_ASMIN: return ".asmin";
143    case BI_ATOM_OPC_AUMAX: return ".aumax";
144    case BI_ATOM_OPC_AUMAX1: return ".aumax1";
145    case BI_ATOM_OPC_AUMIN: return ".aumin";
146    case BI_ATOM_OPC_AXOR: return ".axor";
147    }
148
149    unreachable("Invalid atom_opc");
150};
151
152UNUSED static inline const char *
153bi_clamp_as_str(enum bi_clamp clamp)
154{
155    switch (clamp) {
156    case BI_CLAMP_CLAMP_0_1: return ".clamp_0_1";
157    case BI_CLAMP_CLAMP_0_INF: return ".clamp_0_inf";
158    case BI_CLAMP_CLAMP_M1_1: return ".clamp_m1_1";
159    case BI_CLAMP_NONE: return "";
160    }
161
162    unreachable("Invalid clamp");
163};
164
165UNUSED static inline const char *
166bi_cmpf_as_str(enum bi_cmpf cmpf)
167{
168    switch (cmpf) {
169    case BI_CMPF_EQ: return ".eq";
170    case BI_CMPF_GE: return ".ge";
171    case BI_CMPF_GT: return ".gt";
172    case BI_CMPF_GTLT: return ".gtlt";
173    case BI_CMPF_LE: return ".le";
174    case BI_CMPF_LT: return ".lt";
175    case BI_CMPF_NE: return ".ne";
176    case BI_CMPF_TOTAL: return ".total";
177    }
178
179    unreachable("Invalid cmpf");
180};
181
182UNUSED static inline const char *
183bi_extend_as_str(enum bi_extend extend)
184{
185    switch (extend) {
186    case BI_EXTEND_NONE: return "";
187    case BI_EXTEND_SEXT: return ".sext";
188    case BI_EXTEND_ZEXT: return ".zext";
189    }
190
191    unreachable("Invalid extend");
192};
193
194UNUSED static inline const char *
195bi_func_as_str(enum bi_func func)
196{
197    switch (func) {
198    case BI_FUNC_POW: return ".pow";
199    case BI_FUNC_POWN: return ".pown";
200    case BI_FUNC_POWR: return ".powr";
201    case BI_FUNC_ROOTN: return ".rootn";
202    }
203
204    unreachable("Invalid func");
205};
206
207UNUSED static inline const char *
208bi_function_as_str(enum bi_function function)
209{
210    switch (function) {
211    case BI_FUNCTION_AND: return ".and";
212    case BI_FUNCTION_NONE: return "";
213    case BI_FUNCTION_OR: return ".or";
214    }
215
216    unreachable("Invalid function");
217};
218
219UNUSED static inline const char *
220bi_inactive_result_as_str(enum bi_inactive_result inactive_result)
221{
222    switch (inactive_result) {
223    case BI_INACTIVE_RESULT_F1: return ".f1";
224    case BI_INACTIVE_RESULT_I1: return ".i1";
225    case BI_INACTIVE_RESULT_INF: return ".inf";
226    case BI_INACTIVE_RESULT_INFN: return ".infn";
227    case BI_INACTIVE_RESULT_SMAX: return ".smax";
228    case BI_INACTIVE_RESULT_SMIN: return ".smin";
229    case BI_INACTIVE_RESULT_UMAX: return ".umax";
230    case BI_INACTIVE_RESULT_V2F1: return ".v2f1";
231    case BI_INACTIVE_RESULT_V2I1: return ".v2i1";
232    case BI_INACTIVE_RESULT_V2INF: return ".v2inf";
233    case BI_INACTIVE_RESULT_V2INFN: return ".v2infn";
234    case BI_INACTIVE_RESULT_V2SMAX: return ".v2smax";
235    case BI_INACTIVE_RESULT_V2SMIN: return ".v2smin";
236    case BI_INACTIVE_RESULT_V4SMAX: return ".v4smax";
237    case BI_INACTIVE_RESULT_V4SMIN: return ".v4smin";
238    case BI_INACTIVE_RESULT_ZERO: return ".zero";
239    }
240
241    unreachable("Invalid inactive_result");
242};
243
244UNUSED static inline const char *
245bi_lane_as_str(enum bi_lane lane)
246{
247    switch (lane) {
248    case BI_LANE_B0: return ".b0";
249    case BI_LANE_B1: return ".b1";
250    case BI_LANE_B2: return ".b2";
251    case BI_LANE_B3: return ".b3";
252    case BI_LANE_H0: return ".h0";
253    case BI_LANE_H1: return ".h1";
254    case BI_LANE_NONE: return "";
255    }
256
257    unreachable("Invalid lane");
258};
259
260UNUSED static inline const char *
261bi_lane_dest_as_str(enum bi_lane_dest lane_dest)
262{
263    switch (lane_dest) {
264    case BI_LANE_DEST_B0: return ".b0";
265    case BI_LANE_DEST_B1: return ".b1";
266    case BI_LANE_DEST_B2: return ".b2";
267    case BI_LANE_DEST_B3: return ".b3";
268    case BI_LANE_DEST_D0: return ".d0";
269    case BI_LANE_DEST_H0: return ".h0";
270    case BI_LANE_DEST_H1: return ".h1";
271    case BI_LANE_DEST_NONE: return "";
272    case BI_LANE_DEST_W0: return ".w0";
273    }
274
275    unreachable("Invalid lane_dest");
276};
277
278UNUSED static inline const char *
279bi_lane_op_as_str(enum bi_lane_op lane_op)
280{
281    switch (lane_op) {
282    case BI_LANE_OP_ACCUMULATE: return ".accumulate";
283    case BI_LANE_OP_NONE: return "";
284    case BI_LANE_OP_SHIFT: return ".shift";
285    case BI_LANE_OP_XOR: return ".xor";
286    }
287
288    unreachable("Invalid lane_op");
289};
290
291UNUSED static inline const char *
292bi_lanes_as_str(enum bi_lanes lanes)
293{
294    switch (lanes) {
295    case BI_LANES_B0: return ".b0";
296    case BI_LANES_B00: return ".b00";
297    case BI_LANES_B0000: return ".b0000";
298    case BI_LANES_B01: return ".b01";
299    case BI_LANES_B0101: return ".b0101";
300    case BI_LANES_B0123: return ".b0123";
301    case BI_LANES_B02: return ".b02";
302    case BI_LANES_B1: return ".b1";
303    case BI_LANES_B11: return ".b11";
304    case BI_LANES_B1111: return ".b1111";
305    case BI_LANES_B2: return ".b2";
306    case BI_LANES_B22: return ".b22";
307    case BI_LANES_B2222: return ".b2222";
308    case BI_LANES_B23: return ".b23";
309    case BI_LANES_B2323: return ".b2323";
310    case BI_LANES_B3: return ".b3";
311    case BI_LANES_B33: return ".b33";
312    case BI_LANES_B3333: return ".b3333";
313    case BI_LANES_H0: return ".h0";
314    case BI_LANES_H00: return ".h00";
315    case BI_LANES_H01: return ".h01";
316    case BI_LANES_H1: return ".h1";
317    case BI_LANES_H10: return ".h10";
318    case BI_LANES_H11: return ".h11";
319    case BI_LANES_NONE: return "";
320    }
321
322    unreachable("Invalid lanes");
323};
324
325UNUSED static inline const char *
326bi_mode_as_str(enum bi_mode mode)
327{
328    switch (mode) {
329    case BI_MODE_BASE2: return ".base2";
330    case BI_MODE_NATURAL: return ".natural";
331    case BI_MODE_RED: return ".red";
332    }
333
334    unreachable("Invalid mode");
335};
336
337UNUSED static inline const char *
338bi_mux_as_str(enum bi_mux mux)
339{
340    switch (mux) {
341    case BI_MUX_BIT: return ".bit";
342    case BI_MUX_FP_ZERO: return ".fp_zero";
343    case BI_MUX_INT_ZERO: return ".int_zero";
344    case BI_MUX_NEG: return ".neg";
345    }
346
347    unreachable("Invalid mux");
348};
349
350UNUSED static inline const char *
351bi_precision_as_str(enum bi_precision precision)
352{
353    switch (precision) {
354    case BI_PRECISION_HIGH: return ".high";
355    case BI_PRECISION_LOW: return ".low";
356    case BI_PRECISION_NONE: return "";
357    }
358
359    unreachable("Invalid precision");
360};
361
362UNUSED static inline const char *
363bi_register_format_as_str(enum bi_register_format register_format)
364{
365    switch (register_format) {
366    case BI_REGISTER_FORMAT_AUTO: return ".auto";
367    case BI_REGISTER_FORMAT_F16: return ".f16";
368    case BI_REGISTER_FORMAT_F32: return ".f32";
369    case BI_REGISTER_FORMAT_F64: return ".f64";
370    case BI_REGISTER_FORMAT_I64: return ".i64";
371    case BI_REGISTER_FORMAT_S16: return ".s16";
372    case BI_REGISTER_FORMAT_S32: return ".s32";
373    case BI_REGISTER_FORMAT_U16: return ".u16";
374    case BI_REGISTER_FORMAT_U32: return ".u32";
375    }
376
377    unreachable("Invalid register_format");
378};
379
380UNUSED static inline const char *
381bi_replicate_as_str(enum bi_replicate replicate)
382{
383    switch (replicate) {
384    case BI_REPLICATE_B0000: return ".b0000";
385    case BI_REPLICATE_B0123: return ".b0123";
386    case BI_REPLICATE_B1111: return ".b1111";
387    case BI_REPLICATE_B2222: return ".b2222";
388    case BI_REPLICATE_B3333: return ".b3333";
389    }
390
391    unreachable("Invalid replicate");
392};
393
394UNUSED static inline const char *
395bi_result_type_as_str(enum bi_result_type result_type)
396{
397    switch (result_type) {
398    case BI_RESULT_TYPE_F1: return ".f1";
399    case BI_RESULT_TYPE_I1: return ".i1";
400    case BI_RESULT_TYPE_M1: return ".m1";
401    }
402
403    unreachable("Invalid result_type");
404};
405
406UNUSED static inline const char *
407bi_round_as_str(enum bi_round round)
408{
409    switch (round) {
410    case BI_ROUND_INF: return ".inf";
411    case BI_ROUND_INF0: return ".inf0";
412    case BI_ROUND_NONE: return "";
413    case BI_ROUND_RTN: return ".rtn";
414    case BI_ROUND_RTNA: return ".rtna";
415    case BI_ROUND_RTO: return ".rto";
416    case BI_ROUND_RTP: return ".rtp";
417    case BI_ROUND_RTZ: return ".rtz";
418    }
419
420    unreachable("Invalid round");
421};
422
423UNUSED static inline const char *
424bi_sample_as_str(enum bi_sample sample)
425{
426    switch (sample) {
427    case BI_SAMPLE_CENTER: return ".center";
428    case BI_SAMPLE_CENTROID: return ".centroid";
429    case BI_SAMPLE_EXPLICIT: return ".explicit";
430    case BI_SAMPLE_NONE: return "";
431    case BI_SAMPLE_SAMPLE: return ".sample";
432    }
433
434    unreachable("Invalid sample");
435};
436
437UNUSED static inline const char *
438bi_seg_as_str(enum bi_seg seg)
439{
440    switch (seg) {
441    case BI_SEG_NONE: return "";
442    case BI_SEG_STREAM: return ".stream";
443    case BI_SEG_TL: return ".tl";
444    case BI_SEG_UBO: return ".ubo";
445    case BI_SEG_WLS: return ".wls";
446    }
447
448    unreachable("Invalid seg");
449};
450
451UNUSED static inline const char *
452bi_sem_as_str(enum bi_sem sem)
453{
454    switch (sem) {
455    case BI_SEM_C: return ".c";
456    case BI_SEM_INVERSE_C: return ".inverse_c";
457    case BI_SEM_NAN_PROPAGATE: return ".nan_propagate";
458    case BI_SEM_NAN_SUPPRESS: return ".nan_suppress";
459    }
460
461    unreachable("Invalid sem");
462};
463
464UNUSED static inline const char *
465bi_source_as_str(enum bi_source source)
466{
467    switch (source) {
468    case BI_SOURCE_CYCLE_COUNTER: return ".cycle_counter";
469    case BI_SOURCE_SYSTEM_TIMESTAMP: return ".system_timestamp";
470    }
471
472    unreachable("Invalid source");
473};
474
475UNUSED static inline const char *
476bi_special_as_str(enum bi_special special)
477{
478    switch (special) {
479    case BI_SPECIAL_LEFT: return ".left";
480    case BI_SPECIAL_N: return ".n";
481    case BI_SPECIAL_NONE: return "";
482    case BI_SPECIAL_SCALE16: return ".scale16";
483    }
484
485    unreachable("Invalid special");
486};
487
488UNUSED static inline const char *
489bi_stack_mode_as_str(enum bi_stack_mode stack_mode)
490{
491    switch (stack_mode) {
492    case BI_STACK_MODE_CALL: return ".call";
493    case BI_STACK_MODE_NONE: return "";
494    case BI_STACK_MODE_REPLACE: return ".replace";
495    case BI_STACK_MODE_RETURN: return ".return";
496    }
497
498    unreachable("Invalid stack_mode");
499};
500
501UNUSED static inline const char *
502bi_subgroup_as_str(enum bi_subgroup subgroup)
503{
504    switch (subgroup) {
505    case BI_SUBGROUP_SUBGROUP2: return ".subgroup2";
506    case BI_SUBGROUP_SUBGROUP4: return ".subgroup4";
507    case BI_SUBGROUP_SUBGROUP8: return ".subgroup8";
508    }
509
510    unreachable("Invalid subgroup");
511};
512
513UNUSED static inline const char *
514bi_swz_as_str(enum bi_swz swz)
515{
516    switch (swz) {
517    case BI_SWZ_B00: return ".b00";
518    case BI_SWZ_B0000: return ".b0000";
519    case BI_SWZ_B0011: return ".b0011";
520    case BI_SWZ_B01: return ".b01";
521    case BI_SWZ_B02: return ".b02";
522    case BI_SWZ_B03: return ".b03";
523    case BI_SWZ_B10: return ".b10";
524    case BI_SWZ_B1032: return ".b1032";
525    case BI_SWZ_B11: return ".b11";
526    case BI_SWZ_B1111: return ".b1111";
527    case BI_SWZ_B12: return ".b12";
528    case BI_SWZ_B13: return ".b13";
529    case BI_SWZ_B20: return ".b20";
530    case BI_SWZ_B21: return ".b21";
531    case BI_SWZ_B22: return ".b22";
532    case BI_SWZ_B2222: return ".b2222";
533    case BI_SWZ_B2233: return ".b2233";
534    case BI_SWZ_B23: return ".b23";
535    case BI_SWZ_B30: return ".b30";
536    case BI_SWZ_B31: return ".b31";
537    case BI_SWZ_B32: return ".b32";
538    case BI_SWZ_B3210: return ".b3210";
539    case BI_SWZ_B33: return ".b33";
540    case BI_SWZ_B3333: return ".b3333";
541    case BI_SWZ_H00: return ".h00";
542    case BI_SWZ_H01: return ".h01";
543    case BI_SWZ_H10: return ".h10";
544    case BI_SWZ_H11: return ".h11";
545    }
546
547    unreachable("Invalid swz");
548};
549
550UNUSED static inline const char *
551bi_table_as_str(enum bi_table table)
552{
553    switch (table) {
554    case BI_TABLE_ATTRIBUTE_1: return ".attribute_1";
555    case BI_TABLE_ATTRIBUTE_2: return ".attribute_2";
556    case BI_TABLE_FLAT: return ".flat";
557    case BI_TABLE_NONE: return "";
558    }
559
560    unreachable("Invalid table");
561};
562
563UNUSED static inline const char *
564bi_update_as_str(enum bi_update update)
565{
566    switch (update) {
567    case BI_UPDATE_CLOBBER: return ".clobber";
568    case BI_UPDATE_CONDITIONAL: return ".conditional";
569    case BI_UPDATE_RETRIEVE: return ".retrieve";
570    case BI_UPDATE_STORE: return ".store";
571    }
572
573    unreachable("Invalid update");
574};
575
576UNUSED static inline const char *
577bi_varying_name_as_str(enum bi_varying_name varying_name)
578{
579    switch (varying_name) {
580    case BI_VARYING_NAME_FRAG_W: return ".frag_w";
581    case BI_VARYING_NAME_FRAG_Z: return ".frag_z";
582    case BI_VARYING_NAME_POINT: return ".point";
583    }
584
585    unreachable("Invalid varying_name");
586};
587
588UNUSED static inline const char *
589bi_vecsize_as_str(enum bi_vecsize vecsize)
590{
591    switch (vecsize) {
592    case BI_VECSIZE_NONE: return "";
593    case BI_VECSIZE_V2: return ".v2";
594    case BI_VECSIZE_V3: return ".v3";
595    case BI_VECSIZE_V4: return ".v4";
596    }
597
598    unreachable("Invalid vecsize");
599};
600
601UNUSED static inline const char *
602bi_widen_as_str(enum bi_widen widen)
603{
604    switch (widen) {
605    case BI_WIDEN_B0: return ".b0";
606    case BI_WIDEN_B1: return ".b1";
607    case BI_WIDEN_B2: return ".b2";
608    case BI_WIDEN_B3: return ".b3";
609    case BI_WIDEN_H0: return ".h0";
610    case BI_WIDEN_H1: return ".h1";
611    case BI_WIDEN_NONE: return "";
612    }
613
614    unreachable("Invalid widen");
615};
616
617
618
619
620
621void
622bi_print_instr(const bi_instr *I, FILE *fp)
623{
624    bi_foreach_dest(I, d) {
625        if (bi_is_null(I->dest[d])) break;
626        if (d > 0) fprintf(fp, ", ");
627
628        bi_print_index(fp, I->dest[d]);
629    }
630
631    fprintf(fp, " = %s", bi_opcode_props[I->op].name);
632
633    if (I->table)
634        fprintf(fp, ".%s", bi_table_as_str(I->table));
635
636    switch (I->op) {
637
638    case BI_OPCODE_ACMPSTORE_I32:
639
640        fputs(bi_seg_as_str(I->seg), fp);
641
642        fputs(" ", fp);
643        bi_print_index(fp, I->src[0]);
644
645
646        fputs(", ", fp);
647        bi_print_index(fp, I->src[1]);
648
649
650        fputs(", ", fp);
651        bi_print_index(fp, I->src[2]);
652
653
654        break;
655
656    case BI_OPCODE_ACMPSTORE_I64:
657
658        fputs(bi_seg_as_str(I->seg), fp);
659
660        fputs(" ", fp);
661        bi_print_index(fp, I->src[0]);
662
663
664        fputs(", ", fp);
665        bi_print_index(fp, I->src[1]);
666
667
668        fputs(", ", fp);
669        bi_print_index(fp, I->src[2]);
670
671
672        break;
673
674    case BI_OPCODE_ACMPXCHG_I32:
675
676        fputs(bi_seg_as_str(I->seg), fp);
677
678        fputs(" ", fp);
679        bi_print_index(fp, I->src[0]);
680
681
682        fputs(", ", fp);
683        bi_print_index(fp, I->src[1]);
684
685
686        fputs(", ", fp);
687        bi_print_index(fp, I->src[2]);
688
689
690        break;
691
692    case BI_OPCODE_ACMPXCHG_I64:
693
694        fputs(bi_seg_as_str(I->seg), fp);
695
696        fputs(" ", fp);
697        bi_print_index(fp, I->src[0]);
698
699
700        fputs(", ", fp);
701        bi_print_index(fp, I->src[1]);
702
703
704        fputs(", ", fp);
705        bi_print_index(fp, I->src[2]);
706
707
708        break;
709
710    case BI_OPCODE_ARSHIFT_I32:
711
712
713        fputs(" ", fp);
714        bi_print_index(fp, I->src[0]);
715
716
717        fputs(", ", fp);
718        bi_print_index(fp, I->src[1]);
719
720
721        fputs(", ", fp);
722        bi_print_index(fp, I->src[2]);
723
724
725        break;
726
727    case BI_OPCODE_ARSHIFT_V2I16:
728
729
730        fputs(" ", fp);
731        bi_print_index(fp, I->src[0]);
732
733
734        fputs(", ", fp);
735        bi_print_index(fp, I->src[1]);
736
737
738        fputs(", ", fp);
739        bi_print_index(fp, I->src[2]);
740
741
742        break;
743
744    case BI_OPCODE_ARSHIFT_V4I8:
745
746
747        fputs(" ", fp);
748        bi_print_index(fp, I->src[0]);
749
750
751        fputs(", ", fp);
752        bi_print_index(fp, I->src[1]);
753
754
755        fputs(", ", fp);
756        bi_print_index(fp, I->src[2]);
757
758
759        break;
760
761    case BI_OPCODE_ARSHIFT_DOUBLE_I32:
762
763        if (I->result_word) fputs(".result_word", fp);
764
765        fputs(" ", fp);
766        bi_print_index(fp, I->src[0]);
767
768
769        fputs(", ", fp);
770        bi_print_index(fp, I->src[1]);
771
772
773        fputs(", ", fp);
774        bi_print_index(fp, I->src[2]);
775
776        if (I->bytes2) fputs(".bytes", fp);
777
778        break;
779
780    case BI_OPCODE_ATEST:
781
782
783        fputs(" ", fp);
784        bi_print_index(fp, I->src[0]);
785
786
787        fputs(", ", fp);
788        bi_print_index(fp, I->src[1]);
789
790
791        break;
792
793    case BI_OPCODE_ATOM_C_I32:
794
795        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
796
797        fputs(" ", fp);
798        bi_print_index(fp, I->src[0]);
799
800
801        fputs(", ", fp);
802        bi_print_index(fp, I->src[1]);
803
804
805        fputs(", ", fp);
806        bi_print_index(fp, I->src[2]);
807
808
809        break;
810
811    case BI_OPCODE_ATOM_C_I64:
812
813        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
814
815        fputs(" ", fp);
816        bi_print_index(fp, I->src[0]);
817
818
819        fputs(", ", fp);
820        bi_print_index(fp, I->src[1]);
821
822
823        fputs(", ", fp);
824        bi_print_index(fp, I->src[2]);
825
826
827        break;
828
829    case BI_OPCODE_ATOM_C1_I32:
830
831        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
832
833        fputs(" ", fp);
834        bi_print_index(fp, I->src[0]);
835
836
837        fputs(", ", fp);
838        bi_print_index(fp, I->src[1]);
839
840
841        break;
842
843    case BI_OPCODE_ATOM_C1_I64:
844
845        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
846
847        fputs(" ", fp);
848        bi_print_index(fp, I->src[0]);
849
850
851        fputs(", ", fp);
852        bi_print_index(fp, I->src[1]);
853
854
855        break;
856
857    case BI_OPCODE_ATOM_C1_RETURN_I32:
858
859        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
860
861        fputs(" ", fp);
862        bi_print_index(fp, I->src[0]);
863
864
865        fputs(", ", fp);
866        bi_print_index(fp, I->src[1]);
867
868
869        break;
870
871    case BI_OPCODE_ATOM_C1_RETURN_I64:
872
873        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
874
875        fputs(" ", fp);
876        bi_print_index(fp, I->src[0]);
877
878
879        fputs(", ", fp);
880        bi_print_index(fp, I->src[1]);
881
882
883        break;
884
885    case BI_OPCODE_ATOM_CX:
886
887
888        fputs(" ", fp);
889        bi_print_index(fp, I->src[0]);
890
891
892        fputs(", ", fp);
893        bi_print_index(fp, I->src[1]);
894
895
896        fputs(", ", fp);
897        bi_print_index(fp, I->src[2]);
898
899
900        fputs(", ", fp);
901        bi_print_index(fp, I->src[3]);
902
903
904        fprintf(fp, ", sr_count:%u", I->sr_count);
905        break;
906
907    case BI_OPCODE_ATOM_C_RETURN_I32:
908
909        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
910
911        fputs(" ", fp);
912        bi_print_index(fp, I->src[0]);
913
914
915        fputs(", ", fp);
916        bi_print_index(fp, I->src[1]);
917
918
919        fputs(", ", fp);
920        bi_print_index(fp, I->src[2]);
921
922
923        break;
924
925    case BI_OPCODE_ATOM_C_RETURN_I64:
926
927        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
928
929        fputs(" ", fp);
930        bi_print_index(fp, I->src[0]);
931
932
933        fputs(", ", fp);
934        bi_print_index(fp, I->src[1]);
935
936
937        fputs(", ", fp);
938        bi_print_index(fp, I->src[2]);
939
940
941        break;
942
943    case BI_OPCODE_ATOM_POST_I32:
944
945        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
946
947        fputs(" ", fp);
948        bi_print_index(fp, I->src[0]);
949
950
951        fputs(", ", fp);
952        bi_print_index(fp, I->src[1]);
953
954
955        break;
956
957    case BI_OPCODE_ATOM_POST_I64:
958
959        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
960
961        fputs(" ", fp);
962        bi_print_index(fp, I->src[0]);
963
964
965        fputs(", ", fp);
966        bi_print_index(fp, I->src[1]);
967
968
969        break;
970
971    case BI_OPCODE_ATOM_PRE_I64:
972
973        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
974
975        fputs(" ", fp);
976        bi_print_index(fp, I->src[0]);
977
978
979        fputs(", ", fp);
980        bi_print_index(fp, I->src[1]);
981
982
983        fputs(", ", fp);
984        bi_print_index(fp, I->src[2]);
985
986
987        break;
988
989    case BI_OPCODE_AXCHG_I32:
990
991        fputs(bi_seg_as_str(I->seg), fp);
992
993        fputs(" ", fp);
994        bi_print_index(fp, I->src[0]);
995
996
997        fputs(", ", fp);
998        bi_print_index(fp, I->src[1]);
999
1000
1001        fputs(", ", fp);
1002        bi_print_index(fp, I->src[2]);
1003
1004
1005        break;
1006
1007    case BI_OPCODE_AXCHG_I64:
1008
1009        fputs(bi_seg_as_str(I->seg), fp);
1010
1011        fputs(" ", fp);
1012        bi_print_index(fp, I->src[0]);
1013
1014
1015        fputs(", ", fp);
1016        bi_print_index(fp, I->src[1]);
1017
1018
1019        fputs(", ", fp);
1020        bi_print_index(fp, I->src[2]);
1021
1022
1023        break;
1024
1025    case BI_OPCODE_BARRIER:
1026
1027
1028        fputs(" ", fp);
1029        break;
1030
1031    case BI_OPCODE_BITREV_I32:
1032
1033
1034        fputs(" ", fp);
1035        bi_print_index(fp, I->src[0]);
1036
1037
1038        break;
1039
1040    case BI_OPCODE_BLEND:
1041
1042
1043        fputs(" ", fp);
1044        bi_print_index(fp, I->src[0]);
1045
1046
1047        fputs(", ", fp);
1048        bi_print_index(fp, I->src[1]);
1049
1050
1051        fputs(", ", fp);
1052        bi_print_index(fp, I->src[2]);
1053
1054
1055        fputs(", ", fp);
1056        bi_print_index(fp, I->src[3]);
1057
1058
1059        fprintf(fp, ", sr_count:%u", I->sr_count);
1060        break;
1061
1062    case BI_OPCODE_BRANCH_F16:
1063
1064        fputs(bi_cmpf_as_str(I->cmpf), fp);
1065
1066        fputs(" ", fp);
1067        bi_print_index(fp, I->src[0]);
1068
1069
1070        fputs(", ", fp);
1071        bi_print_index(fp, I->src[1]);
1072
1073
1074        fputs(", ", fp);
1075        bi_print_index(fp, I->src[2]);
1076
1077
1078        break;
1079
1080    case BI_OPCODE_BRANCH_F32:
1081
1082        fputs(bi_cmpf_as_str(I->cmpf), fp);
1083
1084        fputs(" ", fp);
1085        bi_print_index(fp, I->src[0]);
1086
1087
1088        fputs(", ", fp);
1089        bi_print_index(fp, I->src[1]);
1090
1091
1092        fputs(", ", fp);
1093        bi_print_index(fp, I->src[2]);
1094
1095
1096        break;
1097
1098    case BI_OPCODE_BRANCH_I16:
1099
1100        fputs(bi_cmpf_as_str(I->cmpf), fp);
1101
1102        fputs(" ", fp);
1103        bi_print_index(fp, I->src[0]);
1104
1105
1106        fputs(", ", fp);
1107        bi_print_index(fp, I->src[1]);
1108
1109
1110        fputs(", ", fp);
1111        bi_print_index(fp, I->src[2]);
1112
1113
1114        break;
1115
1116    case BI_OPCODE_BRANCH_I32:
1117
1118        fputs(bi_cmpf_as_str(I->cmpf), fp);
1119
1120        fputs(" ", fp);
1121        bi_print_index(fp, I->src[0]);
1122
1123
1124        fputs(", ", fp);
1125        bi_print_index(fp, I->src[1]);
1126
1127
1128        fputs(", ", fp);
1129        bi_print_index(fp, I->src[2]);
1130
1131
1132        break;
1133
1134    case BI_OPCODE_BRANCH_S16:
1135
1136        fputs(bi_cmpf_as_str(I->cmpf), fp);
1137
1138        fputs(" ", fp);
1139        bi_print_index(fp, I->src[0]);
1140
1141
1142        fputs(", ", fp);
1143        bi_print_index(fp, I->src[1]);
1144
1145
1146        fputs(", ", fp);
1147        bi_print_index(fp, I->src[2]);
1148
1149
1150        break;
1151
1152    case BI_OPCODE_BRANCH_S32:
1153
1154        fputs(bi_cmpf_as_str(I->cmpf), fp);
1155
1156        fputs(" ", fp);
1157        bi_print_index(fp, I->src[0]);
1158
1159
1160        fputs(", ", fp);
1161        bi_print_index(fp, I->src[1]);
1162
1163
1164        fputs(", ", fp);
1165        bi_print_index(fp, I->src[2]);
1166
1167
1168        break;
1169
1170    case BI_OPCODE_BRANCH_U16:
1171
1172        fputs(bi_cmpf_as_str(I->cmpf), fp);
1173
1174        fputs(" ", fp);
1175        bi_print_index(fp, I->src[0]);
1176
1177
1178        fputs(", ", fp);
1179        bi_print_index(fp, I->src[1]);
1180
1181
1182        fputs(", ", fp);
1183        bi_print_index(fp, I->src[2]);
1184
1185
1186        break;
1187
1188    case BI_OPCODE_BRANCH_U32:
1189
1190        fputs(bi_cmpf_as_str(I->cmpf), fp);
1191
1192        fputs(" ", fp);
1193        bi_print_index(fp, I->src[0]);
1194
1195
1196        fputs(", ", fp);
1197        bi_print_index(fp, I->src[1]);
1198
1199
1200        fputs(", ", fp);
1201        bi_print_index(fp, I->src[2]);
1202
1203
1204        break;
1205
1206    case BI_OPCODE_BRANCHC_I16:
1207
1208        if (I->combine) fputs(".combine", fp);
1209
1210        fputs(" ", fp);
1211        bi_print_index(fp, I->src[0]);
1212
1213
1214        fputs(", ", fp);
1215        bi_print_index(fp, I->src[1]);
1216
1217
1218        break;
1219
1220    case BI_OPCODE_BRANCHC_I32:
1221
1222        if (I->combine) fputs(".combine", fp);
1223
1224        fputs(" ", fp);
1225        bi_print_index(fp, I->src[0]);
1226
1227
1228        fputs(", ", fp);
1229        bi_print_index(fp, I->src[1]);
1230
1231
1232        break;
1233
1234    case BI_OPCODE_BRANCHZ_F16:
1235
1236        fputs(bi_cmpf_as_str(I->cmpf), fp);
1237
1238        fputs(" ", fp);
1239        bi_print_index(fp, I->src[0]);
1240
1241
1242        fputs(", ", fp);
1243        bi_print_index(fp, I->src[1]);
1244
1245
1246        break;
1247
1248    case BI_OPCODE_BRANCHZ_F32:
1249
1250        fputs(bi_cmpf_as_str(I->cmpf), fp);
1251
1252        fputs(" ", fp);
1253        bi_print_index(fp, I->src[0]);
1254
1255
1256        fputs(", ", fp);
1257        bi_print_index(fp, I->src[1]);
1258
1259
1260        break;
1261
1262    case BI_OPCODE_BRANCHZ_I16:
1263
1264        fputs(bi_cmpf_as_str(I->cmpf), fp);
1265
1266        fputs(" ", fp);
1267        bi_print_index(fp, I->src[0]);
1268
1269
1270        fputs(", ", fp);
1271        bi_print_index(fp, I->src[1]);
1272
1273
1274        break;
1275
1276    case BI_OPCODE_BRANCHZ_I32:
1277
1278        fputs(bi_cmpf_as_str(I->cmpf), fp);
1279
1280        fputs(" ", fp);
1281        bi_print_index(fp, I->src[0]);
1282
1283
1284        fputs(", ", fp);
1285        bi_print_index(fp, I->src[1]);
1286
1287
1288        break;
1289
1290    case BI_OPCODE_BRANCHZ_S16:
1291
1292        fputs(bi_cmpf_as_str(I->cmpf), fp);
1293
1294        fputs(" ", fp);
1295        bi_print_index(fp, I->src[0]);
1296
1297
1298        fputs(", ", fp);
1299        bi_print_index(fp, I->src[1]);
1300
1301
1302        break;
1303
1304    case BI_OPCODE_BRANCHZ_S32:
1305
1306        fputs(bi_cmpf_as_str(I->cmpf), fp);
1307
1308        fputs(" ", fp);
1309        bi_print_index(fp, I->src[0]);
1310
1311
1312        fputs(", ", fp);
1313        bi_print_index(fp, I->src[1]);
1314
1315
1316        break;
1317
1318    case BI_OPCODE_BRANCHZ_U16:
1319
1320        fputs(bi_cmpf_as_str(I->cmpf), fp);
1321
1322        fputs(" ", fp);
1323        bi_print_index(fp, I->src[0]);
1324
1325
1326        fputs(", ", fp);
1327        bi_print_index(fp, I->src[1]);
1328
1329
1330        break;
1331
1332    case BI_OPCODE_BRANCHZ_U32:
1333
1334        fputs(bi_cmpf_as_str(I->cmpf), fp);
1335
1336        fputs(" ", fp);
1337        bi_print_index(fp, I->src[0]);
1338
1339
1340        fputs(", ", fp);
1341        bi_print_index(fp, I->src[1]);
1342
1343
1344        break;
1345
1346    case BI_OPCODE_BRANCH_DIVERG:
1347
1348
1349        fputs(" ", fp);
1350        bi_print_index(fp, I->src[0]);
1351
1352
1353        break;
1354
1355    case BI_OPCODE_BRANCH_LOWBITS_F32:
1356
1357
1358        fputs(" ", fp);
1359        bi_print_index(fp, I->src[0]);
1360
1361
1362        fputs(", ", fp);
1363        bi_print_index(fp, I->src[1]);
1364
1365
1366        break;
1367
1368    case BI_OPCODE_BRANCH_NO_DIVERG:
1369
1370
1371        fputs(" ", fp);
1372        bi_print_index(fp, I->src[0]);
1373
1374
1375        break;
1376
1377    case BI_OPCODE_CLPER_I32:
1378
1379        fputs(bi_lane_op_as_str(I->lane_op), fp);
1380        fputs(bi_subgroup_as_str(I->subgroup), fp);
1381        fputs(bi_inactive_result_as_str(I->inactive_result), fp);
1382
1383        fputs(" ", fp);
1384        bi_print_index(fp, I->src[0]);
1385
1386
1387        fputs(", ", fp);
1388        bi_print_index(fp, I->src[1]);
1389
1390
1391        break;
1392
1393    case BI_OPCODE_CLPER_V6_I32:
1394
1395
1396        fputs(" ", fp);
1397        bi_print_index(fp, I->src[0]);
1398
1399
1400        fputs(", ", fp);
1401        bi_print_index(fp, I->src[1]);
1402
1403
1404        break;
1405
1406    case BI_OPCODE_CLZ_U32:
1407
1408        if (I->mask) fputs(".mask", fp);
1409
1410        fputs(" ", fp);
1411        bi_print_index(fp, I->src[0]);
1412
1413
1414        break;
1415
1416    case BI_OPCODE_CLZ_V2U16:
1417
1418        if (I->mask) fputs(".mask", fp);
1419
1420        fputs(" ", fp);
1421        bi_print_index(fp, I->src[0]);
1422
1423
1424        break;
1425
1426    case BI_OPCODE_CLZ_V4U8:
1427
1428        if (I->mask) fputs(".mask", fp);
1429
1430        fputs(" ", fp);
1431        bi_print_index(fp, I->src[0]);
1432
1433
1434        break;
1435
1436    case BI_OPCODE_CSEL_F32:
1437
1438        fputs(bi_cmpf_as_str(I->cmpf), fp);
1439
1440        fputs(" ", fp);
1441        bi_print_index(fp, I->src[0]);
1442
1443
1444        fputs(", ", fp);
1445        bi_print_index(fp, I->src[1]);
1446
1447
1448        fputs(", ", fp);
1449        bi_print_index(fp, I->src[2]);
1450
1451
1452        fputs(", ", fp);
1453        bi_print_index(fp, I->src[3]);
1454
1455
1456        break;
1457
1458    case BI_OPCODE_CSEL_I32:
1459
1460        fputs(bi_cmpf_as_str(I->cmpf), fp);
1461
1462        fputs(" ", fp);
1463        bi_print_index(fp, I->src[0]);
1464
1465
1466        fputs(", ", fp);
1467        bi_print_index(fp, I->src[1]);
1468
1469
1470        fputs(", ", fp);
1471        bi_print_index(fp, I->src[2]);
1472
1473
1474        fputs(", ", fp);
1475        bi_print_index(fp, I->src[3]);
1476
1477
1478        break;
1479
1480    case BI_OPCODE_CSEL_S32:
1481
1482        fputs(bi_cmpf_as_str(I->cmpf), fp);
1483
1484        fputs(" ", fp);
1485        bi_print_index(fp, I->src[0]);
1486
1487
1488        fputs(", ", fp);
1489        bi_print_index(fp, I->src[1]);
1490
1491
1492        fputs(", ", fp);
1493        bi_print_index(fp, I->src[2]);
1494
1495
1496        fputs(", ", fp);
1497        bi_print_index(fp, I->src[3]);
1498
1499
1500        break;
1501
1502    case BI_OPCODE_CSEL_U32:
1503
1504        fputs(bi_cmpf_as_str(I->cmpf), fp);
1505
1506        fputs(" ", fp);
1507        bi_print_index(fp, I->src[0]);
1508
1509
1510        fputs(", ", fp);
1511        bi_print_index(fp, I->src[1]);
1512
1513
1514        fputs(", ", fp);
1515        bi_print_index(fp, I->src[2]);
1516
1517
1518        fputs(", ", fp);
1519        bi_print_index(fp, I->src[3]);
1520
1521
1522        break;
1523
1524    case BI_OPCODE_CSEL_V2F16:
1525
1526        fputs(bi_cmpf_as_str(I->cmpf), fp);
1527
1528        fputs(" ", fp);
1529        bi_print_index(fp, I->src[0]);
1530
1531
1532        fputs(", ", fp);
1533        bi_print_index(fp, I->src[1]);
1534
1535
1536        fputs(", ", fp);
1537        bi_print_index(fp, I->src[2]);
1538
1539
1540        fputs(", ", fp);
1541        bi_print_index(fp, I->src[3]);
1542
1543
1544        break;
1545
1546    case BI_OPCODE_CSEL_V2I16:
1547
1548        fputs(bi_cmpf_as_str(I->cmpf), fp);
1549
1550        fputs(" ", fp);
1551        bi_print_index(fp, I->src[0]);
1552
1553
1554        fputs(", ", fp);
1555        bi_print_index(fp, I->src[1]);
1556
1557
1558        fputs(", ", fp);
1559        bi_print_index(fp, I->src[2]);
1560
1561
1562        fputs(", ", fp);
1563        bi_print_index(fp, I->src[3]);
1564
1565
1566        break;
1567
1568    case BI_OPCODE_CSEL_V2S16:
1569
1570        fputs(bi_cmpf_as_str(I->cmpf), fp);
1571
1572        fputs(" ", fp);
1573        bi_print_index(fp, I->src[0]);
1574
1575
1576        fputs(", ", fp);
1577        bi_print_index(fp, I->src[1]);
1578
1579
1580        fputs(", ", fp);
1581        bi_print_index(fp, I->src[2]);
1582
1583
1584        fputs(", ", fp);
1585        bi_print_index(fp, I->src[3]);
1586
1587
1588        break;
1589
1590    case BI_OPCODE_CSEL_V2U16:
1591
1592        fputs(bi_cmpf_as_str(I->cmpf), fp);
1593
1594        fputs(" ", fp);
1595        bi_print_index(fp, I->src[0]);
1596
1597
1598        fputs(", ", fp);
1599        bi_print_index(fp, I->src[1]);
1600
1601
1602        fputs(", ", fp);
1603        bi_print_index(fp, I->src[2]);
1604
1605
1606        fputs(", ", fp);
1607        bi_print_index(fp, I->src[3]);
1608
1609
1610        break;
1611
1612    case BI_OPCODE_CUBEFACE:
1613
1614
1615        fputs(" ", fp);
1616        bi_print_index(fp, I->src[0]);
1617
1618
1619        fputs(", ", fp);
1620        bi_print_index(fp, I->src[1]);
1621
1622
1623        fputs(", ", fp);
1624        bi_print_index(fp, I->src[2]);
1625
1626
1627        break;
1628
1629    case BI_OPCODE_CUBEFACE1:
1630
1631
1632        fputs(" ", fp);
1633        bi_print_index(fp, I->src[0]);
1634
1635
1636        fputs(", ", fp);
1637        bi_print_index(fp, I->src[1]);
1638
1639
1640        fputs(", ", fp);
1641        bi_print_index(fp, I->src[2]);
1642
1643
1644        break;
1645
1646    case BI_OPCODE_CUBEFACE2:
1647
1648
1649        fputs(" ", fp);
1650        bi_print_index(fp, I->src[0]);
1651
1652
1653        break;
1654
1655    case BI_OPCODE_CUBE_SSEL:
1656
1657
1658        fputs(" ", fp);
1659        bi_print_index(fp, I->src[0]);
1660
1661
1662        fputs(", ", fp);
1663        bi_print_index(fp, I->src[1]);
1664
1665
1666        fputs(", ", fp);
1667        bi_print_index(fp, I->src[2]);
1668
1669
1670        break;
1671
1672    case BI_OPCODE_CUBE_TSEL:
1673
1674
1675        fputs(" ", fp);
1676        bi_print_index(fp, I->src[0]);
1677
1678
1679        fputs(", ", fp);
1680        bi_print_index(fp, I->src[1]);
1681
1682
1683        fputs(", ", fp);
1684        bi_print_index(fp, I->src[2]);
1685
1686
1687        break;
1688
1689    case BI_OPCODE_DISCARD_B32:
1690
1691
1692        fputs(" ", fp);
1693        bi_print_index(fp, I->src[0]);
1694
1695
1696        break;
1697
1698    case BI_OPCODE_DISCARD_F32:
1699
1700        fputs(bi_cmpf_as_str(I->cmpf), fp);
1701
1702        fputs(" ", fp);
1703        bi_print_index(fp, I->src[0]);
1704
1705
1706        fputs(", ", fp);
1707        bi_print_index(fp, I->src[1]);
1708
1709
1710        break;
1711
1712    case BI_OPCODE_DTSEL_IMM:
1713
1714        fputs(bi_table_as_str(I->table), fp);
1715
1716        fputs(" ", fp);
1717        bi_print_index(fp, I->src[0]);
1718
1719
1720        break;
1721
1722    case BI_OPCODE_F16_TO_F32:
1723
1724
1725        fputs(" ", fp);
1726        bi_print_index(fp, I->src[0]);
1727
1728
1729        break;
1730
1731    case BI_OPCODE_F16_TO_S32:
1732
1733        fputs(bi_round_as_str(I->round), fp);
1734
1735        fputs(" ", fp);
1736        bi_print_index(fp, I->src[0]);
1737
1738
1739        break;
1740
1741    case BI_OPCODE_F16_TO_U32:
1742
1743        fputs(bi_round_as_str(I->round), fp);
1744
1745        fputs(" ", fp);
1746        bi_print_index(fp, I->src[0]);
1747
1748
1749        break;
1750
1751    case BI_OPCODE_F32_TO_S32:
1752
1753        fputs(bi_round_as_str(I->round), fp);
1754
1755        fputs(" ", fp);
1756        bi_print_index(fp, I->src[0]);
1757
1758
1759        break;
1760
1761    case BI_OPCODE_F32_TO_U32:
1762
1763        fputs(bi_round_as_str(I->round), fp);
1764
1765        fputs(" ", fp);
1766        bi_print_index(fp, I->src[0]);
1767
1768
1769        break;
1770
1771    case BI_OPCODE_FABSNEG_F32:
1772
1773
1774        fputs(" ", fp);
1775        bi_print_index(fp, I->src[0]);
1776
1777
1778        break;
1779
1780    case BI_OPCODE_FABSNEG_V2F16:
1781
1782
1783        fputs(" ", fp);
1784        bi_print_index(fp, I->src[0]);
1785
1786
1787        break;
1788
1789    case BI_OPCODE_FADD_F32:
1790
1791        fputs(bi_round_as_str(I->round), fp);
1792        fputs(bi_clamp_as_str(I->clamp), fp);
1793
1794        fputs(" ", fp);
1795        bi_print_index(fp, I->src[0]);
1796
1797
1798        fputs(", ", fp);
1799        bi_print_index(fp, I->src[1]);
1800
1801
1802        break;
1803
1804    case BI_OPCODE_FADD_V2F16:
1805
1806        fputs(bi_round_as_str(I->round), fp);
1807        fputs(bi_clamp_as_str(I->clamp), fp);
1808
1809        fputs(" ", fp);
1810        bi_print_index(fp, I->src[0]);
1811
1812
1813        fputs(", ", fp);
1814        bi_print_index(fp, I->src[1]);
1815
1816
1817        break;
1818
1819    case BI_OPCODE_FADD_IMM_F32:
1820
1821
1822        fputs(" ", fp);
1823        bi_print_index(fp, I->src[0]);
1824
1825
1826        fprintf(fp, ", index:%u", I->index);
1827        break;
1828
1829    case BI_OPCODE_FADD_IMM_V2F16:
1830
1831
1832        fputs(" ", fp);
1833        bi_print_index(fp, I->src[0]);
1834
1835
1836        fprintf(fp, ", index:%u", I->index);
1837        break;
1838
1839    case BI_OPCODE_FADD_LSCALE_F32:
1840
1841
1842        fputs(" ", fp);
1843        bi_print_index(fp, I->src[0]);
1844
1845
1846        fputs(", ", fp);
1847        bi_print_index(fp, I->src[1]);
1848
1849
1850        break;
1851
1852    case BI_OPCODE_FADD_RSCALE_F32:
1853
1854        fputs(bi_clamp_as_str(I->clamp), fp);
1855        fputs(bi_special_as_str(I->special), fp);
1856        fputs(bi_round_as_str(I->round), fp);
1857
1858        fputs(" ", fp);
1859        bi_print_index(fp, I->src[0]);
1860
1861
1862        fputs(", ", fp);
1863        bi_print_index(fp, I->src[1]);
1864
1865
1866        fputs(", ", fp);
1867        bi_print_index(fp, I->src[2]);
1868
1869
1870        break;
1871
1872    case BI_OPCODE_FCLAMP_F32:
1873
1874        fputs(bi_clamp_as_str(I->clamp), fp);
1875
1876        fputs(" ", fp);
1877        bi_print_index(fp, I->src[0]);
1878
1879
1880        break;
1881
1882    case BI_OPCODE_FCLAMP_V2F16:
1883
1884        fputs(bi_clamp_as_str(I->clamp), fp);
1885
1886        fputs(" ", fp);
1887        bi_print_index(fp, I->src[0]);
1888
1889
1890        break;
1891
1892    case BI_OPCODE_FCMP_F32:
1893
1894        fputs(bi_cmpf_as_str(I->cmpf), fp);
1895        fputs(bi_result_type_as_str(I->result_type), fp);
1896
1897        fputs(" ", fp);
1898        bi_print_index(fp, I->src[0]);
1899
1900
1901        fputs(", ", fp);
1902        bi_print_index(fp, I->src[1]);
1903
1904
1905        break;
1906
1907    case BI_OPCODE_FCMP_V2F16:
1908
1909        fputs(bi_cmpf_as_str(I->cmpf), fp);
1910        fputs(bi_result_type_as_str(I->result_type), fp);
1911
1912        fputs(" ", fp);
1913        bi_print_index(fp, I->src[0]);
1914
1915
1916        fputs(", ", fp);
1917        bi_print_index(fp, I->src[1]);
1918
1919
1920        break;
1921
1922    case BI_OPCODE_FCOS_TABLE_U6:
1923
1924        if (I->offset) fputs(".offset", fp);
1925
1926        fputs(" ", fp);
1927        bi_print_index(fp, I->src[0]);
1928
1929
1930        break;
1931
1932    case BI_OPCODE_FEXP_F32:
1933
1934
1935        fputs(" ", fp);
1936        bi_print_index(fp, I->src[0]);
1937
1938
1939        fputs(", ", fp);
1940        bi_print_index(fp, I->src[1]);
1941
1942
1943        break;
1944
1945    case BI_OPCODE_FEXP_TABLE_U4:
1946
1947        fputs(bi_adj_as_str(I->adj), fp);
1948
1949        fputs(" ", fp);
1950        bi_print_index(fp, I->src[0]);
1951
1952
1953        break;
1954
1955    case BI_OPCODE_FLOGD_F32:
1956
1957
1958        fputs(" ", fp);
1959        bi_print_index(fp, I->src[0]);
1960
1961
1962        break;
1963
1964    case BI_OPCODE_FLOG_TABLE_F32:
1965
1966        fputs(bi_mode_as_str(I->mode), fp);
1967        fputs(bi_precision_as_str(I->precision), fp);
1968        if (I->divzero) fputs(".divzero", fp);
1969
1970        fputs(" ", fp);
1971        bi_print_index(fp, I->src[0]);
1972
1973
1974        break;
1975
1976    case BI_OPCODE_FLSHIFT_DOUBLE_I32:
1977
1978
1979        fputs(" ", fp);
1980        bi_print_index(fp, I->src[0]);
1981
1982
1983        fputs(", ", fp);
1984        bi_print_index(fp, I->src[1]);
1985
1986
1987        fputs(", ", fp);
1988        bi_print_index(fp, I->src[2]);
1989
1990        if (I->bytes2) fputs(".bytes", fp);
1991
1992        break;
1993
1994    case BI_OPCODE_FMA_F32:
1995
1996        fputs(bi_round_as_str(I->round), fp);
1997        fputs(bi_clamp_as_str(I->clamp), fp);
1998
1999        fputs(" ", fp);
2000        bi_print_index(fp, I->src[0]);
2001
2002
2003        fputs(", ", fp);
2004        bi_print_index(fp, I->src[1]);
2005
2006
2007        fputs(", ", fp);
2008        bi_print_index(fp, I->src[2]);
2009
2010
2011        break;
2012
2013    case BI_OPCODE_FMA_V2F16:
2014
2015        fputs(bi_round_as_str(I->round), fp);
2016        fputs(bi_clamp_as_str(I->clamp), fp);
2017
2018        fputs(" ", fp);
2019        bi_print_index(fp, I->src[0]);
2020
2021
2022        fputs(", ", fp);
2023        bi_print_index(fp, I->src[1]);
2024
2025
2026        fputs(", ", fp);
2027        bi_print_index(fp, I->src[2]);
2028
2029
2030        break;
2031
2032    case BI_OPCODE_FMAX_F32:
2033
2034        fputs(bi_clamp_as_str(I->clamp), fp);
2035        fputs(bi_sem_as_str(I->sem), fp);
2036
2037        fputs(" ", fp);
2038        bi_print_index(fp, I->src[0]);
2039
2040
2041        fputs(", ", fp);
2042        bi_print_index(fp, I->src[1]);
2043
2044
2045        break;
2046
2047    case BI_OPCODE_FMAX_V2F16:
2048
2049        fputs(bi_sem_as_str(I->sem), fp);
2050
2051        fputs(" ", fp);
2052        bi_print_index(fp, I->src[0]);
2053
2054
2055        fputs(", ", fp);
2056        bi_print_index(fp, I->src[1]);
2057
2058
2059        break;
2060
2061    case BI_OPCODE_FMA_RSCALE_F32:
2062
2063        fputs(bi_round_as_str(I->round), fp);
2064        fputs(bi_clamp_as_str(I->clamp), fp);
2065        fputs(bi_special_as_str(I->special), fp);
2066
2067        fputs(" ", fp);
2068        bi_print_index(fp, I->src[0]);
2069
2070
2071        fputs(", ", fp);
2072        bi_print_index(fp, I->src[1]);
2073
2074
2075        fputs(", ", fp);
2076        bi_print_index(fp, I->src[2]);
2077
2078
2079        fputs(", ", fp);
2080        bi_print_index(fp, I->src[3]);
2081
2082
2083        break;
2084
2085    case BI_OPCODE_FMA_RSCALE_V2F16:
2086
2087        fputs(bi_round_as_str(I->round), fp);
2088        fputs(bi_clamp_as_str(I->clamp), fp);
2089        fputs(bi_special_as_str(I->special), fp);
2090
2091        fputs(" ", fp);
2092        bi_print_index(fp, I->src[0]);
2093
2094
2095        fputs(", ", fp);
2096        bi_print_index(fp, I->src[1]);
2097
2098
2099        fputs(", ", fp);
2100        bi_print_index(fp, I->src[2]);
2101
2102
2103        fputs(", ", fp);
2104        bi_print_index(fp, I->src[3]);
2105
2106
2107        break;
2108
2109    case BI_OPCODE_FMIN_F32:
2110
2111        fputs(bi_clamp_as_str(I->clamp), fp);
2112        fputs(bi_sem_as_str(I->sem), fp);
2113
2114        fputs(" ", fp);
2115        bi_print_index(fp, I->src[0]);
2116
2117
2118        fputs(", ", fp);
2119        bi_print_index(fp, I->src[1]);
2120
2121
2122        break;
2123
2124    case BI_OPCODE_FMIN_V2F16:
2125
2126        fputs(bi_sem_as_str(I->sem), fp);
2127
2128        fputs(" ", fp);
2129        bi_print_index(fp, I->src[0]);
2130
2131
2132        fputs(", ", fp);
2133        bi_print_index(fp, I->src[1]);
2134
2135
2136        break;
2137
2138    case BI_OPCODE_FMUL_CSLICE:
2139
2140
2141        fputs(" ", fp);
2142        bi_print_index(fp, I->src[0]);
2143
2144
2145        fputs(", ", fp);
2146        bi_print_index(fp, I->src[1]);
2147
2148
2149        break;
2150
2151    case BI_OPCODE_FMUL_SLICE_F32:
2152
2153
2154        fputs(" ", fp);
2155        bi_print_index(fp, I->src[0]);
2156
2157
2158        fputs(", ", fp);
2159        bi_print_index(fp, I->src[1]);
2160
2161
2162        break;
2163
2164    case BI_OPCODE_FPCLASS_F16:
2165
2166
2167        fputs(" ", fp);
2168        bi_print_index(fp, I->src[0]);
2169
2170
2171        break;
2172
2173    case BI_OPCODE_FPCLASS_F32:
2174
2175
2176        fputs(" ", fp);
2177        bi_print_index(fp, I->src[0]);
2178
2179
2180        break;
2181
2182    case BI_OPCODE_FPOW_SC_APPLY:
2183
2184
2185        fputs(" ", fp);
2186        bi_print_index(fp, I->src[0]);
2187
2188
2189        fputs(", ", fp);
2190        bi_print_index(fp, I->src[1]);
2191
2192
2193        break;
2194
2195    case BI_OPCODE_FPOW_SC_DET_F16:
2196
2197        fputs(bi_func_as_str(I->func), fp);
2198
2199        fputs(" ", fp);
2200        bi_print_index(fp, I->src[0]);
2201
2202
2203        fputs(", ", fp);
2204        bi_print_index(fp, I->src[1]);
2205
2206
2207        break;
2208
2209    case BI_OPCODE_FPOW_SC_DET_F32:
2210
2211        fputs(bi_func_as_str(I->func), fp);
2212
2213        fputs(" ", fp);
2214        bi_print_index(fp, I->src[0]);
2215
2216
2217        fputs(", ", fp);
2218        bi_print_index(fp, I->src[1]);
2219
2220
2221        break;
2222
2223    case BI_OPCODE_FRCP_F16:
2224
2225        if (I->divzero) fputs(".divzero", fp);
2226
2227        fputs(" ", fp);
2228        bi_print_index(fp, I->src[0]);
2229
2230
2231        break;
2232
2233    case BI_OPCODE_FRCP_F32:
2234
2235
2236        fputs(" ", fp);
2237        bi_print_index(fp, I->src[0]);
2238
2239
2240        break;
2241
2242    case BI_OPCODE_FRCP_APPROX_F32:
2243
2244        if (I->divzero) fputs(".divzero", fp);
2245
2246        fputs(" ", fp);
2247        bi_print_index(fp, I->src[0]);
2248
2249
2250        break;
2251
2252    case BI_OPCODE_FREXPE_F32:
2253
2254        if (I->sqrt) fputs(".sqrt", fp);
2255        if (I->log) fputs(".log", fp);
2256
2257        fputs(" ", fp);
2258        bi_print_index(fp, I->src[0]);
2259
2260
2261        break;
2262
2263    case BI_OPCODE_FREXPE_V2F16:
2264
2265        if (I->sqrt) fputs(".sqrt", fp);
2266        if (I->log) fputs(".log", fp);
2267
2268        fputs(" ", fp);
2269        bi_print_index(fp, I->src[0]);
2270
2271
2272        break;
2273
2274    case BI_OPCODE_FREXPM_F32:
2275
2276        if (I->sqrt) fputs(".sqrt", fp);
2277        if (I->log) fputs(".log", fp);
2278
2279        fputs(" ", fp);
2280        bi_print_index(fp, I->src[0]);
2281
2282
2283        break;
2284
2285    case BI_OPCODE_FREXPM_V2F16:
2286
2287        if (I->sqrt) fputs(".sqrt", fp);
2288        if (I->log) fputs(".log", fp);
2289
2290        fputs(" ", fp);
2291        bi_print_index(fp, I->src[0]);
2292
2293
2294        break;
2295
2296    case BI_OPCODE_FROUND_F32:
2297
2298        fputs(bi_round_as_str(I->round), fp);
2299
2300        fputs(" ", fp);
2301        bi_print_index(fp, I->src[0]);
2302
2303
2304        break;
2305
2306    case BI_OPCODE_FROUND_V2F16:
2307
2308        fputs(bi_round_as_str(I->round), fp);
2309
2310        fputs(" ", fp);
2311        bi_print_index(fp, I->src[0]);
2312
2313
2314        break;
2315
2316    case BI_OPCODE_FRSCALE_F32:
2317
2318        fputs(bi_clamp_as_str(I->clamp), fp);
2319
2320        fputs(" ", fp);
2321        bi_print_index(fp, I->src[0]);
2322
2323
2324        fputs(", ", fp);
2325        bi_print_index(fp, I->src[1]);
2326
2327
2328        break;
2329
2330    case BI_OPCODE_FRSCALE_V2F16:
2331
2332        fputs(bi_clamp_as_str(I->clamp), fp);
2333
2334        fputs(" ", fp);
2335        bi_print_index(fp, I->src[0]);
2336
2337
2338        fputs(", ", fp);
2339        bi_print_index(fp, I->src[1]);
2340
2341
2342        break;
2343
2344    case BI_OPCODE_FRSHIFT_DOUBLE_I32:
2345
2346
2347        fputs(" ", fp);
2348        bi_print_index(fp, I->src[0]);
2349
2350
2351        fputs(", ", fp);
2352        bi_print_index(fp, I->src[1]);
2353
2354
2355        fputs(", ", fp);
2356        bi_print_index(fp, I->src[2]);
2357
2358        if (I->bytes2) fputs(".bytes", fp);
2359
2360        break;
2361
2362    case BI_OPCODE_FRSQ_F16:
2363
2364        if (I->divzero) fputs(".divzero", fp);
2365
2366        fputs(" ", fp);
2367        bi_print_index(fp, I->src[0]);
2368
2369
2370        break;
2371
2372    case BI_OPCODE_FRSQ_F32:
2373
2374
2375        fputs(" ", fp);
2376        bi_print_index(fp, I->src[0]);
2377
2378
2379        break;
2380
2381    case BI_OPCODE_FRSQ_APPROX_F32:
2382
2383        if (I->divzero) fputs(".divzero", fp);
2384
2385        fputs(" ", fp);
2386        bi_print_index(fp, I->src[0]);
2387
2388
2389        break;
2390
2391    case BI_OPCODE_FSINCOS_OFFSET_U6:
2392
2393        if (I->scale) fputs(".scale", fp);
2394
2395        fputs(" ", fp);
2396        bi_print_index(fp, I->src[0]);
2397
2398
2399        break;
2400
2401    case BI_OPCODE_FSIN_TABLE_U6:
2402
2403        if (I->offset) fputs(".offset", fp);
2404
2405        fputs(" ", fp);
2406        bi_print_index(fp, I->src[0]);
2407
2408
2409        break;
2410
2411    case BI_OPCODE_HADD_S32:
2412
2413        fputs(bi_round_as_str(I->round), fp);
2414
2415        fputs(" ", fp);
2416        bi_print_index(fp, I->src[0]);
2417
2418
2419        fputs(", ", fp);
2420        bi_print_index(fp, I->src[1]);
2421
2422
2423        break;
2424
2425    case BI_OPCODE_HADD_U32:
2426
2427        fputs(bi_round_as_str(I->round), fp);
2428
2429        fputs(" ", fp);
2430        bi_print_index(fp, I->src[0]);
2431
2432
2433        fputs(", ", fp);
2434        bi_print_index(fp, I->src[1]);
2435
2436
2437        break;
2438
2439    case BI_OPCODE_HADD_V2S16:
2440
2441        fputs(bi_round_as_str(I->round), fp);
2442
2443        fputs(" ", fp);
2444        bi_print_index(fp, I->src[0]);
2445
2446
2447        fputs(", ", fp);
2448        bi_print_index(fp, I->src[1]);
2449
2450
2451        break;
2452
2453    case BI_OPCODE_HADD_V2U16:
2454
2455        fputs(bi_round_as_str(I->round), fp);
2456
2457        fputs(" ", fp);
2458        bi_print_index(fp, I->src[0]);
2459
2460
2461        fputs(", ", fp);
2462        bi_print_index(fp, I->src[1]);
2463
2464
2465        break;
2466
2467    case BI_OPCODE_HADD_V4S8:
2468
2469        fputs(bi_round_as_str(I->round), fp);
2470
2471        fputs(" ", fp);
2472        bi_print_index(fp, I->src[0]);
2473
2474
2475        fputs(", ", fp);
2476        bi_print_index(fp, I->src[1]);
2477
2478
2479        break;
2480
2481    case BI_OPCODE_HADD_V4U8:
2482
2483        fputs(bi_round_as_str(I->round), fp);
2484
2485        fputs(" ", fp);
2486        bi_print_index(fp, I->src[0]);
2487
2488
2489        fputs(", ", fp);
2490        bi_print_index(fp, I->src[1]);
2491
2492
2493        break;
2494
2495    case BI_OPCODE_IABS_S32:
2496
2497
2498        fputs(" ", fp);
2499        bi_print_index(fp, I->src[0]);
2500
2501
2502        break;
2503
2504    case BI_OPCODE_IABS_V2S16:
2505
2506
2507        fputs(" ", fp);
2508        bi_print_index(fp, I->src[0]);
2509
2510
2511        break;
2512
2513    case BI_OPCODE_IABS_V4S8:
2514
2515
2516        fputs(" ", fp);
2517        bi_print_index(fp, I->src[0]);
2518
2519
2520        break;
2521
2522    case BI_OPCODE_IADD_S32:
2523
2524        if (I->saturate) fputs(".saturate", fp);
2525
2526        fputs(" ", fp);
2527        bi_print_index(fp, I->src[0]);
2528
2529
2530        fputs(", ", fp);
2531        bi_print_index(fp, I->src[1]);
2532
2533
2534        break;
2535
2536    case BI_OPCODE_IADD_U32:
2537
2538        if (I->saturate) fputs(".saturate", fp);
2539
2540        fputs(" ", fp);
2541        bi_print_index(fp, I->src[0]);
2542
2543
2544        fputs(", ", fp);
2545        bi_print_index(fp, I->src[1]);
2546
2547
2548        break;
2549
2550    case BI_OPCODE_IADD_V2S16:
2551
2552        if (I->saturate) fputs(".saturate", fp);
2553
2554        fputs(" ", fp);
2555        bi_print_index(fp, I->src[0]);
2556
2557
2558        fputs(", ", fp);
2559        bi_print_index(fp, I->src[1]);
2560
2561
2562        break;
2563
2564    case BI_OPCODE_IADD_V2U16:
2565
2566        if (I->saturate) fputs(".saturate", fp);
2567
2568        fputs(" ", fp);
2569        bi_print_index(fp, I->src[0]);
2570
2571
2572        fputs(", ", fp);
2573        bi_print_index(fp, I->src[1]);
2574
2575
2576        break;
2577
2578    case BI_OPCODE_IADD_V4S8:
2579
2580        if (I->saturate) fputs(".saturate", fp);
2581
2582        fputs(" ", fp);
2583        bi_print_index(fp, I->src[0]);
2584
2585
2586        fputs(", ", fp);
2587        bi_print_index(fp, I->src[1]);
2588
2589
2590        break;
2591
2592    case BI_OPCODE_IADD_V4U8:
2593
2594        if (I->saturate) fputs(".saturate", fp);
2595
2596        fputs(" ", fp);
2597        bi_print_index(fp, I->src[0]);
2598
2599
2600        fputs(", ", fp);
2601        bi_print_index(fp, I->src[1]);
2602
2603
2604        break;
2605
2606    case BI_OPCODE_IADDC_I32:
2607
2608
2609        fputs(" ", fp);
2610        bi_print_index(fp, I->src[0]);
2611
2612
2613        fputs(", ", fp);
2614        bi_print_index(fp, I->src[1]);
2615
2616
2617        fputs(", ", fp);
2618        bi_print_index(fp, I->src[2]);
2619
2620
2621        break;
2622
2623    case BI_OPCODE_IADD_IMM_I32:
2624
2625
2626        fputs(" ", fp);
2627        bi_print_index(fp, I->src[0]);
2628
2629
2630        fprintf(fp, ", index:%u", I->index);
2631        break;
2632
2633    case BI_OPCODE_IADD_IMM_V2I16:
2634
2635
2636        fputs(" ", fp);
2637        bi_print_index(fp, I->src[0]);
2638
2639
2640        fprintf(fp, ", index:%u", I->index);
2641        break;
2642
2643    case BI_OPCODE_IADD_IMM_V4I8:
2644
2645
2646        fputs(" ", fp);
2647        bi_print_index(fp, I->src[0]);
2648
2649
2650        fprintf(fp, ", index:%u", I->index);
2651        break;
2652
2653    case BI_OPCODE_ICMP_I32:
2654
2655        fputs(bi_result_type_as_str(I->result_type), fp);
2656        fputs(bi_cmpf_as_str(I->cmpf), fp);
2657
2658        fputs(" ", fp);
2659        bi_print_index(fp, I->src[0]);
2660
2661
2662        fputs(", ", fp);
2663        bi_print_index(fp, I->src[1]);
2664
2665
2666        break;
2667
2668    case BI_OPCODE_ICMP_S32:
2669
2670        fputs(bi_result_type_as_str(I->result_type), fp);
2671        fputs(bi_cmpf_as_str(I->cmpf), fp);
2672
2673        fputs(" ", fp);
2674        bi_print_index(fp, I->src[0]);
2675
2676
2677        fputs(", ", fp);
2678        bi_print_index(fp, I->src[1]);
2679
2680
2681        break;
2682
2683    case BI_OPCODE_ICMP_U32:
2684
2685        fputs(bi_result_type_as_str(I->result_type), fp);
2686        fputs(bi_cmpf_as_str(I->cmpf), fp);
2687
2688        fputs(" ", fp);
2689        bi_print_index(fp, I->src[0]);
2690
2691
2692        fputs(", ", fp);
2693        bi_print_index(fp, I->src[1]);
2694
2695
2696        break;
2697
2698    case BI_OPCODE_ICMP_V2I16:
2699
2700        fputs(bi_result_type_as_str(I->result_type), fp);
2701        fputs(bi_cmpf_as_str(I->cmpf), fp);
2702
2703        fputs(" ", fp);
2704        bi_print_index(fp, I->src[0]);
2705
2706
2707        fputs(", ", fp);
2708        bi_print_index(fp, I->src[1]);
2709
2710
2711        break;
2712
2713    case BI_OPCODE_ICMP_V2S16:
2714
2715        fputs(bi_result_type_as_str(I->result_type), fp);
2716        fputs(bi_cmpf_as_str(I->cmpf), fp);
2717
2718        fputs(" ", fp);
2719        bi_print_index(fp, I->src[0]);
2720
2721
2722        fputs(", ", fp);
2723        bi_print_index(fp, I->src[1]);
2724
2725
2726        break;
2727
2728    case BI_OPCODE_ICMP_V2U16:
2729
2730        fputs(bi_result_type_as_str(I->result_type), fp);
2731        fputs(bi_cmpf_as_str(I->cmpf), fp);
2732
2733        fputs(" ", fp);
2734        bi_print_index(fp, I->src[0]);
2735
2736
2737        fputs(", ", fp);
2738        bi_print_index(fp, I->src[1]);
2739
2740
2741        break;
2742
2743    case BI_OPCODE_ICMP_V4I8:
2744
2745        fputs(bi_result_type_as_str(I->result_type), fp);
2746        fputs(bi_cmpf_as_str(I->cmpf), fp);
2747
2748        fputs(" ", fp);
2749        bi_print_index(fp, I->src[0]);
2750
2751
2752        fputs(", ", fp);
2753        bi_print_index(fp, I->src[1]);
2754
2755
2756        break;
2757
2758    case BI_OPCODE_ICMP_V4S8:
2759
2760        fputs(bi_result_type_as_str(I->result_type), fp);
2761        fputs(bi_cmpf_as_str(I->cmpf), fp);
2762
2763        fputs(" ", fp);
2764        bi_print_index(fp, I->src[0]);
2765
2766
2767        fputs(", ", fp);
2768        bi_print_index(fp, I->src[1]);
2769
2770
2771        break;
2772
2773    case BI_OPCODE_ICMP_V4U8:
2774
2775        fputs(bi_result_type_as_str(I->result_type), fp);
2776        fputs(bi_cmpf_as_str(I->cmpf), fp);
2777
2778        fputs(" ", fp);
2779        bi_print_index(fp, I->src[0]);
2780
2781
2782        fputs(", ", fp);
2783        bi_print_index(fp, I->src[1]);
2784
2785
2786        break;
2787
2788    case BI_OPCODE_ICMPF_I32:
2789
2790
2791        fputs(" ", fp);
2792        bi_print_index(fp, I->src[0]);
2793
2794
2795        fputs(", ", fp);
2796        bi_print_index(fp, I->src[1]);
2797
2798
2799        fputs(", ", fp);
2800        bi_print_index(fp, I->src[2]);
2801
2802
2803        break;
2804
2805    case BI_OPCODE_ICMPI_I32:
2806
2807        fputs(bi_result_type_as_str(I->result_type), fp);
2808        fputs(bi_cmpf_as_str(I->cmpf), fp);
2809
2810        fputs(" ", fp);
2811        bi_print_index(fp, I->src[0]);
2812
2813
2814        fputs(", ", fp);
2815        bi_print_index(fp, I->src[1]);
2816
2817
2818        break;
2819
2820    case BI_OPCODE_ICMPI_S32:
2821
2822        fputs(bi_result_type_as_str(I->result_type), fp);
2823        fputs(bi_cmpf_as_str(I->cmpf), fp);
2824
2825        fputs(" ", fp);
2826        bi_print_index(fp, I->src[0]);
2827
2828
2829        fputs(", ", fp);
2830        bi_print_index(fp, I->src[1]);
2831
2832
2833        break;
2834
2835    case BI_OPCODE_ICMPI_U32:
2836
2837        fputs(bi_result_type_as_str(I->result_type), fp);
2838        fputs(bi_cmpf_as_str(I->cmpf), fp);
2839
2840        fputs(" ", fp);
2841        bi_print_index(fp, I->src[0]);
2842
2843
2844        fputs(", ", fp);
2845        bi_print_index(fp, I->src[1]);
2846
2847
2848        break;
2849
2850    case BI_OPCODE_ICMPM_I32:
2851
2852
2853        fputs(" ", fp);
2854        bi_print_index(fp, I->src[0]);
2855
2856
2857        fputs(", ", fp);
2858        bi_print_index(fp, I->src[1]);
2859
2860
2861        fputs(", ", fp);
2862        bi_print_index(fp, I->src[2]);
2863
2864
2865        break;
2866
2867    case BI_OPCODE_IDP_V4I8:
2868
2869
2870        fputs(" ", fp);
2871        bi_print_index(fp, I->src[0]);
2872
2873
2874        fputs(", ", fp);
2875        bi_print_index(fp, I->src[1]);
2876
2877
2878        break;
2879
2880    case BI_OPCODE_ILOGB_F32:
2881
2882
2883        fputs(" ", fp);
2884        bi_print_index(fp, I->src[0]);
2885
2886
2887        break;
2888
2889    case BI_OPCODE_ILOGB_V2F16:
2890
2891
2892        fputs(" ", fp);
2893        bi_print_index(fp, I->src[0]);
2894
2895
2896        break;
2897
2898    case BI_OPCODE_IMOV_FMA:
2899
2900        if (I->threads) fputs(".threads", fp);
2901
2902        fputs(" ", fp);
2903        break;
2904
2905    case BI_OPCODE_IMUL_I32:
2906
2907        fputs(bi_extend_as_str(I->extend), fp);
2908
2909        fputs(" ", fp);
2910        bi_print_index(fp, I->src[0]);
2911
2912
2913        fputs(", ", fp);
2914        bi_print_index(fp, I->src[1]);
2915
2916
2917        break;
2918
2919    case BI_OPCODE_IMUL_V2I16:
2920
2921
2922        fputs(" ", fp);
2923        bi_print_index(fp, I->src[0]);
2924
2925
2926        fputs(", ", fp);
2927        bi_print_index(fp, I->src[1]);
2928
2929
2930        break;
2931
2932    case BI_OPCODE_IMUL_V4I8:
2933
2934
2935        fputs(" ", fp);
2936        bi_print_index(fp, I->src[0]);
2937
2938
2939        fputs(", ", fp);
2940        bi_print_index(fp, I->src[1]);
2941
2942
2943        break;
2944
2945    case BI_OPCODE_IMULD:
2946
2947        if (I->threads) fputs(".threads", fp);
2948
2949        fputs(" ", fp);
2950        bi_print_index(fp, I->src[0]);
2951
2952
2953        fputs(", ", fp);
2954        bi_print_index(fp, I->src[1]);
2955
2956
2957        break;
2958
2959    case BI_OPCODE_ISUB_S32:
2960
2961        if (I->saturate) fputs(".saturate", fp);
2962
2963        fputs(" ", fp);
2964        bi_print_index(fp, I->src[0]);
2965
2966
2967        fputs(", ", fp);
2968        bi_print_index(fp, I->src[1]);
2969
2970
2971        break;
2972
2973    case BI_OPCODE_ISUB_U32:
2974
2975        if (I->saturate) fputs(".saturate", fp);
2976
2977        fputs(" ", fp);
2978        bi_print_index(fp, I->src[0]);
2979
2980
2981        fputs(", ", fp);
2982        bi_print_index(fp, I->src[1]);
2983
2984
2985        break;
2986
2987    case BI_OPCODE_ISUB_V2S16:
2988
2989        if (I->saturate) fputs(".saturate", fp);
2990
2991        fputs(" ", fp);
2992        bi_print_index(fp, I->src[0]);
2993
2994
2995        fputs(", ", fp);
2996        bi_print_index(fp, I->src[1]);
2997
2998
2999        break;
3000
3001    case BI_OPCODE_ISUB_V2U16:
3002
3003        if (I->saturate) fputs(".saturate", fp);
3004
3005        fputs(" ", fp);
3006        bi_print_index(fp, I->src[0]);
3007
3008
3009        fputs(", ", fp);
3010        bi_print_index(fp, I->src[1]);
3011
3012
3013        break;
3014
3015    case BI_OPCODE_ISUB_V4S8:
3016
3017        if (I->saturate) fputs(".saturate", fp);
3018
3019        fputs(" ", fp);
3020        bi_print_index(fp, I->src[0]);
3021
3022
3023        fputs(", ", fp);
3024        bi_print_index(fp, I->src[1]);
3025
3026
3027        break;
3028
3029    case BI_OPCODE_ISUB_V4U8:
3030
3031        if (I->saturate) fputs(".saturate", fp);
3032
3033        fputs(" ", fp);
3034        bi_print_index(fp, I->src[0]);
3035
3036
3037        fputs(", ", fp);
3038        bi_print_index(fp, I->src[1]);
3039
3040
3041        break;
3042
3043    case BI_OPCODE_ISUBB_I32:
3044
3045
3046        fputs(" ", fp);
3047        bi_print_index(fp, I->src[0]);
3048
3049
3050        fputs(", ", fp);
3051        bi_print_index(fp, I->src[1]);
3052
3053
3054        fputs(", ", fp);
3055        bi_print_index(fp, I->src[2]);
3056
3057
3058        break;
3059
3060    case BI_OPCODE_JUMP:
3061
3062
3063        fputs(" ", fp);
3064        bi_print_index(fp, I->src[0]);
3065
3066
3067        break;
3068
3069    case BI_OPCODE_JUMP_EX:
3070
3071        if (I->test_mode) fputs(".test_mode", fp);
3072        fputs(bi_stack_mode_as_str(I->stack_mode), fp);
3073
3074        fputs(" ", fp);
3075        bi_print_index(fp, I->src[0]);
3076
3077
3078        fputs(", ", fp);
3079        bi_print_index(fp, I->src[1]);
3080
3081
3082        fputs(", ", fp);
3083        bi_print_index(fp, I->src[2]);
3084
3085
3086        break;
3087
3088    case BI_OPCODE_LDEXP_F32:
3089
3090        fputs(bi_round_as_str(I->round), fp);
3091
3092        fputs(" ", fp);
3093        bi_print_index(fp, I->src[0]);
3094
3095
3096        fputs(", ", fp);
3097        bi_print_index(fp, I->src[1]);
3098
3099
3100        break;
3101
3102    case BI_OPCODE_LDEXP_V2F16:
3103
3104        fputs(bi_round_as_str(I->round), fp);
3105
3106        fputs(" ", fp);
3107        bi_print_index(fp, I->src[0]);
3108
3109
3110        fputs(", ", fp);
3111        bi_print_index(fp, I->src[1]);
3112
3113
3114        break;
3115
3116    case BI_OPCODE_LD_ATTR:
3117
3118        fputs(bi_register_format_as_str(I->register_format), fp);
3119        fputs(bi_vecsize_as_str(I->vecsize), fp);
3120
3121        fputs(" ", fp);
3122        bi_print_index(fp, I->src[0]);
3123
3124
3125        fputs(", ", fp);
3126        bi_print_index(fp, I->src[1]);
3127
3128
3129        fputs(", ", fp);
3130        bi_print_index(fp, I->src[2]);
3131
3132
3133        break;
3134
3135    case BI_OPCODE_LD_ATTR_IMM:
3136
3137        fputs(bi_register_format_as_str(I->register_format), fp);
3138        fputs(bi_vecsize_as_str(I->vecsize), fp);
3139
3140        fputs(" ", fp);
3141        bi_print_index(fp, I->src[0]);
3142
3143
3144        fputs(", ", fp);
3145        bi_print_index(fp, I->src[1]);
3146
3147
3148        fprintf(fp, ", attribute_index:%u", I->attribute_index);
3149        break;
3150
3151    case BI_OPCODE_LD_ATTR_TEX:
3152
3153        fputs(bi_register_format_as_str(I->register_format), fp);
3154        fputs(bi_vecsize_as_str(I->vecsize), fp);
3155
3156        fputs(" ", fp);
3157        bi_print_index(fp, I->src[0]);
3158
3159
3160        fputs(", ", fp);
3161        bi_print_index(fp, I->src[1]);
3162
3163
3164        fputs(", ", fp);
3165        bi_print_index(fp, I->src[2]);
3166
3167
3168        break;
3169
3170    case BI_OPCODE_LD_CVT:
3171
3172        fputs(bi_register_format_as_str(I->register_format), fp);
3173        fputs(bi_vecsize_as_str(I->vecsize), fp);
3174
3175        fputs(" ", fp);
3176        bi_print_index(fp, I->src[0]);
3177
3178
3179        fputs(", ", fp);
3180        bi_print_index(fp, I->src[1]);
3181
3182
3183        fputs(", ", fp);
3184        bi_print_index(fp, I->src[2]);
3185
3186
3187        break;
3188
3189    case BI_OPCODE_LD_GCLK_U64:
3190
3191        fputs(bi_source_as_str(I->source), fp);
3192
3193        fputs(" ", fp);
3194        break;
3195
3196    case BI_OPCODE_LD_TILE:
3197
3198        fputs(bi_vecsize_as_str(I->vecsize), fp);
3199
3200        fputs(" ", fp);
3201        bi_print_index(fp, I->src[0]);
3202
3203
3204        fputs(", ", fp);
3205        bi_print_index(fp, I->src[1]);
3206
3207
3208        fputs(", ", fp);
3209        bi_print_index(fp, I->src[2]);
3210
3211
3212        break;
3213
3214    case BI_OPCODE_LD_VAR:
3215
3216        fputs(bi_vecsize_as_str(I->vecsize), fp);
3217        fputs(bi_update_as_str(I->update), fp);
3218        fputs(bi_register_format_as_str(I->register_format), fp);
3219        fputs(bi_sample_as_str(I->sample), fp);
3220
3221        fputs(" ", fp);
3222        bi_print_index(fp, I->src[0]);
3223
3224
3225        fputs(", ", fp);
3226        bi_print_index(fp, I->src[1]);
3227
3228
3229        break;
3230
3231    case BI_OPCODE_LD_VAR_FLAT:
3232
3233        fputs(bi_vecsize_as_str(I->vecsize), fp);
3234        fputs(bi_register_format_as_str(I->register_format), fp);
3235        fputs(bi_function_as_str(I->function), fp);
3236
3237        fputs(" ", fp);
3238        bi_print_index(fp, I->src[0]);
3239
3240
3241        break;
3242
3243    case BI_OPCODE_LD_VAR_FLAT_IMM:
3244
3245        fputs(bi_vecsize_as_str(I->vecsize), fp);
3246        fputs(bi_register_format_as_str(I->register_format), fp);
3247        fputs(bi_function_as_str(I->function), fp);
3248
3249        fputs(" ", fp);
3250        fprintf(fp, ", index:%u", I->index);
3251        break;
3252
3253    case BI_OPCODE_LD_VAR_IMM:
3254
3255        fputs(bi_vecsize_as_str(I->vecsize), fp);
3256        fputs(bi_update_as_str(I->update), fp);
3257        fputs(bi_register_format_as_str(I->register_format), fp);
3258        fputs(bi_sample_as_str(I->sample), fp);
3259
3260        fputs(" ", fp);
3261        bi_print_index(fp, I->src[0]);
3262
3263
3264        fprintf(fp, ", index:%u", I->index);
3265        break;
3266
3267    case BI_OPCODE_LD_VAR_SPECIAL:
3268
3269        fputs(bi_varying_name_as_str(I->varying_name), fp);
3270        fputs(bi_vecsize_as_str(I->vecsize), fp);
3271        fputs(bi_update_as_str(I->update), fp);
3272        fputs(bi_register_format_as_str(I->register_format), fp);
3273        fputs(bi_sample_as_str(I->sample), fp);
3274
3275        fputs(" ", fp);
3276        bi_print_index(fp, I->src[0]);
3277
3278
3279        break;
3280
3281    case BI_OPCODE_LEA_ATTR:
3282
3283        fputs(bi_register_format_as_str(I->register_format), fp);
3284
3285        fputs(" ", fp);
3286        bi_print_index(fp, I->src[0]);
3287
3288
3289        fputs(", ", fp);
3290        bi_print_index(fp, I->src[1]);
3291
3292
3293        fputs(", ", fp);
3294        bi_print_index(fp, I->src[2]);
3295
3296
3297        break;
3298
3299    case BI_OPCODE_LEA_ATTR_IMM:
3300
3301        fputs(bi_register_format_as_str(I->register_format), fp);
3302
3303        fputs(" ", fp);
3304        bi_print_index(fp, I->src[0]);
3305
3306
3307        fputs(", ", fp);
3308        bi_print_index(fp, I->src[1]);
3309
3310
3311        fprintf(fp, ", attribute_index:%u", I->attribute_index);
3312        break;
3313
3314    case BI_OPCODE_LEA_ATTR_TEX:
3315
3316        fputs(bi_register_format_as_str(I->register_format), fp);
3317
3318        fputs(" ", fp);
3319        bi_print_index(fp, I->src[0]);
3320
3321
3322        fputs(", ", fp);
3323        bi_print_index(fp, I->src[1]);
3324
3325
3326        fputs(", ", fp);
3327        bi_print_index(fp, I->src[2]);
3328
3329
3330        break;
3331
3332    case BI_OPCODE_LEA_TEX:
3333
3334        if (I->format) fputs(".format", fp);
3335
3336        fputs(" ", fp);
3337        bi_print_index(fp, I->src[0]);
3338
3339
3340        fputs(", ", fp);
3341        bi_print_index(fp, I->src[1]);
3342
3343
3344        fputs(", ", fp);
3345        bi_print_index(fp, I->src[2]);
3346
3347
3348        break;
3349
3350    case BI_OPCODE_LEA_TEX_IMM:
3351
3352        if (I->format) fputs(".format", fp);
3353
3354        fputs(" ", fp);
3355        bi_print_index(fp, I->src[0]);
3356
3357
3358        fputs(", ", fp);
3359        bi_print_index(fp, I->src[1]);
3360
3361
3362        fprintf(fp, ", texture_index:%u", I->texture_index);
3363        break;
3364
3365    case BI_OPCODE_LOAD_I128:
3366
3367        fputs(bi_seg_as_str(I->seg), fp);
3368
3369        fputs(" ", fp);
3370        bi_print_index(fp, I->src[0]);
3371
3372
3373        fputs(", ", fp);
3374        bi_print_index(fp, I->src[1]);
3375
3376
3377        break;
3378
3379    case BI_OPCODE_LOAD_I16:
3380
3381        fputs(bi_seg_as_str(I->seg), fp);
3382        fputs(bi_extend_as_str(I->extend), fp);
3383
3384        fputs(" ", fp);
3385        bi_print_index(fp, I->src[0]);
3386
3387
3388        fputs(", ", fp);
3389        bi_print_index(fp, I->src[1]);
3390
3391
3392        break;
3393
3394    case BI_OPCODE_LOAD_I24:
3395
3396        fputs(bi_seg_as_str(I->seg), fp);
3397
3398        fputs(" ", fp);
3399        bi_print_index(fp, I->src[0]);
3400
3401
3402        fputs(", ", fp);
3403        bi_print_index(fp, I->src[1]);
3404
3405
3406        break;
3407
3408    case BI_OPCODE_LOAD_I32:
3409
3410        fputs(bi_seg_as_str(I->seg), fp);
3411        fputs(bi_extend_as_str(I->extend), fp);
3412
3413        fputs(" ", fp);
3414        bi_print_index(fp, I->src[0]);
3415
3416
3417        fputs(", ", fp);
3418        bi_print_index(fp, I->src[1]);
3419
3420
3421        break;
3422
3423    case BI_OPCODE_LOAD_I48:
3424
3425        fputs(bi_seg_as_str(I->seg), fp);
3426
3427        fputs(" ", fp);
3428        bi_print_index(fp, I->src[0]);
3429
3430
3431        fputs(", ", fp);
3432        bi_print_index(fp, I->src[1]);
3433
3434
3435        break;
3436
3437    case BI_OPCODE_LOAD_I64:
3438
3439        fputs(bi_seg_as_str(I->seg), fp);
3440
3441        fputs(" ", fp);
3442        bi_print_index(fp, I->src[0]);
3443
3444
3445        fputs(", ", fp);
3446        bi_print_index(fp, I->src[1]);
3447
3448
3449        break;
3450
3451    case BI_OPCODE_LOAD_I8:
3452
3453        fputs(bi_seg_as_str(I->seg), fp);
3454        fputs(bi_extend_as_str(I->extend), fp);
3455
3456        fputs(" ", fp);
3457        bi_print_index(fp, I->src[0]);
3458
3459
3460        fputs(", ", fp);
3461        bi_print_index(fp, I->src[1]);
3462
3463
3464        break;
3465
3466    case BI_OPCODE_LOAD_I96:
3467
3468        fputs(bi_seg_as_str(I->seg), fp);
3469
3470        fputs(" ", fp);
3471        bi_print_index(fp, I->src[0]);
3472
3473
3474        fputs(", ", fp);
3475        bi_print_index(fp, I->src[1]);
3476
3477
3478        break;
3479
3480    case BI_OPCODE_LOGB_F32:
3481
3482
3483        fputs(" ", fp);
3484        bi_print_index(fp, I->src[0]);
3485
3486
3487        break;
3488
3489    case BI_OPCODE_LOGB_V2F16:
3490
3491
3492        fputs(" ", fp);
3493        bi_print_index(fp, I->src[0]);
3494
3495
3496        break;
3497
3498    case BI_OPCODE_LROT_DOUBLE_I32:
3499
3500        if (I->result_word) fputs(".result_word", fp);
3501
3502        fputs(" ", fp);
3503        bi_print_index(fp, I->src[0]);
3504
3505
3506        fputs(", ", fp);
3507        bi_print_index(fp, I->src[1]);
3508
3509
3510        fputs(", ", fp);
3511        bi_print_index(fp, I->src[2]);
3512
3513        if (I->bytes2) fputs(".bytes", fp);
3514
3515        break;
3516
3517    case BI_OPCODE_LSHIFT_AND_I32:
3518
3519        if (I->not_result) fputs(".not_result", fp);
3520
3521        fputs(" ", fp);
3522        bi_print_index(fp, I->src[0]);
3523
3524
3525        fputs(", ", fp);
3526        bi_print_index(fp, I->src[1]);
3527
3528
3529        fputs(", ", fp);
3530        bi_print_index(fp, I->src[2]);
3531
3532
3533        break;
3534
3535    case BI_OPCODE_LSHIFT_AND_V2I16:
3536
3537        if (I->not_result) fputs(".not_result", fp);
3538
3539        fputs(" ", fp);
3540        bi_print_index(fp, I->src[0]);
3541
3542
3543        fputs(", ", fp);
3544        bi_print_index(fp, I->src[1]);
3545
3546
3547        fputs(", ", fp);
3548        bi_print_index(fp, I->src[2]);
3549
3550
3551        break;
3552
3553    case BI_OPCODE_LSHIFT_AND_V4I8:
3554
3555        if (I->not_result) fputs(".not_result", fp);
3556
3557        fputs(" ", fp);
3558        bi_print_index(fp, I->src[0]);
3559
3560
3561        fputs(", ", fp);
3562        bi_print_index(fp, I->src[1]);
3563
3564
3565        fputs(", ", fp);
3566        bi_print_index(fp, I->src[2]);
3567
3568
3569        break;
3570
3571    case BI_OPCODE_LSHIFT_DOUBLE_I32:
3572
3573        if (I->result_word) fputs(".result_word", fp);
3574
3575        fputs(" ", fp);
3576        bi_print_index(fp, I->src[0]);
3577
3578
3579        fputs(", ", fp);
3580        bi_print_index(fp, I->src[1]);
3581
3582
3583        fputs(", ", fp);
3584        bi_print_index(fp, I->src[2]);
3585
3586        if (I->bytes2) fputs(".bytes", fp);
3587
3588        break;
3589
3590    case BI_OPCODE_LSHIFT_OR_I32:
3591
3592        if (I->not_result) fputs(".not_result", fp);
3593
3594        fputs(" ", fp);
3595        bi_print_index(fp, I->src[0]);
3596
3597
3598        fputs(", ", fp);
3599        bi_print_index(fp, I->src[1]);
3600
3601
3602        fputs(", ", fp);
3603        bi_print_index(fp, I->src[2]);
3604
3605
3606        break;
3607
3608    case BI_OPCODE_LSHIFT_OR_V2I16:
3609
3610        if (I->not_result) fputs(".not_result", fp);
3611
3612        fputs(" ", fp);
3613        bi_print_index(fp, I->src[0]);
3614
3615
3616        fputs(", ", fp);
3617        bi_print_index(fp, I->src[1]);
3618
3619
3620        fputs(", ", fp);
3621        bi_print_index(fp, I->src[2]);
3622
3623
3624        break;
3625
3626    case BI_OPCODE_LSHIFT_OR_V4I8:
3627
3628        if (I->not_result) fputs(".not_result", fp);
3629
3630        fputs(" ", fp);
3631        bi_print_index(fp, I->src[0]);
3632
3633
3634        fputs(", ", fp);
3635        bi_print_index(fp, I->src[1]);
3636
3637
3638        fputs(", ", fp);
3639        bi_print_index(fp, I->src[2]);
3640
3641
3642        break;
3643
3644    case BI_OPCODE_LSHIFT_XOR_I32:
3645
3646        if (I->not_result) fputs(".not_result", fp);
3647
3648        fputs(" ", fp);
3649        bi_print_index(fp, I->src[0]);
3650
3651
3652        fputs(", ", fp);
3653        bi_print_index(fp, I->src[1]);
3654
3655
3656        fputs(", ", fp);
3657        bi_print_index(fp, I->src[2]);
3658
3659
3660        break;
3661
3662    case BI_OPCODE_LSHIFT_XOR_V2I16:
3663
3664        if (I->not_result) fputs(".not_result", fp);
3665
3666        fputs(" ", fp);
3667        bi_print_index(fp, I->src[0]);
3668
3669
3670        fputs(", ", fp);
3671        bi_print_index(fp, I->src[1]);
3672
3673
3674        fputs(", ", fp);
3675        bi_print_index(fp, I->src[2]);
3676
3677
3678        break;
3679
3680    case BI_OPCODE_LSHIFT_XOR_V4I8:
3681
3682        if (I->not_result) fputs(".not_result", fp);
3683
3684        fputs(" ", fp);
3685        bi_print_index(fp, I->src[0]);
3686
3687
3688        fputs(", ", fp);
3689        bi_print_index(fp, I->src[1]);
3690
3691
3692        fputs(", ", fp);
3693        bi_print_index(fp, I->src[2]);
3694
3695
3696        break;
3697
3698    case BI_OPCODE_MKVEC_V2I16:
3699
3700
3701        fputs(" ", fp);
3702        bi_print_index(fp, I->src[0]);
3703
3704
3705        fputs(", ", fp);
3706        bi_print_index(fp, I->src[1]);
3707
3708
3709        break;
3710
3711    case BI_OPCODE_MKVEC_V4I8:
3712
3713
3714        fputs(" ", fp);
3715        bi_print_index(fp, I->src[0]);
3716
3717
3718        fputs(", ", fp);
3719        bi_print_index(fp, I->src[1]);
3720
3721
3722        fputs(", ", fp);
3723        bi_print_index(fp, I->src[2]);
3724
3725
3726        fputs(", ", fp);
3727        bi_print_index(fp, I->src[3]);
3728
3729
3730        break;
3731
3732    case BI_OPCODE_MOV_I32:
3733
3734
3735        fputs(" ", fp);
3736        bi_print_index(fp, I->src[0]);
3737
3738
3739        break;
3740
3741    case BI_OPCODE_MUX_I32:
3742
3743        fputs(bi_mux_as_str(I->mux), fp);
3744
3745        fputs(" ", fp);
3746        bi_print_index(fp, I->src[0]);
3747
3748
3749        fputs(", ", fp);
3750        bi_print_index(fp, I->src[1]);
3751
3752
3753        fputs(", ", fp);
3754        bi_print_index(fp, I->src[2]);
3755
3756
3757        break;
3758
3759    case BI_OPCODE_MUX_V2I16:
3760
3761        fputs(bi_mux_as_str(I->mux), fp);
3762
3763        fputs(" ", fp);
3764        bi_print_index(fp, I->src[0]);
3765
3766
3767        fputs(", ", fp);
3768        bi_print_index(fp, I->src[1]);
3769
3770
3771        fputs(", ", fp);
3772        bi_print_index(fp, I->src[2]);
3773
3774
3775        break;
3776
3777    case BI_OPCODE_MUX_V4I8:
3778
3779        fputs(bi_mux_as_str(I->mux), fp);
3780
3781        fputs(" ", fp);
3782        bi_print_index(fp, I->src[0]);
3783
3784
3785        fputs(", ", fp);
3786        bi_print_index(fp, I->src[1]);
3787
3788
3789        fputs(", ", fp);
3790        bi_print_index(fp, I->src[2]);
3791
3792
3793        break;
3794
3795    case BI_OPCODE_NOP:
3796
3797
3798        fputs(" ", fp);
3799        break;
3800
3801    case BI_OPCODE_PATOM_C_I32:
3802
3803        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
3804
3805        fputs(" ", fp);
3806        bi_print_index(fp, I->src[0]);
3807
3808
3809        fputs(", ", fp);
3810        bi_print_index(fp, I->src[1]);
3811
3812
3813        fputs(", ", fp);
3814        bi_print_index(fp, I->src[2]);
3815
3816
3817        fprintf(fp, ", sr_count:%u", I->sr_count);
3818        break;
3819
3820    case BI_OPCODE_PATOM_C1_I32:
3821
3822        fputs(bi_atom_opc_as_str(I->atom_opc), fp);
3823
3824        fputs(" ", fp);
3825        bi_print_index(fp, I->src[0]);
3826
3827
3828        fputs(", ", fp);
3829        bi_print_index(fp, I->src[1]);
3830
3831
3832        fprintf(fp, ", sr_count:%u", I->sr_count);
3833        break;
3834
3835    case BI_OPCODE_POPCOUNT_I32:
3836
3837
3838        fputs(" ", fp);
3839        bi_print_index(fp, I->src[0]);
3840
3841
3842        break;
3843
3844    case BI_OPCODE_QUIET_F32:
3845
3846
3847        fputs(" ", fp);
3848        bi_print_index(fp, I->src[0]);
3849
3850
3851        break;
3852
3853    case BI_OPCODE_QUIET_V2F16:
3854
3855
3856        fputs(" ", fp);
3857        bi_print_index(fp, I->src[0]);
3858
3859
3860        break;
3861
3862    case BI_OPCODE_RROT_DOUBLE_I32:
3863
3864        if (I->result_word) fputs(".result_word", fp);
3865
3866        fputs(" ", fp);
3867        bi_print_index(fp, I->src[0]);
3868
3869
3870        fputs(", ", fp);
3871        bi_print_index(fp, I->src[1]);
3872
3873
3874        fputs(", ", fp);
3875        bi_print_index(fp, I->src[2]);
3876
3877        if (I->bytes2) fputs(".bytes", fp);
3878
3879        break;
3880
3881    case BI_OPCODE_RSHIFT_AND_I32:
3882
3883        if (I->not_result) fputs(".not_result", fp);
3884
3885        fputs(" ", fp);
3886        bi_print_index(fp, I->src[0]);
3887
3888
3889        fputs(", ", fp);
3890        bi_print_index(fp, I->src[1]);
3891
3892
3893        fputs(", ", fp);
3894        bi_print_index(fp, I->src[2]);
3895
3896
3897        break;
3898
3899    case BI_OPCODE_RSHIFT_AND_V2I16:
3900
3901        if (I->not_result) fputs(".not_result", fp);
3902
3903        fputs(" ", fp);
3904        bi_print_index(fp, I->src[0]);
3905
3906
3907        fputs(", ", fp);
3908        bi_print_index(fp, I->src[1]);
3909
3910
3911        fputs(", ", fp);
3912        bi_print_index(fp, I->src[2]);
3913
3914
3915        break;
3916
3917    case BI_OPCODE_RSHIFT_AND_V4I8:
3918
3919        if (I->not_result) fputs(".not_result", fp);
3920
3921        fputs(" ", fp);
3922        bi_print_index(fp, I->src[0]);
3923
3924
3925        fputs(", ", fp);
3926        bi_print_index(fp, I->src[1]);
3927
3928
3929        fputs(", ", fp);
3930        bi_print_index(fp, I->src[2]);
3931
3932
3933        break;
3934
3935    case BI_OPCODE_RSHIFT_DOUBLE_I32:
3936
3937        if (I->result_word) fputs(".result_word", fp);
3938
3939        fputs(" ", fp);
3940        bi_print_index(fp, I->src[0]);
3941
3942
3943        fputs(", ", fp);
3944        bi_print_index(fp, I->src[1]);
3945
3946
3947        fputs(", ", fp);
3948        bi_print_index(fp, I->src[2]);
3949
3950        if (I->bytes2) fputs(".bytes", fp);
3951
3952        break;
3953
3954    case BI_OPCODE_RSHIFT_OR_I32:
3955
3956        if (I->not_result) fputs(".not_result", fp);
3957
3958        fputs(" ", fp);
3959        bi_print_index(fp, I->src[0]);
3960
3961
3962        fputs(", ", fp);
3963        bi_print_index(fp, I->src[1]);
3964
3965
3966        fputs(", ", fp);
3967        bi_print_index(fp, I->src[2]);
3968
3969
3970        break;
3971
3972    case BI_OPCODE_RSHIFT_OR_V2I16:
3973
3974        if (I->not_result) fputs(".not_result", fp);
3975
3976        fputs(" ", fp);
3977        bi_print_index(fp, I->src[0]);
3978
3979
3980        fputs(", ", fp);
3981        bi_print_index(fp, I->src[1]);
3982
3983
3984        fputs(", ", fp);
3985        bi_print_index(fp, I->src[2]);
3986
3987
3988        break;
3989
3990    case BI_OPCODE_RSHIFT_OR_V4I8:
3991
3992        if (I->not_result) fputs(".not_result", fp);
3993
3994        fputs(" ", fp);
3995        bi_print_index(fp, I->src[0]);
3996
3997
3998        fputs(", ", fp);
3999        bi_print_index(fp, I->src[1]);
4000
4001
4002        fputs(", ", fp);
4003        bi_print_index(fp, I->src[2]);
4004
4005
4006        break;
4007
4008    case BI_OPCODE_RSHIFT_XOR_I32:
4009
4010        if (I->not_result) fputs(".not_result", fp);
4011
4012        fputs(" ", fp);
4013        bi_print_index(fp, I->src[0]);
4014
4015
4016        fputs(", ", fp);
4017        bi_print_index(fp, I->src[1]);
4018
4019
4020        fputs(", ", fp);
4021        bi_print_index(fp, I->src[2]);
4022
4023
4024        break;
4025
4026    case BI_OPCODE_RSHIFT_XOR_V2I16:
4027
4028        if (I->not_result) fputs(".not_result", fp);
4029
4030        fputs(" ", fp);
4031        bi_print_index(fp, I->src[0]);
4032
4033
4034        fputs(", ", fp);
4035        bi_print_index(fp, I->src[1]);
4036
4037
4038        fputs(", ", fp);
4039        bi_print_index(fp, I->src[2]);
4040
4041
4042        break;
4043
4044    case BI_OPCODE_RSHIFT_XOR_V4I8:
4045
4046        if (I->not_result) fputs(".not_result", fp);
4047
4048        fputs(" ", fp);
4049        bi_print_index(fp, I->src[0]);
4050
4051
4052        fputs(", ", fp);
4053        bi_print_index(fp, I->src[1]);
4054
4055
4056        fputs(", ", fp);
4057        bi_print_index(fp, I->src[2]);
4058
4059
4060        break;
4061
4062    case BI_OPCODE_S16_TO_F32:
4063
4064
4065        fputs(" ", fp);
4066        bi_print_index(fp, I->src[0]);
4067
4068
4069        break;
4070
4071    case BI_OPCODE_S16_TO_S32:
4072
4073
4074        fputs(" ", fp);
4075        bi_print_index(fp, I->src[0]);
4076
4077
4078        break;
4079
4080    case BI_OPCODE_S32_TO_F32:
4081
4082        fputs(bi_round_as_str(I->round), fp);
4083
4084        fputs(" ", fp);
4085        bi_print_index(fp, I->src[0]);
4086
4087
4088        break;
4089
4090    case BI_OPCODE_S8_TO_F32:
4091
4092
4093        fputs(" ", fp);
4094        bi_print_index(fp, I->src[0]);
4095
4096
4097        break;
4098
4099    case BI_OPCODE_S8_TO_S32:
4100
4101
4102        fputs(" ", fp);
4103        bi_print_index(fp, I->src[0]);
4104
4105
4106        break;
4107
4108    case BI_OPCODE_SEG_ADD:
4109
4110        fputs(bi_seg_as_str(I->seg), fp);
4111        if (I->preserve_null) fputs(".preserve_null", fp);
4112
4113        fputs(" ", fp);
4114        bi_print_index(fp, I->src[0]);
4115
4116
4117        break;
4118
4119    case BI_OPCODE_SEG_ADD_I64:
4120
4121        fputs(bi_seg_as_str(I->seg), fp);
4122        if (I->preserve_null) fputs(".preserve_null", fp);
4123
4124        fputs(" ", fp);
4125        bi_print_index(fp, I->src[0]);
4126
4127
4128        fputs(", ", fp);
4129        bi_print_index(fp, I->src[1]);
4130
4131
4132        break;
4133
4134    case BI_OPCODE_SHADDXH_I32:
4135
4136
4137        fputs(" ", fp);
4138        bi_print_index(fp, I->src[0]);
4139
4140
4141        fputs(", ", fp);
4142        bi_print_index(fp, I->src[1]);
4143
4144
4145        break;
4146
4147    case BI_OPCODE_SHADDXL_I64:
4148
4149
4150        fputs(" ", fp);
4151        bi_print_index(fp, I->src[0]);
4152
4153
4154        fputs(", ", fp);
4155        bi_print_index(fp, I->src[1]);
4156
4157
4158        fprintf(fp, ", shift:%u", I->shift);
4159        break;
4160
4161    case BI_OPCODE_SHADDXL_S32:
4162
4163
4164        fputs(" ", fp);
4165        bi_print_index(fp, I->src[0]);
4166
4167
4168        fputs(", ", fp);
4169        bi_print_index(fp, I->src[1]);
4170
4171
4172        fprintf(fp, ", shift:%u", I->shift);
4173        break;
4174
4175    case BI_OPCODE_SHADDXL_U32:
4176
4177
4178        fputs(" ", fp);
4179        bi_print_index(fp, I->src[0]);
4180
4181
4182        fputs(", ", fp);
4183        bi_print_index(fp, I->src[1]);
4184
4185
4186        fprintf(fp, ", shift:%u", I->shift);
4187        break;
4188
4189    case BI_OPCODE_SHIFT_DOUBLE_I32:
4190
4191
4192        fputs(" ", fp);
4193        bi_print_index(fp, I->src[0]);
4194
4195
4196        fputs(", ", fp);
4197        bi_print_index(fp, I->src[1]);
4198
4199
4200        fputs(", ", fp);
4201        bi_print_index(fp, I->src[2]);
4202
4203
4204        break;
4205
4206    case BI_OPCODE_STORE_I128:
4207
4208        fputs(bi_seg_as_str(I->seg), fp);
4209
4210        fputs(" ", fp);
4211        bi_print_index(fp, I->src[0]);
4212
4213
4214        fputs(", ", fp);
4215        bi_print_index(fp, I->src[1]);
4216
4217
4218        fputs(", ", fp);
4219        bi_print_index(fp, I->src[2]);
4220
4221
4222        break;
4223
4224    case BI_OPCODE_STORE_I16:
4225
4226        fputs(bi_seg_as_str(I->seg), fp);
4227
4228        fputs(" ", fp);
4229        bi_print_index(fp, I->src[0]);
4230
4231
4232        fputs(", ", fp);
4233        bi_print_index(fp, I->src[1]);
4234
4235
4236        fputs(", ", fp);
4237        bi_print_index(fp, I->src[2]);
4238
4239
4240        break;
4241
4242    case BI_OPCODE_STORE_I24:
4243
4244        fputs(bi_seg_as_str(I->seg), fp);
4245
4246        fputs(" ", fp);
4247        bi_print_index(fp, I->src[0]);
4248
4249
4250        fputs(", ", fp);
4251        bi_print_index(fp, I->src[1]);
4252
4253
4254        fputs(", ", fp);
4255        bi_print_index(fp, I->src[2]);
4256
4257
4258        break;
4259
4260    case BI_OPCODE_STORE_I32:
4261
4262        fputs(bi_seg_as_str(I->seg), fp);
4263
4264        fputs(" ", fp);
4265        bi_print_index(fp, I->src[0]);
4266
4267
4268        fputs(", ", fp);
4269        bi_print_index(fp, I->src[1]);
4270
4271
4272        fputs(", ", fp);
4273        bi_print_index(fp, I->src[2]);
4274
4275
4276        break;
4277
4278    case BI_OPCODE_STORE_I48:
4279
4280        fputs(bi_seg_as_str(I->seg), fp);
4281
4282        fputs(" ", fp);
4283        bi_print_index(fp, I->src[0]);
4284
4285
4286        fputs(", ", fp);
4287        bi_print_index(fp, I->src[1]);
4288
4289
4290        fputs(", ", fp);
4291        bi_print_index(fp, I->src[2]);
4292
4293
4294        break;
4295
4296    case BI_OPCODE_STORE_I64:
4297
4298        fputs(bi_seg_as_str(I->seg), fp);
4299
4300        fputs(" ", fp);
4301        bi_print_index(fp, I->src[0]);
4302
4303
4304        fputs(", ", fp);
4305        bi_print_index(fp, I->src[1]);
4306
4307
4308        fputs(", ", fp);
4309        bi_print_index(fp, I->src[2]);
4310
4311
4312        break;
4313
4314    case BI_OPCODE_STORE_I8:
4315
4316        fputs(bi_seg_as_str(I->seg), fp);
4317
4318        fputs(" ", fp);
4319        bi_print_index(fp, I->src[0]);
4320
4321
4322        fputs(", ", fp);
4323        bi_print_index(fp, I->src[1]);
4324
4325
4326        fputs(", ", fp);
4327        bi_print_index(fp, I->src[2]);
4328
4329
4330        break;
4331
4332    case BI_OPCODE_STORE_I96:
4333
4334        fputs(bi_seg_as_str(I->seg), fp);
4335
4336        fputs(" ", fp);
4337        bi_print_index(fp, I->src[0]);
4338
4339
4340        fputs(", ", fp);
4341        bi_print_index(fp, I->src[1]);
4342
4343
4344        fputs(", ", fp);
4345        bi_print_index(fp, I->src[2]);
4346
4347
4348        break;
4349
4350    case BI_OPCODE_ST_CVT:
4351
4352        fputs(bi_register_format_as_str(I->register_format), fp);
4353        fputs(bi_vecsize_as_str(I->vecsize), fp);
4354
4355        fputs(" ", fp);
4356        bi_print_index(fp, I->src[0]);
4357
4358
4359        fputs(", ", fp);
4360        bi_print_index(fp, I->src[1]);
4361
4362
4363        fputs(", ", fp);
4364        bi_print_index(fp, I->src[2]);
4365
4366
4367        fputs(", ", fp);
4368        bi_print_index(fp, I->src[3]);
4369
4370
4371        break;
4372
4373    case BI_OPCODE_ST_TILE:
4374
4375        fputs(bi_vecsize_as_str(I->vecsize), fp);
4376
4377        fputs(" ", fp);
4378        bi_print_index(fp, I->src[0]);
4379
4380
4381        fputs(", ", fp);
4382        bi_print_index(fp, I->src[1]);
4383
4384
4385        fputs(", ", fp);
4386        bi_print_index(fp, I->src[2]);
4387
4388
4389        fputs(", ", fp);
4390        bi_print_index(fp, I->src[3]);
4391
4392
4393        break;
4394
4395    case BI_OPCODE_SWZ_V2I16:
4396
4397
4398        fputs(" ", fp);
4399        bi_print_index(fp, I->src[0]);
4400
4401
4402        break;
4403
4404    case BI_OPCODE_SWZ_V4I8:
4405
4406
4407        fputs(" ", fp);
4408        bi_print_index(fp, I->src[0]);
4409
4410
4411        break;
4412
4413    case BI_OPCODE_TEXC:
4414
4415        if (I->skip) fputs(".skip", fp);
4416        if (I->lod_mode) fputs(".lod_mode", fp);
4417
4418        fputs(" ", fp);
4419        bi_print_index(fp, I->src[0]);
4420
4421
4422        fputs(", ", fp);
4423        bi_print_index(fp, I->src[1]);
4424
4425
4426        fputs(", ", fp);
4427        bi_print_index(fp, I->src[2]);
4428
4429
4430        fputs(", ", fp);
4431        bi_print_index(fp, I->src[3]);
4432
4433
4434        fprintf(fp, ", sr_count:%u", I->sr_count);
4435        break;
4436
4437    case BI_OPCODE_TEXS_2D_F16:
4438
4439        if (I->skip) fputs(".skip", fp);
4440        if (I->lod_mode) fputs(".lod_mode", fp);
4441
4442        fputs(" ", fp);
4443        bi_print_index(fp, I->src[0]);
4444
4445
4446        fputs(", ", fp);
4447        bi_print_index(fp, I->src[1]);
4448
4449
4450        fprintf(fp, ", sampler_index:%u", I->sampler_index);
4451        fprintf(fp, ", texture_index:%u", I->texture_index);
4452        break;
4453
4454    case BI_OPCODE_TEXS_2D_F32:
4455
4456        if (I->skip) fputs(".skip", fp);
4457        if (I->lod_mode) fputs(".lod_mode", fp);
4458
4459        fputs(" ", fp);
4460        bi_print_index(fp, I->src[0]);
4461
4462
4463        fputs(", ", fp);
4464        bi_print_index(fp, I->src[1]);
4465
4466
4467        fprintf(fp, ", sampler_index:%u", I->sampler_index);
4468        fprintf(fp, ", texture_index:%u", I->texture_index);
4469        break;
4470
4471    case BI_OPCODE_TEXS_CUBE_F16:
4472
4473        if (I->skip) fputs(".skip", fp);
4474
4475        fputs(" ", fp);
4476        bi_print_index(fp, I->src[0]);
4477
4478
4479        fputs(", ", fp);
4480        bi_print_index(fp, I->src[1]);
4481
4482
4483        fputs(", ", fp);
4484        bi_print_index(fp, I->src[2]);
4485
4486
4487        fprintf(fp, ", sampler_index:%u", I->sampler_index);
4488        fprintf(fp, ", texture_index:%u", I->texture_index);
4489        break;
4490
4491    case BI_OPCODE_TEXS_CUBE_F32:
4492
4493        if (I->skip) fputs(".skip", fp);
4494
4495        fputs(" ", fp);
4496        bi_print_index(fp, I->src[0]);
4497
4498
4499        fputs(", ", fp);
4500        bi_print_index(fp, I->src[1]);
4501
4502
4503        fputs(", ", fp);
4504        bi_print_index(fp, I->src[2]);
4505
4506
4507        fprintf(fp, ", sampler_index:%u", I->sampler_index);
4508        fprintf(fp, ", texture_index:%u", I->texture_index);
4509        break;
4510
4511    case BI_OPCODE_U16_TO_F32:
4512
4513
4514        fputs(" ", fp);
4515        bi_print_index(fp, I->src[0]);
4516
4517
4518        break;
4519
4520    case BI_OPCODE_U16_TO_U32:
4521
4522
4523        fputs(" ", fp);
4524        bi_print_index(fp, I->src[0]);
4525
4526
4527        break;
4528
4529    case BI_OPCODE_U32_TO_F32:
4530
4531        fputs(bi_round_as_str(I->round), fp);
4532
4533        fputs(" ", fp);
4534        bi_print_index(fp, I->src[0]);
4535
4536
4537        break;
4538
4539    case BI_OPCODE_U8_TO_F32:
4540
4541
4542        fputs(" ", fp);
4543        bi_print_index(fp, I->src[0]);
4544
4545
4546        break;
4547
4548    case BI_OPCODE_U8_TO_U32:
4549
4550
4551        fputs(" ", fp);
4552        bi_print_index(fp, I->src[0]);
4553
4554
4555        break;
4556
4557    case BI_OPCODE_V2F16_TO_V2S16:
4558
4559        fputs(bi_round_as_str(I->round), fp);
4560
4561        fputs(" ", fp);
4562        bi_print_index(fp, I->src[0]);
4563
4564
4565        break;
4566
4567    case BI_OPCODE_V2F16_TO_V2U16:
4568
4569        fputs(bi_round_as_str(I->round), fp);
4570
4571        fputs(" ", fp);
4572        bi_print_index(fp, I->src[0]);
4573
4574
4575        break;
4576
4577    case BI_OPCODE_V2F32_TO_V2F16:
4578
4579        fputs(bi_clamp_as_str(I->clamp), fp);
4580        fputs(bi_round_as_str(I->round), fp);
4581
4582        fputs(" ", fp);
4583        bi_print_index(fp, I->src[0]);
4584
4585
4586        fputs(", ", fp);
4587        bi_print_index(fp, I->src[1]);
4588
4589
4590        break;
4591
4592    case BI_OPCODE_V2S16_TO_V2F16:
4593
4594        fputs(bi_round_as_str(I->round), fp);
4595
4596        fputs(" ", fp);
4597        bi_print_index(fp, I->src[0]);
4598
4599
4600        break;
4601
4602    case BI_OPCODE_V2S8_TO_V2F16:
4603
4604
4605        fputs(" ", fp);
4606        bi_print_index(fp, I->src[0]);
4607
4608
4609        break;
4610
4611    case BI_OPCODE_V2S8_TO_V2S16:
4612
4613
4614        fputs(" ", fp);
4615        bi_print_index(fp, I->src[0]);
4616
4617
4618        break;
4619
4620    case BI_OPCODE_V2U16_TO_V2F16:
4621
4622        fputs(bi_round_as_str(I->round), fp);
4623
4624        fputs(" ", fp);
4625        bi_print_index(fp, I->src[0]);
4626
4627
4628        break;
4629
4630    case BI_OPCODE_V2U8_TO_V2F16:
4631
4632
4633        fputs(" ", fp);
4634        bi_print_index(fp, I->src[0]);
4635
4636
4637        break;
4638
4639    case BI_OPCODE_V2U8_TO_V2U16:
4640
4641
4642        fputs(" ", fp);
4643        bi_print_index(fp, I->src[0]);
4644
4645
4646        break;
4647
4648    case BI_OPCODE_VAR_TEX_F16:
4649
4650        fputs(bi_update_as_str(I->update), fp);
4651        if (I->skip) fputs(".skip", fp);
4652        if (I->lod_mode) fputs(".lod_mode", fp);
4653        fputs(bi_sample_as_str(I->sample), fp);
4654
4655        fputs(" ", fp);
4656        fprintf(fp, ", texture_index:%u", I->texture_index);
4657        fprintf(fp, ", varying_index:%u", I->varying_index);
4658        break;
4659
4660    case BI_OPCODE_VAR_TEX_F32:
4661
4662        fputs(bi_update_as_str(I->update), fp);
4663        if (I->skip) fputs(".skip", fp);
4664        if (I->lod_mode) fputs(".lod_mode", fp);
4665        fputs(bi_sample_as_str(I->sample), fp);
4666
4667        fputs(" ", fp);
4668        fprintf(fp, ", texture_index:%u", I->texture_index);
4669        fprintf(fp, ", varying_index:%u", I->varying_index);
4670        break;
4671
4672    case BI_OPCODE_VN_ASST1_F16:
4673
4674        if (I->h) fputs(".h", fp);
4675        if (I->l) fputs(".l", fp);
4676
4677        fputs(" ", fp);
4678        bi_print_index(fp, I->src[0]);
4679
4680
4681        fputs(", ", fp);
4682        bi_print_index(fp, I->src[1]);
4683
4684
4685        fputs(", ", fp);
4686        bi_print_index(fp, I->src[2]);
4687
4688
4689        break;
4690
4691    case BI_OPCODE_VN_ASST1_F32:
4692
4693
4694        fputs(" ", fp);
4695        bi_print_index(fp, I->src[0]);
4696
4697
4698        fputs(", ", fp);
4699        bi_print_index(fp, I->src[1]);
4700
4701
4702        fputs(", ", fp);
4703        bi_print_index(fp, I->src[2]);
4704
4705
4706        fputs(", ", fp);
4707        bi_print_index(fp, I->src[3]);
4708
4709
4710        break;
4711
4712    case BI_OPCODE_VN_ASST2_F32:
4713
4714        if (I->scale) fputs(".scale", fp);
4715
4716        fputs(" ", fp);
4717        bi_print_index(fp, I->src[0]);
4718
4719
4720        break;
4721
4722    case BI_OPCODE_VN_ASST2_V2F16:
4723
4724
4725        fputs(" ", fp);
4726        bi_print_index(fp, I->src[0]);
4727
4728
4729        break;
4730
4731    case BI_OPCODE_WMASK:
4732
4733        fputs(bi_subgroup_as_str(I->subgroup), fp);
4734
4735        fputs(" ", fp);
4736        bi_print_index(fp, I->src[0]);
4737
4738
4739        fprintf(fp, ", fill:%u", I->fill);
4740        break;
4741
4742    case BI_OPCODE_ZS_EMIT:
4743
4744        if (I->stencil) fputs(".stencil", fp);
4745        if (I->z) fputs(".z", fp);
4746
4747        fputs(" ", fp);
4748        bi_print_index(fp, I->src[0]);
4749
4750
4751        fputs(", ", fp);
4752        bi_print_index(fp, I->src[1]);
4753
4754
4755        fputs(", ", fp);
4756        bi_print_index(fp, I->src[2]);
4757
4758
4759        break;
4760    default:
4761        unreachable("Invalid opcode");
4762    }
4763
4764    if (I->branch_target)
4765            fprintf(fp, " -> block%u", I->branch_target->name);
4766
4767    fputs("\n", fp);
4768
4769}
4770