Skip to content

Commit

Permalink
pan/bi: Forbid unaligned staging registers on Valhall
Browse files Browse the repository at this point in the history
Would've saved me some debugging with the computerator. I keep
forgetting about this nuance. Enforce it in the assembler.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13802>
  • Loading branch information
Alyssa Rosenzweig authored and Marge Bot committed Nov 18, 2021
1 parent df807cb commit b8ba909
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/panfrost/bifrost/valhall/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def parse_asm(line):
base = regs[0]
die_if(any([reg != (base + i) for i, reg in enumerate(regs)]),
'Expected consecutive staging registers, got {op}')
die_if(sr_count > 1 and (base % 2) != 0,
'Consecutive staging registers must be aligned to a register pair')

if sr.count == 0:
modifier_map["staging_register_count"] = sr_count
Expand Down
6 changes: 6 additions & 0 deletions src/panfrost/bifrost/valhall/test/negative-cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ IADD.u32.ts r0, tls_ptr, wls_ptr
IADD.u32.ts r0, tls_ptr, tls_ptr_hi
IADD.u32.id r0, tls_ptr, tls_ptr_hi
IADD.u32.id r0, tls_ptr, 0x40490FDB

# If an instruction accesses multiple staging registers, they must be aligned
# to a register pair.
LOAD.i32.unsigned.slot0.wait0 @r1:r2, `r0, offset:0
STORE.i32.slot0.reconverge @r3:r4:r5, `r2, offset:0
STORE.i96.vary.slot0.return @r1:r2:r3:r4, `r4, offset:0

0 comments on commit b8ba909

Please sign in to comment.