diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 7ab8fd9960a..7da88372d2b 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -3341,6 +3341,14 @@ lower_bit_size_callback(const nir_instr *instr, UNUSED void *_) * implemented natively. */ nir_alu_instr *alu = nir_instr_as_alu(instr); + + switch (alu->op) { + case nir_op_bitfield_reverse: + return alu->def.bit_size < 32 ? 32 : 0; + default: + break; + } + if (alu->def.bit_size == 8 && !is_conversion_to_8bit(alu->op)) return 16; else if (alu->def.bit_size == 1 && alu->src[0].src.ssa->bit_size == 8) diff --git a/src/asahi/compiler/agx_compile.h b/src/asahi/compiler/agx_compile.h index 97503d3bac9..56d593c5e40 100644 --- a/src/asahi/compiler/agx_compile.h +++ b/src/asahi/compiler/agx_compile.h @@ -335,6 +335,8 @@ static const nir_shader_compiler_options agx_nir_options = { .lower_flrp32 = true, .lower_fpow = true, .lower_fmod = true, + .lower_bitfield_extract8 = true, + .lower_bitfield_extract16 = true, .lower_bitfield_insert = true, .lower_ifind_msb = true, .lower_find_lsb = true,