From eee6dad0c97960d98f5785997e1e42ba583ba40b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 17 Feb 2022 14:05:18 -0500 Subject: [PATCH] pan/va: Fix definitions of TEX_SINGLE and TEX_FETCH Fix the definitions of the basic texturing instructions. In particular, a register format and a write mask were previously missing, as well as incorrect handling of staging registers. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/valhall/ISA.xml | 95 ++++++++++++++++++++----- src/panfrost/bifrost/valhall/valhall.py | 14 ++++ 2 files changed, 93 insertions(+), 16 deletions(-) diff --git a/src/panfrost/bifrost/valhall/ISA.xml b/src/panfrost/bifrost/valhall/ISA.xml index 30728e033e3..172eb86aeca 100644 --- a/src/panfrost/bifrost/valhall/ISA.xml +++ b/src/panfrost/bifrost/valhall/ISA.xml @@ -518,6 +518,50 @@ sr7 + + write1 + write2 + write3 + write4 + write5 + write6 + write7 + write8 + + + + + r + g + rg + b + rb + gb + rgb + a + ra + ga + rga + ba + rba + gba + rgba + + + + Unsized type, part of a register format. + + f + u + s + + + + Untyped size, part of a register format. + 16 + 32 + + Number of channels loaded/stored for general memory access. none @@ -1972,28 +2016,46 @@ Unfiltered textured instruction. - - - - - - + + + + + + + + + + + + + + + Image to read from - + Ordinary texturing instruction using a sampler. - - - Image to read from - - - - - - + + + + + + + + + + + + + + + + + + Image to read from @@ -2005,6 +2067,7 @@ + Image to read from diff --git a/src/panfrost/bifrost/valhall/valhall.py b/src/panfrost/bifrost/valhall/valhall.py index 32fa00559e4..343c9de82bd 100644 --- a/src/panfrost/bifrost/valhall/valhall.py +++ b/src/panfrost/bifrost/valhall/valhall.py @@ -344,6 +344,19 @@ for child in root.findall('enum'): enums[safe_name(child.attrib['name'])] = build_enum(child) MODIFIERS = { + # Texture instructions share a common encoding + "wide_indices": Flag("wide_indices", 8), + "array_enable": Flag("array_enable", 10), + "texel_offset": Flag("texel_offset", 11), + "shadow": Flag("shadow", 12), + "lod_mode": Modifier("lod_mode", 13, 3), + "write_mask": Modifier("write_mask", 22, 4), + "register_type": Modifier("register_type", 26, 2), + "dimension": Modifier("dimension", 28, 2), + "skip": Flag("skip", 39), + "register_width": Modifier("register_width", 46, 1, force_enum = "register_width"), + "secondary_register_width": Modifier("secondary_register_width", 47, 1, force_enum = "register_width"), + "inactive_result": Modifier("inactive_result", 22, 4), "store_segment": Modifier("store_segment", 24, 2), "regfmt": Modifier("register_format", 24, 3), @@ -359,6 +372,7 @@ MODIFIERS = { "cmp": Modifier("condition", 32, 3), "clamp": Modifier("clamp", 32, 2), "sr_count": Modifier("staging_register_count", 33, 3, implied = True), + "sr_write_count": Modifier("staging_register_write_count", 36, 3, implied = True), "conservative": Flag("conservative", 35), "subgroup": Modifier("subgroup_size", 36, 4),