From e346ca5b417153ac99aca30d05efdb27605ade8b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 7 Nov 2021 19:51:19 -0500 Subject: [PATCH] pan/bi: Add XML for LD_BUFFER Encoded like LOAD. Signed-off-by: Alyssa Rosenzweig Part-of: --- 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 @@ + + + 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. + + + + + + + Address to load from after adding offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + + + + 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. + + + + + + + Byte offset + Mode descriptor + + The index must not diverge within a warp. 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