aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-09-13 23:10:42 +0800
committerChia-I Wu <[email protected]>2014-09-14 00:30:33 +0800
commit5341001b94f94844fc23db931fb7d9357beb18e5 (patch)
treef1549481bfb91bb0c8c504f0b2558f32c0eb950f /src/gallium/drivers/ilo
parent1d7b0d832c474582824d663a795213d2889a737b (diff)
ilo: derive 3-src instructions from the opcode table
One less switch statement to maintain. Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/gallium/drivers/ilo')
-rw-r--r--src/gallium/drivers/ilo/shader/toy_compiler_disasm.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c b/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c
index fffa8bfdc03..7c1c32e98e4 100644
--- a/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c
+++ b/src/gallium/drivers/ilo/shader/toy_compiler_disasm.c
@@ -498,19 +498,12 @@ disasm_inst_decode(struct disasm_inst *inst,
disasm_inst_decode_dw0_gen6(inst, dw[0]);
- switch (inst->opcode) {
- case GEN7_OPCODE_CSEL:
- case GEN7_OPCODE_BFE:
- case GEN7_OPCODE_BFI2:
- case GEN6_OPCODE_MAD:
- case GEN6_OPCODE_LRP:
+ if (disasm_opcode_table[inst->opcode].src_count == 3) {
disasm_inst_decode_3src_dw1_gen6(inst, dw[1]);
disasm_inst_decode_3src_dw2_dw3_gen6(inst, dw[2], dw[3]);
- break;
- default:
+ } else {
disasm_inst_decode_dw1_gen6(inst, dw[1]);
disasm_inst_decode_dw2_dw3_gen6(inst, dw[2], dw[3]);
- break;
}
}