print_reg_class(definition->regClass(), output);
if (definition->isPrecise())
fprintf(output, "(precise)");
+ if (definition->isNUW())
+ fprintf(output, "(nuw)");
fprintf(output, "%%%d", definition->tempId());
if (definition->isFixed())
print_physReg(definition->physReg(), definition->bytes(), output);
}
-static void print_barrier_reorder(bool can_reorder, barrier_interaction barrier, FILE *output)
+static void print_storage(storage_class storage, FILE *output)
{
- if (can_reorder)
- fprintf(output, " reorder");
+ fprintf(output, " storage:");
+ int printed = 0;
+ if (storage & storage_buffer)
+ printed += fprintf(output, "%sbuffer", printed ? "," : "");
+ if (storage & storage_atomic_counter)
+ printed += fprintf(output, "%satomic_counter", printed ? "," : "");
+ if (storage & storage_image)
+ printed += fprintf(output, "%simage", printed ? "," : "");
+ if (storage & storage_shared)
+ printed += fprintf(output, "%sshared", printed ? "," : "");
+ if (storage & storage_vmem_output)
+ printed += fprintf(output, "%svmem_output", printed ? "," : "");
+ if (storage & storage_scratch)
+ printed += fprintf(output, "%sscratch", printed ? "," : "");
+ if (storage & storage_vgpr_spill)
+ printed += fprintf(output, "%svgpr_spill", printed ? "," : "");
+}
+
+static void print_semantics(memory_semantics sem, FILE *output)
+{
+ fprintf(output, " semantics:");
+ int printed = 0;
+ if (sem & semantic_acquire)
+ printed += fprintf(output, "%sacquire", printed ? "," : "");
+ if (sem & semantic_release)
+ printed += fprintf(output, "%srelease", printed ? "," : "");
+ if (sem & semantic_volatile)
+ printed += fprintf(output, "%svolatile", printed ? "," : "");
+ if (sem & semantic_private)
+ printed += fprintf(output, "%sprivate", printed ? "," : "");
+ if (sem & semantic_can_reorder)
+ printed += fprintf(output, "%sreorder", printed ? "," : "");
+ if (sem & semantic_atomic)
+ printed += fprintf(output, "%satomic", printed ? "," : "");
+ if (sem & semantic_rmw)
+ printed += fprintf(output, "%srmw", printed ? "," : "");
+}
+
+static void print_scope(sync_scope scope, FILE *output, const char *prefix="scope")
+{
+ fprintf(output, " %s:", prefix);
+ switch (scope) {
+ case scope_invocation:
+ fprintf(output, "invocation");
+ break;
+ case scope_subgroup:
+ fprintf(output, "subgroup");
+ break;
+ case scope_workgroup:
+ fprintf(output, "workgroup");
+ break;
+ case scope_queuefamily:
+ fprintf(output, "queuefamily");
+ break;
+ case scope_device:
+ fprintf(output, "device");
+ break;
+ }
+}
- if (barrier & barrier_buffer)
- fprintf(output, " buffer");
- if (barrier & barrier_image)
- fprintf(output, " image");
- if (barrier & barrier_atomic)
- fprintf(output, " atomic");
- if (barrier & barrier_shared)
- fprintf(output, " shared");
- if (barrier & barrier_gs_data)
- fprintf(output, " gs_data");
- if (barrier & barrier_gs_sendmsg)
- fprintf(output, " gs_sendmsg");
+static void print_sync(memory_sync_info sync, FILE *output)
+{
+ print_storage(sync.storage, output);
+ print_semantics(sync.semantics, output);
+ print_scope(sync.scope, output);
}
static void print_instr_format_specific(const Instruction *instr, FILE *output)
fprintf(output, " dlc");
if (smem->nv)
fprintf(output, " nv");
- print_barrier_reorder(smem->can_reorder, smem->barrier, output);
+ print_sync(smem->sync, output);
break;
}
case Format::VINTRP: {
fprintf(output, " offset1:%u", ds->offset1);
if (ds->gds)
fprintf(output, " gds");
+ print_sync(ds->sync, output);
break;
}
case Format::MUBUF: {
fprintf(output, " lds");
if (mubuf->disable_wqm)
fprintf(output, " disable_wqm");
- print_barrier_reorder(mubuf->can_reorder, mubuf->barrier, output);
+ print_sync(mubuf->sync, output);
break;
}
case Format::MIMG: {
fprintf(output, " d16");
if (mimg->disable_wqm)
fprintf(output, " disable_wqm");
- print_barrier_reorder(mimg->can_reorder, mimg->barrier, output);
+ print_sync(mimg->sync, output);
break;
}
case Format::EXP: {
fprintf(output, " cluster_size:%u", reduce->cluster_size);
break;
}
+ case Format::PSEUDO_BARRIER: {
+ const Pseudo_barrier_instruction* barrier = static_cast<const Pseudo_barrier_instruction*>(instr);
+ print_sync(barrier->sync, output);
+ print_scope(barrier->exec_scope, output, "exec_scope");
+ break;
+ }
case Format::FLAT:
case Format::GLOBAL:
case Format::SCRATCH: {
fprintf(output, " nv");
if (flat->disable_wqm)
fprintf(output, " disable_wqm");
- print_barrier_reorder(flat->can_reorder, flat->barrier, output);
+ print_sync(flat->sync, output);
break;
}
case Format::MTBUF: {
fprintf(output, " tfe");
if (mtbuf->disable_wqm)
fprintf(output, " disable_wqm");
- print_barrier_reorder(mtbuf->can_reorder, mtbuf->barrier, output);
+ print_sync(mtbuf->sync, output);
break;
}
case Format::VOP3P: {