Module: Mesa
Branch: staging/22.2
Commit: 16757df4cbe53170727af243b6adbf28056496dc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=16757df4cbe53170727af243b6adbf28056496dc

Author: Lionel Landwerlin <[email protected]>
Date:   Sun Jul 24 13:05:57 2022 +0300

intel/fs: fixup SEND validation check on overlapping src0/src1

With the following SEND instruction :

   send(1)         nullUD          nullUD          g0UD            0x4200c504   
             a0.1<0>UD

This instruction although valid but somewhat nonsensical (SEND message
to write at offset contained in NULL register), triggers an error in
the validator.

The restriction is that we cannot have overlapping sources. The
validator not checking the type of register incorrectly thinks that
the null register (offset 0) is the same as g0.

Signed-off-by: Lionel Landwerlin <[email protected]>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <[email protected]>
Reviewed-by: Rohan Garg <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17555>
(cherry picked from commit 3c6fa2703dad46a5026cc3993224feff0f106745)

---

 .pick_status.json                    | 2 +-
 src/intel/compiler/brw_eu_validate.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 14da07a1406..7d4a2f761ab 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -11173,7 +11173,7 @@
         "description": "intel/fs: fixup SEND validation check on overlapping 
src0/src1",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/compiler/brw_eu_validate.c 
b/src/intel/compiler/brw_eu_validate.c
index 05e3add22c9..7344d9ac32c 100644
--- a/src/intel/compiler/brw_eu_validate.c
+++ b/src/intel/compiler/brw_eu_validate.c
@@ -435,7 +435,8 @@ send_restrictions(const struct brw_isa_info *isa,
                brw_inst_send_src1_reg_nr(devinfo, inst) < 112,
                "send with EOT must use g112-g127");
 
-      if (brw_inst_send_src1_reg_file(devinfo, inst) == 
BRW_GENERAL_REGISTER_FILE) {
+      if (brw_inst_send_src0_reg_file(devinfo, inst) == 
BRW_GENERAL_REGISTER_FILE &&
+          brw_inst_send_src1_reg_file(devinfo, inst) == 
BRW_GENERAL_REGISTER_FILE) {
          /* Assume minimums if we don't know */
          unsigned mlen = 1;
          if (!brw_inst_send_sel_reg32_desc(devinfo, inst)) {

Reply via email to