From b361a806bb414d3caa9ee64944c115e88eacb45f Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Sun, 3 Jan 2021 21:53:05 +1300 Subject: [PATCH] pan/bi: Add "lane_dest" modifier Similar to the "lane" modifier, but for the instruction destination instead the sources. Part-of: --- src/panfrost/bifrost/bi_builder.h.py | 2 +- src/panfrost/bifrost/bi_packer.c.py | 3 +++ src/panfrost/bifrost/bi_printer.c.py | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_builder.h.py b/src/panfrost/bifrost/bi_builder.h.py index 903ef4e0228..2425024afc1 100644 --- a/src/panfrost/bifrost/bi_builder.h.py +++ b/src/panfrost/bifrost/bi_builder.h.py @@ -19,7 +19,7 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. -SKIP = set(["lane", "lanes", "lanes", "replicate", "swz", "widen", "swap", "neg", "abs", "not", "sign", "extend", "divzero", "clamp", "sem", "not_result", "skip"]) +SKIP = set(["lane", "lane_dest", "lanes", "lanes", "replicate", "swz", "widen", "swap", "neg", "abs", "not", "sign", "extend", "divzero", "clamp", "sem", "not_result", "skip"]) TEMPLATE = """ #ifndef _BI_BUILDER_H_ diff --git a/src/panfrost/bifrost/bi_packer.c.py b/src/panfrost/bifrost/bi_packer.c.py index 28669ebfa13..0c63ed60e59 100644 --- a/src/panfrost/bifrost/bi_packer.c.py +++ b/src/panfrost/bifrost/bi_packer.c.py @@ -107,6 +107,9 @@ def pack_modifier(mod, width, default, opts, body, pack_exprs): # Construct a list lists = [pick_from_bucket(opts, bucket) for bucket in SWIZZLE_BUCKETS] ir_value = "src[{}].swizzle".format(arg) + elif raw == "lane_dest": + lists = [pick_from_bucket(opts, bucket) for bucket in SWIZZLE_BUCKETS] + ir_value = "dest->swizzle" elif raw in ["abs", "sign"]: ir_value = "src[{}].abs".format(arg) elif raw in ["neg", "not"]: diff --git a/src/panfrost/bifrost/bi_printer.c.py b/src/panfrost/bifrost/bi_printer.c.py index 5692633b4f5..306124b5811 100644 --- a/src/panfrost/bifrost/bi_printer.c.py +++ b/src/panfrost/bifrost/bi_printer.c.py @@ -129,11 +129,13 @@ bi_${mod}_as_str(enum bi_${mod} ${mod}) <%def name="print_modifiers(mods, table)"> % for mod in mods: + % if mod not in ["lane_dest"]: % if len(table[mod]) > 2: fputs(bi_${mod}_as_str(I->${mod}), fp); % else: if (I->${mod}) fputs(".${mod}", fp); % endif + % endif % endfor