Mesa (main): aco/opcodes: remove definition_size[]

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 23 10:48:49 UTC 2021


Module: Mesa
Branch: main
Commit: 077776a866fd91fbbec344f6e61ac4b5bf548d82
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=077776a866fd91fbbec344f6e61ac4b5bf548d82

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Fri Aug 13 14:39:29 2021 +0200

aco/opcodes: remove definition_size[]

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12364>

---

 src/amd/compiler/aco_ir.h           |  1 -
 src/amd/compiler/aco_opcodes.py     | 22 ++--------------------
 src/amd/compiler/aco_opcodes_cpp.py |  5 -----
 3 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h
index 0fa4fc824d5..2b0f7d34550 100644
--- a/src/amd/compiler/aco_ir.h
+++ b/src/amd/compiler/aco_ir.h
@@ -2202,7 +2202,6 @@ typedef struct {
    const aco::Format format[static_cast<int>(aco_opcode::num_opcodes)];
    /* sizes used for input/output modifiers and constants */
    const unsigned operand_size[static_cast<int>(aco_opcode::num_opcodes)];
-   const unsigned definition_size[static_cast<int>(aco_opcode::num_opcodes)];
    const instr_class classes[static_cast<int>(aco_opcode::num_opcodes)];
 } Info;
 
diff --git a/src/amd/compiler/aco_opcodes.py b/src/amd/compiler/aco_opcodes.py
index d9ab6a435ef..6f860721ae5 100644
--- a/src/amd/compiler/aco_opcodes.py
+++ b/src/amd/compiler/aco_opcodes.py
@@ -219,20 +219,15 @@ class Opcode(object):
 
       parts = name.replace('_e64', '').rsplit('_', 2)
       op_dtype = parts[-1]
-      def_dtype = parts[-2] if len(parts) > 1 else parts[-1]
 
-      def_dtype_sizes = {'{}{}'.format(prefix, size) : size for prefix in 'biuf' for size in [64, 32, 24, 16]}
-      op_dtype_sizes = {k:v for k, v in def_dtype_sizes.items()}
+      op_dtype_sizes = {'{}{}'.format(prefix, size) : size for prefix in 'biuf' for size in [64, 32, 24, 16]}
       # inline constants are 32-bit for 16-bit integer/typeless instructions: https://reviews.llvm.org/D81841
       op_dtype_sizes['b16'] = 32
       op_dtype_sizes['i16'] = 32
       op_dtype_sizes['u16'] = 32
 
-      # If we can't tell the definition size and the operand size, default to
-      # 32. Some opcodes can have a larger definition size, but
-      # get_subdword_definition_info() handles that.
+      # If we can't tell the operand size, default to 32.
       self.operand_size = op_dtype_sizes.get(op_dtype, 32)
-      self.definition_size = def_dtype_sizes.get(def_dtype, self.operand_size)
 
       # exceptions for operands:
       if 'qsad_' in name:
@@ -249,15 +244,6 @@ class Opcode(object):
                     'v_cvt_f32_ubyte2', 'v_cvt_f32_ubyte3']:
         self.operand_size = 32
 
-      # exceptions for definitions:
-      if 'qsad_' in name:
-        self.definition_size = 0
-      elif 'sad_' in name:
-        self.definition_size = 32
-      elif '_pk' in name:
-        self.definition_size = 32
-
-
 # global dictionary of opcodes
 opcodes = {}
 
@@ -1701,7 +1687,3 @@ for ver in ['gfx9', 'gfx10']:
         else:
             op_to_name[key] = op.name
 
-# These instructions write the entire 32-bit VGPR, but it's not clear in Opcode's constructor that
-# it should be 32, since it works accidentally.
-assert(opcodes['ds_read_u8'].definition_size == 32)
-assert(opcodes['ds_read_u16'].definition_size == 32)
diff --git a/src/amd/compiler/aco_opcodes_cpp.py b/src/amd/compiler/aco_opcodes_cpp.py
index a70bec934f3..da6cb8ad3d4 100644
--- a/src/amd/compiler/aco_opcodes_cpp.py
+++ b/src/amd/compiler/aco_opcodes_cpp.py
@@ -70,11 +70,6 @@ extern const aco::Info instr_info = {
       ${opcodes[name].operand_size},
       % endfor
    },
-   .definition_size = {
-      % for name in opcode_names:
-      ${opcodes[name].definition_size},
-      % endfor
-   },
    .classes = {
       % for name in opcode_names:
       (instr_class)${opcodes[name].cls.value},



More information about the mesa-commit mailing list