diff options
author | Connor Abbott <cwabbott0@gmail.com> | 2023-03-09 22:05:28 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-26 12:55:13 +0000 |
commit | 100096394f3db44bd41863e30dfec8e74962832b (patch) | |
tree | 3030ca74c068df87d3883544ec92ec07dad6b5a8 | |
parent | ec036fe51e18754cc3fbb8903a5be9b001259c36 (diff) |
ir3: Don't use swz with shared registers
It seems the two moves it decomposes into aren't always atomically
executed on the scalar ALU, which means that it randomly doesn't work.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
-rw-r--r-- | src/freedreno/ir3/ir3_lower_parallelcopy.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/freedreno/ir3/ir3_lower_parallelcopy.c b/src/freedreno/ir3/ir3_lower_parallelcopy.c index 728fccb9fb8..d380174b128 100644 --- a/src/freedreno/ir3/ir3_lower_parallelcopy.c +++ b/src/freedreno/ir3/ir3_lower_parallelcopy.c @@ -154,11 +154,7 @@ do_swap(struct ir3_compiler *compiler, struct ir3_instruction *instr, /* a5xx+ is known to support swz, which enables us to swap two registers * in-place. If unsupported we emulate it using the xor trick. */ - if (compiler->gen < 5) { - /* Shared regs only exist since a5xx, so we don't have to provide a - * fallback path for them. - */ - assert(!(entry->flags & IR3_REG_SHARED)); + if (compiler->gen < 5 || (entry->flags & IR3_REG_SHARED)) { do_xor(instr, dst_num, dst_num, src_num, entry->flags); do_xor(instr, src_num, src_num, dst_num, entry->flags); do_xor(instr, dst_num, dst_num, src_num, entry->flags); |