Module: Mesa
Branch: master
Commit: aa2156f9493a67d8a00d168e3e11783c9bb4fa1a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa2156f9493a67d8a00d168e3e11783c9bb4fa1a

Author: Boris Brezillon <[email protected]>
Date:   Thu Nov 12 19:19:04 2020 +0100

pan/bi: Support automatic register format

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7636>

---

 src/panfrost/bifrost/gen_pack.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/gen_pack.py b/src/panfrost/bifrost/gen_pack.py
index e8ccf9ea12d..e9025ae3fbc 100644
--- a/src/panfrost/bifrost/gen_pack.py
+++ b/src/panfrost/bifrost/gen_pack.py
@@ -181,10 +181,16 @@ def pack_register_format(mod, opts, body, pack_exprs):
     body.append('unsigned {}_temp = 0;'.format(mod))
 
     first = True
+    auto = None
     for i, op in enumerate(opts):
         if op is None or op == 'reserved':
             continue
 
+        if op == 'auto':
+            assert(auto == None)
+            auto = i
+            continue
+
         t_else = 'else ' if not first else ''
         first = False
         nir_type = REGISTER_FORMATS.get(op)
@@ -193,7 +199,10 @@ def pack_register_format(mod, opts, body, pack_exprs):
             body.append('{}if (ins->format == {}) {}_temp = 
{};'.format(t_else, nir_type, mod, i))
 
     assert not first
-    body.append('else unreachable("Could not pattern match register format");')
+    if auto is None:
+        body.append('else unreachable("Could not pattern match register 
format");')
+    else:
+        body.append('else {}_temp = {};'.format(mod, auto))
     return mod + '_temp'
 
 def pack_seg(mod, opts, body, pack_exprs):

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to