diff options
author | Eric Anholt <[email protected]> | 2015-01-12 09:10:35 +1300 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-01-15 22:19:25 +1300 |
commit | 772c47aefe96694c5f3fa354bd6792d137824700 (patch) | |
tree | 7c5dd627dc2486144282fcbec79c2e4f2a0b4ff6 /src/gallium/drivers/vc4 | |
parent | 8f2fb68026d11feedb5d94cf17e719affe7b9423 (diff) |
vc4: Move the tests for src needing to be an A register to vc4_qir.c.
I want it from another location.
Diffstat (limited to 'src/gallium/drivers/vc4')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.c | 22 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_register_allocate.c | 22 |
3 files changed, 28 insertions, 17 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.c b/src/gallium/drivers/vc4/vc4_qir.c index 40356c99ff3..0be60cb04bc 100644 --- a/src/gallium/drivers/vc4/vc4_qir.c +++ b/src/gallium/drivers/vc4/vc4_qir.c @@ -193,6 +193,28 @@ qir_depends_on_flags(struct qinst *inst) } bool +qir_src_needs_a_file(struct qinst *inst) +{ + switch (inst->op) { + case QOP_UNPACK_8A_F: + case QOP_UNPACK_8B_F: + case QOP_UNPACK_8C_F: + case QOP_UNPACK_8D_F: + case QOP_UNPACK_16A_F: + case QOP_UNPACK_16B_F: + case QOP_UNPACK_8A_I: + case QOP_UNPACK_8B_I: + case QOP_UNPACK_8C_I: + case QOP_UNPACK_8D_I: + case QOP_UNPACK_16A_I: + case QOP_UNPACK_16B_I: + return true; + default: + return false; + } +} + +bool qir_writes_r4(struct qinst *inst) { switch (inst->op) { diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h index 307a79f77c6..746bff9bbf6 100644 --- a/src/gallium/drivers/vc4/vc4_qir.h +++ b/src/gallium/drivers/vc4/vc4_qir.h @@ -385,6 +385,7 @@ bool qir_is_multi_instruction(struct qinst *inst); bool qir_depends_on_flags(struct qinst *inst); bool qir_writes_r4(struct qinst *inst); bool qir_reads_r4(struct qinst *inst); +bool qir_src_needs_a_file(struct qinst *inst); struct qreg qir_follow_movs(struct qinst **defs, struct qreg reg); void qir_dump(struct vc4_compile *c); diff --git a/src/gallium/drivers/vc4/vc4_register_allocate.c b/src/gallium/drivers/vc4/vc4_register_allocate.c index efd9d51eaa0..f40547b8154 100644 --- a/src/gallium/drivers/vc4/vc4_register_allocate.c +++ b/src/gallium/drivers/vc4/vc4_register_allocate.c @@ -254,26 +254,14 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c) vc4->reg_class_a); break; - case QOP_UNPACK_8A_F: - case QOP_UNPACK_8B_F: - case QOP_UNPACK_8C_F: - case QOP_UNPACK_8D_F: - case QOP_UNPACK_16A_F: - case QOP_UNPACK_16B_F: - case QOP_UNPACK_8A_I: - case QOP_UNPACK_8B_I: - case QOP_UNPACK_8C_I: - case QOP_UNPACK_8D_I: - case QOP_UNPACK_16A_I: - case QOP_UNPACK_16B_I: - /* The unpack flags require an A-file src register. */ - ra_set_node_class(g, temp_to_node[inst->src[0].index], - vc4->reg_class_a); - break; - default: break; } + + if (qir_src_needs_a_file(inst)) { + ra_set_node_class(g, temp_to_node[inst->src[0].index], + vc4->reg_class_a); + } } for (uint32_t i = 0; i < c->num_temps; i++) { |