pan/midgard: Add units for more instructions
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 30 Jul 2019 23:55:16 +0000 (16:55 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 31 Jul 2019 16:39:16 +0000 (09:39 -0700)
For everything but freduce, we have some sense of what units the
instruction takes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard.h
src/panfrost/midgard/midgard_ops.c

index 28b79575ff7118734b09a12279b423284e5338ce..04257a737bd3a98ab95b9f8e23183868fd162392 100644 (file)
@@ -78,7 +78,7 @@ typedef enum {
         midgard_alu_op_freduce    = 0x3F,
 
         midgard_alu_op_iadd       = 0x40,
-        midgard_alu_op_ishladd    = 0x41,
+        midgard_alu_op_ishladd    = 0x41, /* a + (b<<1) */
         midgard_alu_op_isub       = 0x46,
         midgard_alu_op_iaddsat    = 0x48,
         midgard_alu_op_uaddsat    = 0x49,
index e0d8d886a79260802d76fa7a06e5a430cce823b5..37aa69f962a078a958657861e05b6ecaa42cc022 100644 (file)
@@ -64,6 +64,7 @@ struct mir_op_props alu_opcode_props[256] = {
 
         /* Incredibly, iadd can run on vmul, etc */
         [midgard_alu_op_iadd]           = {"iadd", UNITS_MOST | OP_COMMUTES},
+        [midgard_alu_op_ishladd]         = {"ishladd", UNITS_MUL},
         [midgard_alu_op_iaddsat]        = {"iaddsat", UNITS_ADD | OP_COMMUTES},
         [midgard_alu_op_uaddsat]        = {"uaddsat", UNITS_ADD | OP_COMMUTES},
         [midgard_alu_op_iabsdiff]       = {"iabsdiff", UNITS_ADD},
@@ -161,12 +162,11 @@ struct mir_op_props alu_opcode_props[256] = {
         [midgard_alu_op_ubany_lt]       = {"ubany_lt",  UNITS_VECTOR | OP_CHANNEL_COUNT(4) | OP_COMMUTES},
         [midgard_alu_op_ubany_lte]      = {"ubany_lte", UNITS_VECTOR | OP_CHANNEL_COUNT(4) | OP_COMMUTES},
 
-        /* These instructions are not yet emitted by the compiler, so
-         * don't speculate about units yet */
-        [midgard_alu_op_ishladd]        = {"ishladd", 0},
+        [midgard_alu_op_fatan2_pt1]     = {"fatan2_pt1", UNIT_VLUT},
+        [midgard_alu_op_fatan_pt2]      = {"fatan_pt2", UNIT_VLUT},
+
+        /* Haven't seen in a while */
         [midgard_alu_op_freduce]        = {"freduce", 0},
-        [midgard_alu_op_fatan2_pt1]     = {"fatan2_pt1", 0},
-        [midgard_alu_op_fatan_pt2]      = {"fatan_pt2", 0},
 };
 
 const char *load_store_opcode_names[256] = {