Mesa (main): isaspec: Handle patterns bigger then 64 bit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 14 13:11:41 UTC 2022


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

Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Sun Jun 12 13:34:30 2022 +0200

isaspec: Handle patterns bigger then 64 bit

Currently uint64_t_to_bitmask(..) is used in combination with
the pattern 'match'. This only works for values smaller then
64 bit. Add support for bigger isa sizes.

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Reviewed-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16996>

---

 src/compiler/isaspec/encode.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/compiler/isaspec/encode.py b/src/compiler/isaspec/encode.py
index f24cfba5deb..8daa1ff9f5e 100755
--- a/src/compiler/isaspec/encode.py
+++ b/src/compiler/isaspec/encode.py
@@ -528,7 +528,19 @@ encode${root.get_c_name()}(struct encode_state *s, struct bitset_params *p, ${ro
       if (s->gen >= ${leaf.gen_min} && s->gen <= ${leaf.gen_max}) {
 %           endif
 <% snippet = encode_bitset.render(s=s, root=root, leaf=leaf) %>
-      bitmask_t val = uint64_t_to_bitmask(${hex(leaf.get_pattern().match)});
+<%    words = isa.split_bits((leaf.get_pattern().match), 64) %>
+      bitmask_t val = uint64_t_to_bitmask(${words[-1]});
+
+<%    words.pop() %>
+
+%     for x in reversed(range(len(words))):
+      {
+         bitmask_t word = uint64_t_to_bitmask(${words[x]});
+         BITSET_SHL(val.bitset, 64);
+         BITSET_OR(val.bitset, val.bitset, word.bitset);
+      }
+%     endfor
+
       BITSET_OR(val.bitset, val.bitset, ${root.snippets[snippet]}(s, p, src).bitset);
       return val;
 %           if leaf.has_gen_restriction():



More information about the mesa-commit mailing list