r600/sfn: lower find_msb variants to find_msb_rev

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9452>
This commit is contained in:
Gert Wollny
2021-03-10 10:34:48 +01:00
parent befda5ba1b
commit ca270207bb
2 changed files with 3 additions and 0 deletions

View File

@@ -1330,6 +1330,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
.lower_bitfield_extract = true,
.lower_bitfield_insert_to_bitfield_select = true,
.has_fused_comp_and_csel = true,
.lower_find_msb_to_reverse = true,
};
rscreen->nir_options = nir_options;

View File

@@ -149,6 +149,7 @@ bool EmitAluInstruction::do_emit(nir_instr* ir)
case nir_op_ieq32: return emit_alu_op2_int(instr, op2_sete_int);
case nir_op_ieq: return emit_alu_op2_int(instr, op2_sete_int);
case nir_op_ifind_msb: return emit_find_msb(instr, true);
case nir_op_ifind_msb_rev: return emit_alu_op1(instr, op1_ffbh_int);
case nir_op_ige32: return emit_alu_op2_int(instr, op2_setge_int);
case nir_op_ige: return emit_alu_op2_int(instr, op2_setge_int);
case nir_op_ilt32: return emit_alu_op2_int(instr, op2_setgt_int, op2_opt_reverse);
@@ -174,6 +175,7 @@ bool EmitAluInstruction::do_emit(nir_instr* ir)
case nir_op_u2f32: return emit_alu_trans_op1(instr, op1_uint_to_flt);
case nir_op_ubfe: return emit_alu_op3(instr, op3_bfe_uint);
case nir_op_ufind_msb: return emit_find_msb(instr, false);
case nir_op_ufind_msb_rev: return emit_alu_op1(instr, op1_ffbh_uint);
case nir_op_uge32: return emit_alu_op2_int(instr, op2_setge_uint);
case nir_op_uge: return emit_alu_op2_int(instr, op2_setge_uint);
case nir_op_ult32: return emit_alu_op2_int(instr, op2_setgt_uint, op2_opt_reverse);