Mesa (main): pan/va: Allow small constants in register pairs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 7 13:44:14 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu Mar 31 10:46:07 2022 -0400

pan/va: Allow small constants in register pairs

They are zero extended 32->64-bit. Allow this. Noticed debugging spilling on
Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15756>

---

 src/panfrost/bifrost/valhall/va_pack.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/panfrost/bifrost/valhall/va_pack.c b/src/panfrost/bifrost/valhall/va_pack.c
index 3df70295190..6736057f0d8 100644
--- a/src/panfrost/bifrost/valhall/va_pack.c
+++ b/src/panfrost/bifrost/valhall/va_pack.c
@@ -45,6 +45,9 @@ va_validate_register_pair(const bi_instr *I, unsigned s)
    if (lo.type == BI_INDEX_REGISTER) {
       assert(hi.value & 1);
       assert(hi.value == lo.value + 1);
+   } else if (lo.type == BI_INDEX_FAU && lo.value & BIR_FAU_IMMEDIATE) {
+      /* Small constants are zero extended, so the top word encode zero */
+      assert(hi.value == (BIR_FAU_IMMEDIATE | 0));
    } else {
       assert(hi.offset & 1);
       assert(hi.offset == lo.offset + 1);



More information about the mesa-commit mailing list