[Mesa-dev] [PATCH 1/2] i965/disasm: Remove tables with obvious mappings.

Matt Turner mattst88 at gmail.com
Mon Apr 21 10:01:33 PDT 2014


---
 src/mesa/drivers/dri/i965/brw_disasm.c  | 11 +----------
 src/mesa/drivers/dri/i965/gen8_disasm.c |  4 +---
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c
index 88bf24e..0bc7a64 100644
--- a/src/mesa/drivers/dri/i965/brw_disasm.c
+++ b/src/mesa/drivers/dri/i965/brw_disasm.c
@@ -1085,19 +1085,10 @@ static int src1 (FILE *file, struct brw_instruction *inst)
     }
 }
 
-int esize[6] = {
-	[0] = 1,
-	[1] = 2,
-	[2] = 4,
-	[3] = 8,
-	[4] = 16,
-	[5] = 32,
-};
-
 static int qtr_ctrl(FILE *file, struct brw_instruction *inst)
 {
     int qtr_ctl = inst->header.compression_control;
-    int exec_size = esize[inst->header.execution_size];
+    int exec_size = 1 << inst->header.execution_size;
 
     if (exec_size == 8) {
 	switch (qtr_ctl) {
diff --git a/src/mesa/drivers/dri/i965/gen8_disasm.c b/src/mesa/drivers/dri/i965/gen8_disasm.c
index cc3d864..a8b8c7a 100644
--- a/src/mesa/drivers/dri/i965/gen8_disasm.c
+++ b/src/mesa/drivers/dri/i965/gen8_disasm.c
@@ -742,13 +742,11 @@ src1(FILE *file, struct gen8_instruction *inst)
    }
 }
 
-static int esize[6] = { 1, 2, 4, 8, 16, 32 };
-
 static int
 qtr_ctrl(FILE *file, struct gen8_instruction *inst)
 {
    int qtr_ctl = gen8_qtr_control(inst);
-   int exec_size = esize[gen8_exec_size(inst)];
+   int exec_size = 1 << gen8_exec_size(inst);
 
    if (exec_size == 8) {
       switch (qtr_ctl) {
-- 
1.8.3.2



More information about the mesa-dev mailing list