Mesa (main): pan/va: Add start property to source
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Mar 17 18:24:57 UTC 2022
Module: Mesa
Branch: main
Commit: 9878469833b5f5103499631e544de7e68d5ac3a5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9878469833b5f5103499631e544de7e68d5ac3a5
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Fri Mar 4 19:59:50 2022 -0500
pan/va: Add start property to source
The bit position of sources is more complicated than (8 * index). Make it a part
of the Valhall reflection information.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>
---
src/panfrost/bifrost/valhall/asm.py | 2 +-
src/panfrost/bifrost/valhall/disasm.py | 6 +++---
src/panfrost/bifrost/valhall/valhall.py | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/panfrost/bifrost/valhall/asm.py b/src/panfrost/bifrost/valhall/asm.py
index 58e4d49a8da..4e7aee29c94 100644
--- a/src/panfrost/bifrost/valhall/asm.py
+++ b/src/panfrost/bifrost/valhall/asm.py
@@ -258,7 +258,7 @@ def parse_asm(line):
for i, (op, src) in enumerate(zip(operands, ins.srcs)):
parts = op.split('.')
- encoded |= encode_source(parts[0], fau) << (i * 8)
+ encoded |= encode_source(parts[0], fau) << src.start
# Has a swizzle been applied yet?
swizzled = False
diff --git a/src/panfrost/bifrost/valhall/disasm.py b/src/panfrost/bifrost/valhall/disasm.py
index b557c349fea..ada4ac25708 100644
--- a/src/panfrost/bifrost/valhall/disasm.py
+++ b/src/panfrost/bifrost/valhall/disasm.py
@@ -199,13 +199,13 @@ va_disasm_instr(FILE *fp, uint64_t instr)
% endif
<% no_comma = False %>
% if src.absneg:
- va_print_float_src(fp, instr >> ${8 * i}, imm_mode,
+ va_print_float_src(fp, instr >> ${src.start}, imm_mode,
instr & BIT(${src.offset['neg']}),
instr & BIT(${src.offset['abs']}));
% elif src.is_float:
- va_print_float_src(fp, instr >> ${8 * i}, imm_mode, false, false);
+ va_print_float_src(fp, instr >> ${src.start}, imm_mode, false, false);
% else:
- va_print_src(fp, instr >> ${8 * i}, imm_mode);
+ va_print_src(fp, instr >> ${src.start}, imm_mode);
% endif
% if src.swizzle:
% if src.size == 32:
diff --git a/src/panfrost/bifrost/valhall/valhall.py b/src/panfrost/bifrost/valhall/valhall.py
index 757149b895a..97357a46880 100644
--- a/src/panfrost/bifrost/valhall/valhall.py
+++ b/src/panfrost/bifrost/valhall/valhall.py
@@ -102,6 +102,7 @@ class Source:
def __init__(self, index, size, is_float = False, swizzle = False,
halfswizzle = False, widen = False, lanes = False, combine = False, lane = None, absneg = False, notted = False, name = ""):
self.is_float = is_float or absneg
+ self.start = (index * 8)
self.size = size
self.absneg = absneg
self.notted = notted
More information about the mesa-commit
mailing list