r600/sfn: remove find_msb lowering in driver
Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9874>
This commit is contained in:
parent
6bcc2defa9
commit
2362986e79
|
@ -148,7 +148,6 @@ bool EmitAluInstruction::do_emit(nir_instr* ir)
|
||||||
case nir_op_i32csel_gt: return emit_alu_op3(instr, op3_cndgt_int, {0, 1, 2});
|
case nir_op_i32csel_gt: return emit_alu_op3(instr, op3_cndgt_int, {0, 1, 2});
|
||||||
case nir_op_ieq32: return emit_alu_op2_int(instr, op2_sete_int);
|
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_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_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_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_ige: return emit_alu_op2_int(instr, op2_setge_int);
|
||||||
|
@ -174,7 +173,6 @@ bool EmitAluInstruction::do_emit(nir_instr* ir)
|
||||||
case nir_op_sge: return emit_alu_op2(instr, op2_setge);
|
case nir_op_sge: return emit_alu_op2(instr, op2_setge);
|
||||||
case nir_op_u2f32: return emit_alu_trans_op1(instr, op1_uint_to_flt);
|
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_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_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_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_uge: return emit_alu_op2_int(instr, op2_setge_uint);
|
||||||
|
@ -472,46 +470,6 @@ bool EmitAluInstruction::emit_alu_f2b32(const nir_alu_instr& instr)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmitAluInstruction::emit_find_msb(const nir_alu_instr& instr, bool sgn)
|
|
||||||
{
|
|
||||||
int sel_tmp = allocate_temp_register();
|
|
||||||
int sel_tmp2 = allocate_temp_register();
|
|
||||||
GPRVector tmp(sel_tmp, {0,1,2,3});
|
|
||||||
GPRVector tmp2(sel_tmp2, {0,1,2,3});
|
|
||||||
AluInstruction *ir = nullptr;
|
|
||||||
EAluOp opcode = sgn ? op1_ffbh_int : op1_ffbh_uint;
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
|
||||||
if (!(instr.dest.write_mask & (1 << i)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
ir = new AluInstruction(opcode, tmp.reg_i(i), m_src[0][i], write);
|
|
||||||
emit_instruction(ir);
|
|
||||||
}
|
|
||||||
make_last(ir);
|
|
||||||
|
|
||||||
for (int i = 0; i < 4 ; ++i) {
|
|
||||||
if (!(instr.dest.write_mask & (1 << i)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
ir = new AluInstruction(op2_sub_int, tmp2.reg_i(i),
|
|
||||||
PValue(new LiteralValue(31u, 0)), tmp.reg_i(i), write);
|
|
||||||
emit_instruction(ir);
|
|
||||||
}
|
|
||||||
make_last(ir);
|
|
||||||
|
|
||||||
for (int i = 0; i < 4 ; ++i) {
|
|
||||||
if (!(instr.dest.write_mask & (1 << i)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
ir = new AluInstruction(op3_cndge_int, from_nir(instr.dest, i), tmp.reg_i(i),
|
|
||||||
tmp2.reg_i(i), tmp.reg_i(i), write);
|
|
||||||
emit_instruction(ir);
|
|
||||||
}
|
|
||||||
make_last(ir);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EmitAluInstruction::emit_b2i32(const nir_alu_instr& instr)
|
bool EmitAluInstruction::emit_b2i32(const nir_alu_instr& instr)
|
||||||
{
|
{
|
||||||
AluInstruction *ir = nullptr;
|
AluInstruction *ir = nullptr;
|
||||||
|
|
|
@ -79,7 +79,6 @@ private:
|
||||||
bool emit_fdph(const nir_alu_instr &instr);
|
bool emit_fdph(const nir_alu_instr &instr);
|
||||||
bool emit_discard_if(const nir_intrinsic_instr *instr);
|
bool emit_discard_if(const nir_intrinsic_instr *instr);
|
||||||
|
|
||||||
bool emit_find_msb(const nir_alu_instr& instr, bool sgn);
|
|
||||||
bool emit_alu_f2b32(const nir_alu_instr& instr);
|
bool emit_alu_f2b32(const nir_alu_instr& instr);
|
||||||
bool emit_b2i32(const nir_alu_instr& instr);
|
bool emit_b2i32(const nir_alu_instr& instr);
|
||||||
bool emit_alu_f2i32_or_u32(const nir_alu_instr& instr, EAluOp op);
|
bool emit_alu_f2i32_or_u32(const nir_alu_instr& instr, EAluOp op);
|
||||||
|
|
Loading…
Reference in New Issue