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

Author: Francisco Jerez <[email protected]>
Date:   Wed Jan  4 12:53:35 2023 -0800

intel/eu/gfx12+: Implement decoding of 64-bit immediates.

C.f. a12533f2ce2e5a4aeae0f1fc8d759de73bdb6e2d.  The corresponding
change for the decoding path was never implemented so the disassembler
was printing incorrect immediate values.

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>

---

 src/intel/compiler/brw_inst.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h
index 02acd6aa70f..9e222f33582 100644
--- a/src/intel/compiler/brw_inst.h
+++ b/src/intel/compiler/brw_inst.h
@@ -1069,11 +1069,16 @@ brw_inst_imm_ud(const struct intel_device_info 
*devinfo, const brw_inst *insn)
 }
 
 static inline uint64_t
-brw_inst_imm_uq(ASSERTED const struct intel_device_info *devinfo,
+brw_inst_imm_uq(const struct intel_device_info *devinfo,
                 const brw_inst *insn)
 {
-   assert(devinfo->ver >= 8);
-   return brw_inst_bits(insn, 127, 64);
+   if (devinfo->ver >= 12) {
+      return brw_inst_bits(insn, 95, 64) << 32 |
+             brw_inst_bits(insn, 127, 96);
+   } else {
+      assert(devinfo->ver >= 8);
+      return brw_inst_bits(insn, 127, 64);
+   }
 }
 
 static inline float
@@ -1095,8 +1100,7 @@ brw_inst_imm_df(const struct intel_device_info *devinfo, 
const brw_inst *insn)
       double d;
       uint64_t u;
    } dt;
-   (void) devinfo;
-   dt.u = brw_inst_bits(insn, 127, 64);
+   dt.u = brw_inst_imm_uq(devinfo, insn);
    return dt.d;
 }
 

Reply via email to