Mesa (main): pan/bi: Add XML for LD_BUFFER

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 18 23:34:31 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Sun Nov  7 19:51:19 2021 -0500

pan/bi: Add XML for LD_BUFFER

Encoded like LOAD.

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

---

 src/panfrost/bifrost/valhall/ISA.xml               | 136 +++++++++++++++++++++
 .../bifrost/valhall/test/assembler-cases.txt       |   7 ++
 src/panfrost/bifrost/valhall/valhall.py            |   2 +-
 3 files changed, 144 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/valhall/ISA.xml b/src/panfrost/bifrost/valhall/ISA.xml
index 09872ab0e9d..cf1e5b3c3d1 100644
--- a/src/panfrost/bifrost/valhall/ISA.xml
+++ b/src/panfrost/bifrost/valhall/ISA.xml
@@ -741,6 +741,142 @@
     <imm name="unk2" start="16" size="4"/>
   </ins>
 
+  <ins name="LD_BUFFER.i8" title="Global memory load" opcode="0x6a" opcode2="0" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_8_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Address to load from after adding offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i16" title="Global memory load" opcode="0x6a" opcode2="1" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_16_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i24" title="Global memory load" opcode="0x6a" opcode2="2" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_24_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i32" title="Global memory load" opcode="0x6a" opcode2="3" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_32_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i48" title="Global memory load" opcode="0x6a" opcode2="4" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_48_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i64" title="Global memory load" opcode="0x6a" opcode2="5" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_64_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i96" title="Global memory load" opcode="0x6a" opcode2="6" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_96_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
+  <ins name="LD_BUFFER.i128" title="Global memory load" opcode="0x6a" opcode2="7" unit="LS">
+    <desc>
+      Loads a buffer descriptor. If bits 25...31 of the mode descriptor are
+      all-ones, load from the buffer descriptors in the table indexed by the
+      bottom byte of the mode descriptor. If they are all zeroes, load the
+      contents of the buffer in the first table indexed by the bottom byte of
+      the mode descriptor.
+    </desc>
+    <sr write="true"/>
+    <sr_count/>
+    <mod name="load_lane_128_bit" start="36" size="3"/>
+    <mod name="unsigned" start="39" size="1"/>
+    <slot/>
+    <src>Byte offset</src>
+    <src>Mode descriptor</src>
+  </ins>
+
   <ins name="LD_ATTR" title="Load indirect attribute" opcode="0x76" unit="LS">
     <!-- TODO: for some reason, blob is using index (1<<24)|x for [x] -->
     <desc>The index must not diverge within a warp.</desc>
diff --git a/src/panfrost/bifrost/valhall/test/assembler-cases.txt b/src/panfrost/bifrost/valhall/test/assembler-cases.txt
index ea9f16bfe28..b3fd7005ed1 100644
--- a/src/panfrost/bifrost/valhall/test/assembler-cases.txt
+++ b/src/panfrost/bifrost/valhall/test/assembler-cases.txt
@@ -112,3 +112,10 @@ c0 01 00 00 00 c4 10 51    IADD_IMM.i32.reconverge r4, 0x0, #0x1
 44 00 46 36 28 40 71 78    ST_CVT.v4.u32.slot0.return @r0:r1:r2:r3, `r4, r0, `r6, unk:0x2
 7c c0 12 00 26 84 67 00    LEA_IMAGE_IMM.slot0 @r4:r5:r6, `r60, 0x0, unk:0x2, index:0x1, unk2:0x2
 7c c0 02 00 26 84 67 00    LEA_IMAGE_IMM.slot0 @r4:r5:r6, `r60, 0x0, unk:0x2, index:0x0, unk2:0x2
+82 81 00 28 f4 82 6a 00    LD_BUFFER.i64.unsigned.slot0 @r2:r3, u2, u1
+80 81 00 68 f4 80 6a 00    LD_BUFFER.i64.unsigned.slot1 @r0:r1, u0, u1
+84 81 00 a8 f4 a6 6a 00    LD_BUFFER.i64.unsigned.slot2 @r38:r39, u4, u1
+83 81 00 a8 f4 a4 6a 00    LD_BUFFER.i64.unsigned.slot2 @r36:r37, u3, u1
+83 84 00 28 f4 82 6a 00    LD_BUFFER.i64.unsigned.slot0 @r2:r3, u3, u4
+41 82 00 30 e6 82 6a 00    LD_BUFFER.i96.unsigned.slot0 @r2:r3:r4, `r1, u2
+40 83 00 30 e6 86 6a 08    LD_BUFFER.i96.unsigned.slot0.wait0 @r6:r7:r8, `r0, u3
diff --git a/src/panfrost/bifrost/valhall/valhall.py b/src/panfrost/bifrost/valhall/valhall.py
index 513e71d73dc..7ce5417c494 100644
--- a/src/panfrost/bifrost/valhall/valhall.py
+++ b/src/panfrost/bifrost/valhall/valhall.py
@@ -188,7 +188,7 @@ class Instruction:
         if opcode == 0x90:
             # XXX: XMLify this, but disambiguates sign of conversions
             self.secondary_mask |= 0x10
-        if name.startswith("LOAD.i") or name.startswith("STORE.i"):
+        if name.startswith("LOAD.i") or name.startswith("STORE.i") or name.startswith("LD_BUFFER.i"):
             self.secondary_shift = 27 # Alias with memory_size
             self.secondary_mask = 0x7
 



More information about the mesa-commit mailing list