ir3: Fix decoding of stib.b/ldib.b with offset

The OFFSET_LO in #instruction-cat6-a6xx-ibo-load-store aliased with
opcode of other instructions, resolve this by being less lax in some
instruction definitions.

A proper way to solve this would probably be to reconstruct instructions
hierarchy, but it's a much more complex task.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30018>
This commit is contained in:
Danylo Piliaiev
2024-07-03 15:24:18 +02:00
committed by Marge Bot
parent 2c7e07655c
commit 2fbdc4d462
2 changed files with 15 additions and 6 deletions

View File

@@ -484,7 +484,18 @@ static const struct test {
static void
add_generated_tests(struct u_vector *all_tests, void *ctx) {
/* stib.b/ldib.b OFFSET_LO aliases what other instructions use for opcode */
for (int offset = 1; offset < 0x1f; offset++) {
char *stib = ralloc_asprintf(
ctx, "stib.b.untyped.1d.u32.4.imm.base0 r2.y, r5.z+%u, 4", offset);
*(struct test *)u_vector_add(all_tests) = (struct test)INSTR_6XX_RAW(
0xc026080916e77100ull + ((uint64_t)offset << 54), stib);
char *ldib = ralloc_asprintf(
ctx, "ldib.b.untyped.1d.u32.4.imm.base0 r0.z, r0.y+%u, 0", offset);
*(struct test *)u_vector_add(all_tests) = (struct test)INSTR_6XX_RAW(
0xc026000201e1b100ull + ((uint64_t)offset << 54), ldib);
}
}
static void

View File

@@ -220,7 +220,7 @@ SOFTWARE.
<field low="41" high="48" name="SRC1" type="#cat6-src-const-or-gpr">
<param name="SRC1_CONST" as="SRC_CONST"/>
</field>
<pattern pos="53" >x</pattern>
<pattern pos="53" >0</pattern>
<pattern low="54" high="58">00011</pattern> <!-- OPC -->
<derived name="SRC1_CONST" expr="#false" type="bool"/>
@@ -380,7 +380,7 @@ SOFTWARE.
</display>
<pattern pos="0" >0</pattern>
<field low="1" high="13" name="OFF" type="uint"/>
<pattern low="14" high="21">xxxxxxxx</pattern> <!-- SRC -->
<pattern low="14" high="21">00000000</pattern> <!-- SRC -->
<pattern low="22" high="23">11</pattern>
<field low="24" high="31" name="SIZE" type="uint"/>
<field low="32" high="39" name="DST" type="#reg-gpr"/>
@@ -482,7 +482,7 @@ SOFTWARE.
<pattern pos="0" >x</pattern>
<field low="1" high="8" name="SRC" type="#reg-gpr"/>
<pattern low="9" high="13">xxxxx</pattern> <!-- DST_HI -->
<pattern low="14" high="22">xxxxxxxxx</pattern>
<pattern low="14" high="22">000000000</pattern>
<pattern pos="23" >1</pattern>
<field low="24" high="26" name="SIZE" type="uint"/>
<pattern low="27" high="31">xxxxx</pattern>
@@ -544,9 +544,7 @@ SOFTWARE.
<field low="9" high="10" name="D_MINUS_ONE" type="uint"/>
<pattern pos="11" >x</pattern> <!-- TYPED -->
<pattern low="12" high="13">xx</pattern> <!-- TYPE_SIZE -->
<pattern low="14" high="21">xxxxxxxx</pattern> <!-- SRC1 -->
<pattern pos="22" >x</pattern> <!-- SRC1_IM -->
<pattern pos="23" >x</pattern> <!-- SRC2_IM -->
<pattern low="14" high="23">0000000000</pattern>
<pattern low="24" high="31">xxxxxxxx</pattern> <!-- SRC2 -->
<field low="32" high="39" name="DST" type="#reg-gpr"/>
<pattern pos="40" >0</pattern>