etnaviv: implement nir_op_uclz and lower find_{msb,lsb} to uclz
authorItalo Nicola <italonicola@collabora.com>
Thu, 15 Sep 2022 19:13:43 +0000 (19:13 +0000)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 16:51:36 +0000 (16:51 +0000)
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>

src/gallium/drivers/etnaviv/etnaviv_compiler.c
src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c

index 0eb4568..66f49e8 100644 (file)
@@ -73,6 +73,9 @@ etna_compiler_create(const char *renderer, const struct etna_specs *specs)
       .lower_pack_64_2x32_split = true,
       .lower_unpack_32_2x16_split = true,
       .lower_unpack_64_2x32_split = true,
+      .lower_find_lsb = true,
+      .lower_ifind_msb_to_uclz = true,
+      .lower_ufind_msb_to_uclz = true,
    };
 
    compiler->regs = etna_ra_setup(compiler);
index 347bb48..d232861 100644 (file)
@@ -128,6 +128,7 @@ static const struct etna_op_info etna_ops[] = {
    IOP(ishl, LSHIFT, 0_X_1),
    IOP(ishr, RSHIFT, 0_X_1),
    UOP(ushr, RSHIFT, 0_X_1),
+   UOP(uclz, LEADZERO, 0_X_X),
 };
 
 void