mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
pan/bi: Properly handle SWZ.v4i8 lowering on v11+
We were not supporting non replicate swizzle and this trigger an
assertion on fossils/parallel-rdp/small_subgroup.foz.
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 1481b14fcb ("pan/bi: Lower SWZ.v4i8 to multiple MKVEC.v2i8 on v11+")
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36349>
This commit is contained in:
parent
294014e196
commit
525f2972a6
1 changed files with 55 additions and 4 deletions
|
|
@ -22,9 +22,54 @@
|
|||
*/
|
||||
|
||||
#include "bi_builder.h"
|
||||
#include "compiler.h"
|
||||
#include "va_compiler.h"
|
||||
#include "valhall.h"
|
||||
|
||||
static void
|
||||
va_compose_mkvec_swz_v4i8(bi_index *b, enum bi_swizzle swz)
|
||||
{
|
||||
#define B(b0, b1, b2, b3) \
|
||||
case BI_SWIZZLE_B##b0##b1##b2##b3: \
|
||||
b[0].swizzle = BI_SWIZZLE_B##b0; \
|
||||
b[1].swizzle = BI_SWIZZLE_B##b1; \
|
||||
b[2].swizzle = BI_SWIZZLE_B##b2; \
|
||||
b[3].swizzle = BI_SWIZZLE_B##b3; \
|
||||
break;
|
||||
|
||||
switch (swz) {
|
||||
B(0, 1, 0, 1);
|
||||
B(0, 1, 2, 3);
|
||||
B(2, 3, 0, 1);
|
||||
B(2, 3, 2, 3);
|
||||
B(0, 0, 0, 0);
|
||||
B(1, 1, 1, 1);
|
||||
B(2, 2, 2, 2);
|
||||
B(3, 3, 3, 3);
|
||||
B(0, 0, 1, 1);
|
||||
B(2, 2, 3, 3);
|
||||
B(1, 0, 3, 2);
|
||||
B(3, 2, 1, 0);
|
||||
B(0, 0, 2, 2);
|
||||
B(1, 1, 0, 0);
|
||||
B(2, 2, 0, 0);
|
||||
B(3, 3, 0, 0);
|
||||
B(2, 2, 1, 1);
|
||||
B(3, 3, 1, 1);
|
||||
B(1, 1, 2, 2);
|
||||
B(3, 3, 2, 2);
|
||||
B(0, 0, 3, 3);
|
||||
B(1, 1, 3, 3);
|
||||
B(1, 1, 2, 3);
|
||||
|
||||
default:
|
||||
unreachable("Invalid swizzle");
|
||||
break;
|
||||
}
|
||||
|
||||
#undef B
|
||||
}
|
||||
|
||||
static bi_instr *
|
||||
lower(bi_builder *b, bi_instr *I)
|
||||
{
|
||||
|
|
@ -37,10 +82,16 @@ lower(bi_builder *b, bi_instr *I)
|
|||
case BI_OPCODE_SWZ_V4I8: {
|
||||
/* IADD.v4u8 is gone on v11 */
|
||||
if (b->shader->arch >= 11) {
|
||||
assert(I->src[0].swizzle >= BI_SWIZZLE_B0000 &&
|
||||
I->src[0].swizzle <= BI_SWIZZLE_B3333);
|
||||
bi_index tmp = bi_mkvec_v2i8(b, I->src[0], I->src[0], bi_zero());
|
||||
return bi_mkvec_v2i8_to(b, I->dest[0], I->src[0], I->src[0], tmp);
|
||||
bi_index bytes[4] = {
|
||||
I->src[0],
|
||||
I->src[0],
|
||||
I->src[0],
|
||||
I->src[0],
|
||||
};
|
||||
|
||||
va_compose_mkvec_swz_v4i8(bytes, I->src[0].swizzle);
|
||||
bi_index high = bi_mkvec_v2i8(b, bytes[2], bytes[3], bi_zero());
|
||||
return bi_mkvec_v2i8_to(b, I->dest[0], bytes[0], bytes[1], high);
|
||||
}
|
||||
|
||||
return bi_iadd_v4u8_to(b, I->dest[0], I->src[0], bi_zero(), false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue