From: Ian Romanick Date: Tue, 9 Feb 2021 02:49:06 +0000 (-0800) Subject: intel/fs: Slightly restructure emitting nir_op_imul_32x16 and nir_op_umul_32x16 X-Git-Tag: upstream/23.3.3~17220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=293ad13e3f32ef1090858dd9e5c7b93efdc66b3e;p=platform%2Fupstream%2Fmesa.git intel/fs: Slightly restructure emitting nir_op_imul_32x16 and nir_op_umul_32x16 There are no immediate values at this point, so all of this code was bunk. :face_palm: Reviewed-by: Marcin Ĺšlusarz Part-of: --- diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 7e62df4..c85983f 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -1316,6 +1316,10 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr, case nir_op_imul_32x16: case nir_op_umul_32x16: { const bool ud = instr->op == nir_op_umul_32x16; + const enum brw_reg_type word_type = + ud ? BRW_REGISTER_TYPE_UW : BRW_REGISTER_TYPE_W; + const enum brw_reg_type dword_type = + ud ? BRW_REGISTER_TYPE_UD : BRW_REGISTER_TYPE_D; assert(nir_dest_bit_size(instr->dest.dest) == 32); @@ -1325,18 +1329,10 @@ fs_visitor::nir_emit_alu(const fs_builder &bld, nir_alu_instr *instr, */ assert(devinfo->ver >= 7); - if (op[1].file == IMM) - op[1] = ud ? brw_imm_uw(op[1].ud) : brw_imm_w(op[1].d); - else { - const enum brw_reg_type word_type = - ud ? BRW_REGISTER_TYPE_UW : BRW_REGISTER_TYPE_W; - - op[1] = subscript(op[1], word_type, 0); - } - - const enum brw_reg_type dword_type = - ud ? BRW_REGISTER_TYPE_UD : BRW_REGISTER_TYPE_D; + /* Before copy propagation there are no immediate values. */ + assert(op[0].file != IMM && op[1].file != IMM); + op[1] = subscript(op[1], word_type, 0); bld.MUL(result, retype(op[0], dword_type), op[1]); break; }