summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-03-14 14:39:51 -0700
committerEric Anholt <[email protected]>2018-03-19 16:42:59 -0700
commit34dc64f6274db73851b0f1e5f0440a9785cafd6c (patch)
treede5fb9de72abb7011d488df5af04108f280b1844 /src
parentd721348dcdb3658572c5952563d1f4d1ca0321af (diff)
broadcom/vc5: On QPU pack error, dump the instruction and return cleanly.
This is nice for debugging when you've made a bad instruction.
Diffstat (limited to 'src')
-rw-r--r--src/broadcom/compiler/vir_to_qpu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/broadcom/compiler/vir_to_qpu.c b/src/broadcom/compiler/vir_to_qpu.c
index 568a004803b..83b1936cbd9 100644
--- a/src/broadcom/compiler/vir_to_qpu.c
+++ b/src/broadcom/compiler/vir_to_qpu.c
@@ -388,7 +388,13 @@ v3d_vir_to_qpu(struct v3d_compile *c, struct qpu_reg *temp_registers)
vir_for_each_inst_inorder(inst, c) {
bool ok = v3d_qpu_instr_pack(c->devinfo, &inst->qpu,
&c->qpu_insts[i++]);
- assert(ok); (void) ok;
+ if (!ok) {
+ fprintf(stderr, "Failed to pack instruction:\n");
+ vir_dump_inst(c, inst);
+ fprintf(stderr, "\n");
+ c->failed = true;
+ return;
+ }
}
assert(i == c->qpu_inst_count);