diff --git a/src/panfrost/compiler/bifrost/compiler.h b/src/panfrost/compiler/bifrost/compiler.h index d914c6712cf..e6c971cf916 100644 --- a/src/panfrost/compiler/bifrost/compiler.h +++ b/src/panfrost/compiler/bifrost/compiler.h @@ -98,7 +98,7 @@ enum bi_swizzle { BI_SWIZZLE_B33 = BI_SWIZZLE_B3333, }; -static inline bool +static inline void bi_swizzle_to_byte_channels(enum bi_swizzle swizzle, unsigned *channels) { #define B(b0, b1, b2, b3) \ @@ -107,7 +107,7 @@ bi_swizzle_to_byte_channels(enum bi_swizzle swizzle, unsigned *channels) channels[1] = b1; \ channels[2] = b2; \ channels[3] = b3; \ - return true; \ + return; \ } switch (swizzle) { B(0, 1, 0, 1); @@ -133,10 +133,10 @@ bi_swizzle_to_byte_channels(enum bi_swizzle swizzle, unsigned *channels) B(0, 0, 3, 3); B(1, 1, 3, 3); B(1, 1, 2, 3); - default: - return false; } #undef B + + UNREACHABLE("Invalid bi_swizzle"); } static inline enum bi_swizzle @@ -365,8 +365,7 @@ static inline bi_index bi_byte(bi_index idx, unsigned lane) { unsigned bytes[4]; - bool valid = bi_swizzle_to_byte_channels(idx.swizzle, bytes); - assert(valid); + bi_swizzle_to_byte_channels(idx.swizzle, bytes); assert(lane < 4); idx.swizzle = (enum bi_swizzle)(BI_SWIZZLE_B0 + bytes[lane]); diff --git a/src/panfrost/compiler/bifrost/valhall/va_lower_isel.c b/src/panfrost/compiler/bifrost/valhall/va_lower_isel.c index 901951e7c14..bf8f5a79cbf 100644 --- a/src/panfrost/compiler/bifrost/valhall/va_lower_isel.c +++ b/src/panfrost/compiler/bifrost/valhall/va_lower_isel.c @@ -16,9 +16,7 @@ lower_swz_v4i8(bi_builder *b, bi_instr *I) if (b->shader->arch >= 11) { bi_index srcs[4] = {I->src[0], I->src[0], I->src[0], I->src[0]}; unsigned channels[4]; - ASSERTED bool valid_swizzle = - bi_swizzle_to_byte_channels(I->src[0].swizzle, channels); - assert(valid_swizzle); + bi_swizzle_to_byte_channels(I->src[0].swizzle, channels); return bi_make_vec_to(b, I->dest[0], srcs, channels, 4, 8); } diff --git a/src/panfrost/compiler/bifrost/valhall/va_optimize.c b/src/panfrost/compiler/bifrost/valhall/va_optimize.c index 81976380f4c..a0609601d4e 100644 --- a/src/panfrost/compiler/bifrost/valhall/va_optimize.c +++ b/src/panfrost/compiler/bifrost/valhall/va_optimize.c @@ -304,8 +304,8 @@ va_propagate_replicate_wide(bi_context *ctx, bi_instr **lut, bi_instr *I) /* If we have a MKVEC.v2i8 and current instruction only replicate, we * should propagate */ if (src_ins->op == BI_OPCODE_MKVEC_V2I8 && - bi_swizzle_replicates_8(src->swizzle) && - bi_swizzle_to_byte_channels(src->swizzle, tmp)) { + bi_swizzle_replicates_8(src->swizzle)) { + bi_swizzle_to_byte_channels(src->swizzle, tmp); unsigned byte_idx = *tmp; /* In case of the top 16-bit, src2 contains the value we want without