Mesa (main): freedreno/isa: add uoffset type to print positive-only offsets

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 25 15:56:42 UTC 2021


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

Author: Danylo Piliaiev <dpiliaiev at igalia.com>
Date:   Fri Jun 18 18:09:01 2021 +0300

freedreno/isa: add uoffset type to print positive-only offsets

Signed-off-by: Danylo Piliaiev <dpiliaiev at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11431>

---

 src/freedreno/isa/decode.c | 5 +++++
 src/freedreno/isa/decode.h | 3 ++-
 src/freedreno/isa/isa.py   | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/freedreno/isa/decode.c b/src/freedreno/isa/decode.c
index c8c8aa9874e..636317f049e 100644
--- a/src/freedreno/isa/decode.c
+++ b/src/freedreno/isa/decode.c
@@ -540,6 +540,11 @@ display_field(struct decode_scope *scope, const char *field_name)
 			fprintf(out, "%+"PRId64, util_sign_extend(val, width));
 		}
 		break;
+	case TYPE_UOFFSET:
+		if (val != 0) {
+			fprintf(out, "+%"PRIu64, val);
+		}
+		break;
 	case TYPE_FLOAT:
 		if (width == 16) {
 			fprintf(out, "%f", _mesa_half_to_float(val));
diff --git a/src/freedreno/isa/decode.h b/src/freedreno/isa/decode.h
index f9c8fcb5694..fbf1747095e 100644
--- a/src/freedreno/isa/decode.h
+++ b/src/freedreno/isa/decode.h
@@ -89,7 +89,8 @@ struct isa_field {
 		TYPE_INT,
 		TYPE_UINT,
 		TYPE_HEX,
-		TYPE_OFFSET,   /* Like INT but formated with +/- or ommited if ==0 */
+		TYPE_OFFSET,   /* Like INT but formated with +/- or omitted if ==0 */
+		TYPE_UOFFSET,  /* Like UINT but formated with + or omitted if ==0 */
 		TYPE_FLOAT,
 		TYPE_BOOL,
 		TYPE_ENUM,
diff --git a/src/freedreno/isa/isa.py b/src/freedreno/isa/isa.py
index d7d148443e5..6323812d600 100644
--- a/src/freedreno/isa/isa.py
+++ b/src/freedreno/isa/isa.py
@@ -449,7 +449,7 @@ class ISA(object):
     def validate_isa(self):
         # Validate that all bitset fields have valid types, and in
         # the case of bitset type, the sizes match:
-        builtin_types = ['branch', 'int', 'uint', 'hex', 'offset', 'float', 'bool', 'enum']
+        builtin_types = ['branch', 'int', 'uint', 'hex', 'offset', 'uoffset', 'float', 'bool', 'enum']
         for bitset_name, bitset in self.bitsets.items():
             if bitset.extends is not None:
                 assert bitset.extends in self.bitsets, "{} extends invalid type: {}".format(



More information about the mesa-commit mailing list