2 #include "aco_builder.h"
5 #include "ac_shader_util.h"
9 static const char *reduce_ops
[] = {
36 [gfx10_wave64_bpermute
] = "gfx10_wave64_bpermute",
39 static void print_reg_class(const RegClass rc
, FILE *output
)
42 case RegClass::s1
: fprintf(output
, " s1: "); return;
43 case RegClass::s2
: fprintf(output
, " s2: "); return;
44 case RegClass::s3
: fprintf(output
, " s3: "); return;
45 case RegClass::s4
: fprintf(output
, " s4: "); return;
46 case RegClass::s6
: fprintf(output
, " s6: "); return;
47 case RegClass::s8
: fprintf(output
, " s8: "); return;
48 case RegClass::s16
: fprintf(output
, "s16: "); return;
49 case RegClass::v1
: fprintf(output
, " v1: "); return;
50 case RegClass::v2
: fprintf(output
, " v2: "); return;
51 case RegClass::v3
: fprintf(output
, " v3: "); return;
52 case RegClass::v4
: fprintf(output
, " v4: "); return;
53 case RegClass::v5
: fprintf(output
, " v5: "); return;
54 case RegClass::v6
: fprintf(output
, " v6: "); return;
55 case RegClass::v7
: fprintf(output
, " v7: "); return;
56 case RegClass::v8
: fprintf(output
, " v8: "); return;
57 case RegClass::v1_linear
: fprintf(output
, " v1: "); return;
58 case RegClass::v2_linear
: fprintf(output
, " v2: "); return;
62 void print_physReg(unsigned reg
, unsigned size
, FILE *output
)
65 fprintf(output
, ":m0");
66 } else if (reg
== 106) {
67 fprintf(output
, ":vcc");
68 } else if (reg
== 253) {
69 fprintf(output
, ":scc");
70 } else if (reg
== 126) {
71 fprintf(output
, ":exec");
73 bool is_vgpr
= reg
/ 256;
75 fprintf(output
, ":%c[%d", is_vgpr
? 'v' : 's', reg
);
77 fprintf(output
, "-%d]", reg
+ size
-1);
83 static void print_constant(uint8_t reg
, FILE *output
)
85 if (reg
>= 128 && reg
<= 192) {
86 fprintf(output
, "%d", reg
- 128);
88 } else if (reg
>= 192 && reg
<= 208) {
89 fprintf(output
, "%d", 192 - reg
);
95 fprintf(output
, "0.5");
98 fprintf(output
, "-0.5");
101 fprintf(output
, "1.0");
104 fprintf(output
, "-1.0");
107 fprintf(output
, "2.0");
110 fprintf(output
, "-2.0");
113 fprintf(output
, "4.0");
116 fprintf(output
, "-4.0");
119 fprintf(output
, "1/(2*PI)");
124 static void print_operand(const Operand
*operand
, FILE *output
)
126 if (operand
->isLiteral()) {
127 fprintf(output
, "0x%x", operand
->constantValue());
128 } else if (operand
->isConstant()) {
129 print_constant(operand
->physReg().reg(), output
);
130 } else if (operand
->isUndefined()) {
131 print_reg_class(operand
->regClass(), output
);
132 fprintf(output
, "undef");
134 if (operand
->isLateKill())
135 fprintf(output
, "(latekill)");
137 fprintf(output
, "%%%d", operand
->tempId());
139 if (operand
->isFixed())
140 print_physReg(operand
->physReg(), operand
->size(), output
);
144 static void print_definition(const Definition
*definition
, FILE *output
)
146 print_reg_class(definition
->regClass(), output
);
147 fprintf(output
, "%%%d", definition
->tempId());
149 if (definition
->isFixed())
150 print_physReg(definition
->physReg(), definition
->size(), output
);
153 static void print_barrier_reorder(bool can_reorder
, barrier_interaction barrier
, FILE *output
)
156 fprintf(output
, " reorder");
158 if (barrier
& barrier_buffer
)
159 fprintf(output
, " buffer");
160 if (barrier
& barrier_image
)
161 fprintf(output
, " image");
162 if (barrier
& barrier_atomic
)
163 fprintf(output
, " atomic");
164 if (barrier
& barrier_shared
)
165 fprintf(output
, " shared");
166 if (barrier
& barrier_gs_data
)
167 fprintf(output
, " gs_data");
168 if (barrier
& barrier_gs_sendmsg
)
169 fprintf(output
, " gs_sendmsg");
172 static void print_instr_format_specific(struct Instruction
*instr
, FILE *output
)
174 switch (instr
->format
) {
176 SOPK_instruction
* sopk
= static_cast<SOPK_instruction
*>(instr
);
177 fprintf(output
, " imm:%d", sopk
->imm
& 0x8000 ? (sopk
->imm
- 65536) : sopk
->imm
);
181 SOPP_instruction
* sopp
= static_cast<SOPP_instruction
*>(instr
);
182 uint16_t imm
= sopp
->imm
;
183 switch (instr
->opcode
) {
184 case aco_opcode::s_waitcnt
: {
185 /* we usually should check the chip class for vmcnt/lgkm, but
186 * insert_waitcnt() should fill it in regardless. */
187 unsigned vmcnt
= (imm
& 0xF) | ((imm
& (0x3 << 14)) >> 10);
188 if (vmcnt
!= 63) fprintf(output
, " vmcnt(%d)", vmcnt
);
189 if (((imm
>> 4) & 0x7) < 0x7) fprintf(output
, " expcnt(%d)", (imm
>> 4) & 0x7);
190 if (((imm
>> 8) & 0x3F) < 0x3F) fprintf(output
, " lgkmcnt(%d)", (imm
>> 8) & 0x3F);
193 case aco_opcode::s_endpgm
:
194 case aco_opcode::s_endpgm_saved
:
195 case aco_opcode::s_endpgm_ordered_ps_done
:
196 case aco_opcode::s_wakeup
:
197 case aco_opcode::s_barrier
:
198 case aco_opcode::s_icache_inv
:
199 case aco_opcode::s_ttracedata
:
200 case aco_opcode::s_set_gpr_idx_off
: {
203 case aco_opcode::s_sendmsg
: {
204 unsigned id
= imm
& sendmsg_id_mask
;
207 fprintf(output
, " sendmsg(MSG_NONE)");
210 fprintf(output
, " sendmsg(gs%s%s, %u)",
211 imm
& 0x10 ? ", cut" : "", imm
& 0x20 ? ", emit" : "", imm
>> 8);
213 case _sendmsg_gs_done
:
214 fprintf(output
, " sendmsg(gs_done%s%s, %u)",
215 imm
& 0x10 ? ", cut" : "", imm
& 0x20 ? ", emit" : "", imm
>> 8);
217 case sendmsg_save_wave
:
218 fprintf(output
, " sendmsg(save_wave)");
220 case sendmsg_stall_wave_gen
:
221 fprintf(output
, " sendmsg(stall_wave_gen)");
223 case sendmsg_halt_waves
:
224 fprintf(output
, " sendmsg(halt_waves)");
226 case sendmsg_ordered_ps_done
:
227 fprintf(output
, " sendmsg(ordered_ps_done)");
229 case sendmsg_early_prim_dealloc
:
230 fprintf(output
, " sendmsg(early_prim_dealloc)");
232 case sendmsg_gs_alloc_req
:
233 fprintf(output
, " sendmsg(gs_alloc_req)");
240 fprintf(output
, " imm:%u", imm
);
244 if (sopp
->block
!= -1)
245 fprintf(output
, " block:BB%d", sopp
->block
);
249 SMEM_instruction
* smem
= static_cast<SMEM_instruction
*>(instr
);
251 fprintf(output
, " glc");
253 fprintf(output
, " dlc");
255 fprintf(output
, " nv");
256 print_barrier_reorder(smem
->can_reorder
, smem
->barrier
, output
);
259 case Format::VINTRP
: {
260 Interp_instruction
* vintrp
= static_cast<Interp_instruction
*>(instr
);
261 fprintf(output
, " attr%d.%c", vintrp
->attribute
, "xyzw"[vintrp
->component
]);
265 DS_instruction
* ds
= static_cast<DS_instruction
*>(instr
);
267 fprintf(output
, " offset0:%u", ds
->offset0
);
269 fprintf(output
, " offset1:%u", ds
->offset1
);
271 fprintf(output
, " gds");
274 case Format::MUBUF
: {
275 MUBUF_instruction
* mubuf
= static_cast<MUBUF_instruction
*>(instr
);
277 fprintf(output
, " offset:%u", mubuf
->offset
);
279 fprintf(output
, " offen");
281 fprintf(output
, " idxen");
283 fprintf(output
, " addr64");
285 fprintf(output
, " glc");
287 fprintf(output
, " dlc");
289 fprintf(output
, " slc");
291 fprintf(output
, " tfe");
293 fprintf(output
, " lds");
294 if (mubuf
->disable_wqm
)
295 fprintf(output
, " disable_wqm");
296 print_barrier_reorder(mubuf
->can_reorder
, mubuf
->barrier
, output
);
300 MIMG_instruction
* mimg
= static_cast<MIMG_instruction
*>(instr
);
301 unsigned identity_dmask
= !instr
->definitions
.empty() ?
302 (1 << instr
->definitions
[0].size()) - 1 :
304 if ((mimg
->dmask
& identity_dmask
) != identity_dmask
)
305 fprintf(output
, " dmask:%s%s%s%s",
306 mimg
->dmask
& 0x1 ? "x" : "",
307 mimg
->dmask
& 0x2 ? "y" : "",
308 mimg
->dmask
& 0x4 ? "z" : "",
309 mimg
->dmask
& 0x8 ? "w" : "");
312 fprintf(output
, " 1d");
315 fprintf(output
, " 2d");
318 fprintf(output
, " 3d");
321 fprintf(output
, " cube");
323 case ac_image_1darray
:
324 fprintf(output
, " 1darray");
326 case ac_image_2darray
:
327 fprintf(output
, " 2darray");
329 case ac_image_2dmsaa
:
330 fprintf(output
, " 2dmsaa");
332 case ac_image_2darraymsaa
:
333 fprintf(output
, " 2darraymsaa");
337 fprintf(output
, " unrm");
339 fprintf(output
, " glc");
341 fprintf(output
, " dlc");
343 fprintf(output
, " slc");
345 fprintf(output
, " tfe");
347 fprintf(output
, " da");
349 fprintf(output
, " lwe");
350 if (mimg
->r128
|| mimg
->a16
)
351 fprintf(output
, " r128/a16");
353 fprintf(output
, " d16");
354 if (mimg
->disable_wqm
)
355 fprintf(output
, " disable_wqm");
356 print_barrier_reorder(mimg
->can_reorder
, mimg
->barrier
, output
);
360 Export_instruction
* exp
= static_cast<Export_instruction
*>(instr
);
361 unsigned identity_mask
= exp
->compressed
? 0x5 : 0xf;
362 if ((exp
->enabled_mask
& identity_mask
) != identity_mask
)
363 fprintf(output
, " en:%c%c%c%c",
364 exp
->enabled_mask
& 0x1 ? 'r' : '*',
365 exp
->enabled_mask
& 0x2 ? 'g' : '*',
366 exp
->enabled_mask
& 0x4 ? 'b' : '*',
367 exp
->enabled_mask
& 0x8 ? 'a' : '*');
369 fprintf(output
, " compr");
371 fprintf(output
, " done");
373 fprintf(output
, " vm");
375 if (exp
->dest
<= V_008DFC_SQ_EXP_MRT
+ 7)
376 fprintf(output
, " mrt%d", exp
->dest
- V_008DFC_SQ_EXP_MRT
);
377 else if (exp
->dest
== V_008DFC_SQ_EXP_MRTZ
)
378 fprintf(output
, " mrtz");
379 else if (exp
->dest
== V_008DFC_SQ_EXP_NULL
)
380 fprintf(output
, " null");
381 else if (exp
->dest
>= V_008DFC_SQ_EXP_POS
&& exp
->dest
<= V_008DFC_SQ_EXP_POS
+ 3)
382 fprintf(output
, " pos%d", exp
->dest
- V_008DFC_SQ_EXP_POS
);
383 else if (exp
->dest
>= V_008DFC_SQ_EXP_PARAM
&& exp
->dest
<= V_008DFC_SQ_EXP_PARAM
+ 31)
384 fprintf(output
, " param%d", exp
->dest
- V_008DFC_SQ_EXP_PARAM
);
387 case Format::PSEUDO_BRANCH
: {
388 Pseudo_branch_instruction
* branch
= static_cast<Pseudo_branch_instruction
*>(instr
);
389 /* Note: BB0 cannot be a branch target */
390 if (branch
->target
[0] != 0)
391 fprintf(output
, " BB%d", branch
->target
[0]);
392 if (branch
->target
[1] != 0)
393 fprintf(output
, ", BB%d", branch
->target
[1]);
396 case Format::PSEUDO_REDUCTION
: {
397 Pseudo_reduction_instruction
* reduce
= static_cast<Pseudo_reduction_instruction
*>(instr
);
398 fprintf(output
, " op:%s", reduce_ops
[reduce
->reduce_op
]);
399 if (reduce
->cluster_size
)
400 fprintf(output
, " cluster_size:%u", reduce
->cluster_size
);
405 case Format::SCRATCH
: {
406 FLAT_instruction
* flat
= static_cast<FLAT_instruction
*>(instr
);
408 fprintf(output
, " offset:%u", flat
->offset
);
410 fprintf(output
, " glc");
412 fprintf(output
, " dlc");
414 fprintf(output
, " slc");
416 fprintf(output
, " lds");
418 fprintf(output
, " nv");
419 if (flat
->disable_wqm
)
420 fprintf(output
, " disable_wqm");
421 print_barrier_reorder(flat
->can_reorder
, flat
->barrier
, output
);
424 case Format::MTBUF
: {
425 MTBUF_instruction
* mtbuf
= static_cast<MTBUF_instruction
*>(instr
);
426 fprintf(output
, " dfmt:");
427 switch (mtbuf
->dfmt
) {
428 case V_008F0C_BUF_DATA_FORMAT_8
: fprintf(output
, "8"); break;
429 case V_008F0C_BUF_DATA_FORMAT_16
: fprintf(output
, "16"); break;
430 case V_008F0C_BUF_DATA_FORMAT_8_8
: fprintf(output
, "8_8"); break;
431 case V_008F0C_BUF_DATA_FORMAT_32
: fprintf(output
, "32"); break;
432 case V_008F0C_BUF_DATA_FORMAT_16_16
: fprintf(output
, "16_16"); break;
433 case V_008F0C_BUF_DATA_FORMAT_10_11_11
: fprintf(output
, "10_11_11"); break;
434 case V_008F0C_BUF_DATA_FORMAT_11_11_10
: fprintf(output
, "11_11_10"); break;
435 case V_008F0C_BUF_DATA_FORMAT_10_10_10_2
: fprintf(output
, "10_10_10_2"); break;
436 case V_008F0C_BUF_DATA_FORMAT_2_10_10_10
: fprintf(output
, "2_10_10_10"); break;
437 case V_008F0C_BUF_DATA_FORMAT_8_8_8_8
: fprintf(output
, "8_8_8_8"); break;
438 case V_008F0C_BUF_DATA_FORMAT_32_32
: fprintf(output
, "32_32"); break;
439 case V_008F0C_BUF_DATA_FORMAT_16_16_16_16
: fprintf(output
, "16_16_16_16"); break;
440 case V_008F0C_BUF_DATA_FORMAT_32_32_32
: fprintf(output
, "32_32_32"); break;
441 case V_008F0C_BUF_DATA_FORMAT_32_32_32_32
: fprintf(output
, "32_32_32_32"); break;
442 case V_008F0C_BUF_DATA_FORMAT_RESERVED_15
: fprintf(output
, "reserved15"); break;
444 fprintf(output
, " nfmt:");
445 switch (mtbuf
->nfmt
) {
446 case V_008F0C_BUF_NUM_FORMAT_UNORM
: fprintf(output
, "unorm"); break;
447 case V_008F0C_BUF_NUM_FORMAT_SNORM
: fprintf(output
, "snorm"); break;
448 case V_008F0C_BUF_NUM_FORMAT_USCALED
: fprintf(output
, "uscaled"); break;
449 case V_008F0C_BUF_NUM_FORMAT_SSCALED
: fprintf(output
, "sscaled"); break;
450 case V_008F0C_BUF_NUM_FORMAT_UINT
: fprintf(output
, "uint"); break;
451 case V_008F0C_BUF_NUM_FORMAT_SINT
: fprintf(output
, "sint"); break;
452 case V_008F0C_BUF_NUM_FORMAT_SNORM_OGL
: fprintf(output
, "snorm"); break;
453 case V_008F0C_BUF_NUM_FORMAT_FLOAT
: fprintf(output
, "float"); break;
456 fprintf(output
, " offset:%u", mtbuf
->offset
);
458 fprintf(output
, " offen");
460 fprintf(output
, " idxen");
462 fprintf(output
, " glc");
464 fprintf(output
, " dlc");
466 fprintf(output
, " slc");
468 fprintf(output
, " tfe");
469 if (mtbuf
->disable_wqm
)
470 fprintf(output
, " disable_wqm");
471 print_barrier_reorder(mtbuf
->can_reorder
, mtbuf
->barrier
, output
);
478 if (instr
->isVOP3()) {
479 VOP3A_instruction
* vop3
= static_cast<VOP3A_instruction
*>(instr
);
480 switch (vop3
->omod
) {
482 fprintf(output
, " *2");
485 fprintf(output
, " *4");
488 fprintf(output
, " *0.5");
492 fprintf(output
, " clamp");
493 } else if (instr
->isDPP()) {
494 DPP_instruction
* dpp
= static_cast<DPP_instruction
*>(instr
);
495 if (dpp
->dpp_ctrl
<= 0xff) {
496 fprintf(output
, " quad_perm:[%d,%d,%d,%d]",
497 dpp
->dpp_ctrl
& 0x3, (dpp
->dpp_ctrl
>> 2) & 0x3,
498 (dpp
->dpp_ctrl
>> 4) & 0x3, (dpp
->dpp_ctrl
>> 6) & 0x3);
499 } else if (dpp
->dpp_ctrl
>= 0x101 && dpp
->dpp_ctrl
<= 0x10f) {
500 fprintf(output
, " row_shl:%d", dpp
->dpp_ctrl
& 0xf);
501 } else if (dpp
->dpp_ctrl
>= 0x111 && dpp
->dpp_ctrl
<= 0x11f) {
502 fprintf(output
, " row_shr:%d", dpp
->dpp_ctrl
& 0xf);
503 } else if (dpp
->dpp_ctrl
>= 0x121 && dpp
->dpp_ctrl
<= 0x12f) {
504 fprintf(output
, " row_ror:%d", dpp
->dpp_ctrl
& 0xf);
505 } else if (dpp
->dpp_ctrl
== dpp_wf_sl1
) {
506 fprintf(output
, " wave_shl:1");
507 } else if (dpp
->dpp_ctrl
== dpp_wf_rl1
) {
508 fprintf(output
, " wave_rol:1");
509 } else if (dpp
->dpp_ctrl
== dpp_wf_sr1
) {
510 fprintf(output
, " wave_shr:1");
511 } else if (dpp
->dpp_ctrl
== dpp_wf_rr1
) {
512 fprintf(output
, " wave_ror:1");
513 } else if (dpp
->dpp_ctrl
== dpp_row_mirror
) {
514 fprintf(output
, " row_mirror");
515 } else if (dpp
->dpp_ctrl
== dpp_row_half_mirror
) {
516 fprintf(output
, " row_half_mirror");
517 } else if (dpp
->dpp_ctrl
== dpp_row_bcast15
) {
518 fprintf(output
, " row_bcast:15");
519 } else if (dpp
->dpp_ctrl
== dpp_row_bcast31
) {
520 fprintf(output
, " row_bcast:31");
522 fprintf(output
, " dpp_ctrl:0x%.3x", dpp
->dpp_ctrl
);
524 if (dpp
->row_mask
!= 0xf)
525 fprintf(output
, " row_mask:0x%.1x", dpp
->row_mask
);
526 if (dpp
->bank_mask
!= 0xf)
527 fprintf(output
, " bank_mask:0x%.1x", dpp
->bank_mask
);
529 fprintf(output
, " bound_ctrl:1");
530 } else if ((int)instr
->format
& (int)Format::SDWA
) {
531 fprintf(output
, " (printing unimplemented)");
535 void aco_print_instr(struct Instruction
*instr
, FILE *output
)
537 if (!instr
->definitions
.empty()) {
538 for (unsigned i
= 0; i
< instr
->definitions
.size(); ++i
) {
539 print_definition(&instr
->definitions
[i
], output
);
540 if (i
+ 1 != instr
->definitions
.size())
541 fprintf(output
, ", ");
543 fprintf(output
, " = ");
545 fprintf(output
, "%s", instr_info
.name
[(int)instr
->opcode
]);
546 if (instr
->operands
.size()) {
547 bool abs
[instr
->operands
.size()];
548 bool neg
[instr
->operands
.size()];
549 if ((int)instr
->format
& (int)Format::VOP3A
) {
550 VOP3A_instruction
* vop3
= static_cast<VOP3A_instruction
*>(instr
);
551 for (unsigned i
= 0; i
< instr
->operands
.size(); ++i
) {
552 abs
[i
] = vop3
->abs
[i
];
553 neg
[i
] = vop3
->neg
[i
];
555 } else if (instr
->isDPP()) {
556 DPP_instruction
* dpp
= static_cast<DPP_instruction
*>(instr
);
557 assert(instr
->operands
.size() <= 2);
558 for (unsigned i
= 0; i
< instr
->operands
.size(); ++i
) {
559 abs
[i
] = dpp
->abs
[i
];
560 neg
[i
] = dpp
->neg
[i
];
563 for (unsigned i
= 0; i
< instr
->operands
.size(); ++i
) {
568 for (unsigned i
= 0; i
< instr
->operands
.size(); ++i
) {
570 fprintf(output
, ", ");
572 fprintf(output
, " ");
575 fprintf(output
, "-");
577 fprintf(output
, "|");
578 print_operand(&instr
->operands
[i
], output
);
580 fprintf(output
, "|");
583 print_instr_format_specific(instr
, output
);
586 static void print_block_kind(uint16_t kind
, FILE *output
)
588 if (kind
& block_kind_uniform
)
589 fprintf(output
, "uniform, ");
590 if (kind
& block_kind_top_level
)
591 fprintf(output
, "top-level, ");
592 if (kind
& block_kind_loop_preheader
)
593 fprintf(output
, "loop-preheader, ");
594 if (kind
& block_kind_loop_header
)
595 fprintf(output
, "loop-header, ");
596 if (kind
& block_kind_loop_exit
)
597 fprintf(output
, "loop-exit, ");
598 if (kind
& block_kind_continue
)
599 fprintf(output
, "continue, ");
600 if (kind
& block_kind_break
)
601 fprintf(output
, "break, ");
602 if (kind
& block_kind_continue_or_break
)
603 fprintf(output
, "continue_or_break, ");
604 if (kind
& block_kind_discard
)
605 fprintf(output
, "discard, ");
606 if (kind
& block_kind_branch
)
607 fprintf(output
, "branch, ");
608 if (kind
& block_kind_merge
)
609 fprintf(output
, "merge, ");
610 if (kind
& block_kind_invert
)
611 fprintf(output
, "invert, ");
612 if (kind
& block_kind_uses_discard_if
)
613 fprintf(output
, "discard_if, ");
614 if (kind
& block_kind_needs_lowering
)
615 fprintf(output
, "needs_lowering, ");
616 if (kind
& block_kind_uses_demote
)
617 fprintf(output
, "uses_demote, ");
620 void aco_print_block(const struct Block
* block
, FILE *output
)
622 fprintf(output
, "BB%d\n", block
->index
);
623 fprintf(output
, "/* logical preds: ");
624 for (unsigned pred
: block
->logical_preds
)
625 fprintf(output
, "BB%d, ", pred
);
626 fprintf(output
, "/ linear preds: ");
627 for (unsigned pred
: block
->linear_preds
)
628 fprintf(output
, "BB%d, ", pred
);
629 fprintf(output
, "/ kind: ");
630 print_block_kind(block
->kind
, output
);
631 fprintf(output
, "*/\n");
632 for (auto const& instr
: block
->instructions
) {
633 fprintf(output
, "\t");
634 aco_print_instr(instr
.get(), output
);
635 fprintf(output
, "\n");
639 void aco_print_program(Program
*program
, FILE *output
)
641 for (Block
const& block
: program
->blocks
)
642 aco_print_block(&block
, output
);
644 if (program
->constant_data
.size()) {
645 fprintf(output
, "\n/* constant data */\n");
646 for (unsigned i
= 0; i
< program
->constant_data
.size(); i
+= 32) {
647 fprintf(output
, "[%06d] ", i
);
648 unsigned line_size
= std::min
<size_t>(program
->constant_data
.size() - i
, 32);
649 for (unsigned j
= 0; j
< line_size
; j
+= 4) {
650 unsigned size
= std::min
<size_t>(program
->constant_data
.size() - (i
+ j
), 4);
652 memcpy(&v
, &program
->constant_data
[i
+ j
], size
);
653 fprintf(output
, " %08x", v
);
655 fprintf(output
, "\n");
659 fprintf(output
, "\n");