<div dir="auto"><div>I understand, but you can get KILL by checking if src0 is an immediate. You don't even have to check the value, because you are guaranteed it's the right one. That makes KILL a strict subset of KILL_IF.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Oct 5, 2017 1:08 AM, "Roland Scheidegger" <<a href="mailto:sroland@vmware.com">sroland@vmware.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I didn't like this when it was proposed a couple weeks ago, and<br>
unsurprisingly I still don't like it now.<br>
The reason is that KILL is a simple opcode which even maps to what both<br>
glsl and d3d10 actually need, whereas KILL_IF is a complicated mess<br>
including combined per-channel comparisons.<br>
I realize you can of course optimize away all the comparisons if you're<br>
using immediates, but it still doesn't look very clean to me.<br>
<font color="#888888"><br>
Roland<br>
</font><div class="elided-text"><br>
<br>
Am 04.10.2017 um 23:15 schrieb Marek Olšák:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br>
><br>
> It can be recognized from KILL_IF by checking if the src operand is IMM.<br>
> ---<br>
> src/gallium/auxiliary/gallivm/<wbr>lp_bld_tgsi_action.c | 11 ------<br>
> src/gallium/auxiliary/gallivm/<wbr>lp_bld_tgsi_aos.c | 3 --<br>
> src/gallium/auxiliary/gallivm/<wbr>lp_bld_tgsi_soa.c | 42 ----------------------<br>
> src/gallium/auxiliary/nir/<wbr>tgsi_to_nir.c | 14 --------<br>
> src/gallium/auxiliary/tgsi/<wbr>tgsi_exec.c | 18 ----------<br>
> src/gallium/auxiliary/tgsi/<wbr>tgsi_info_opcodes.h | 2 +-<br>
> src/gallium/auxiliary/tgsi/<wbr>tgsi_opcode_tmp.h | 1 -<br>
> src/gallium/auxiliary/tgsi/<wbr>tgsi_scan.c | 3 +-<br>
> src/gallium/auxiliary/vl/vl_<wbr>mc.c | 2 +-<br>
> src/gallium/docs/source/tgsi.<wbr>rst | 5 ---<br>
> src/gallium/drivers/i915/i915_<wbr>fpc_optimize.c | 1 -<br>
> src/gallium/drivers/i915/i915_<wbr>fpc_translate.c | 13 -------<br>
> .../drivers/nouveau/codegen/<wbr>nv50_ir_from_tgsi.cpp | 3 --<br>
> src/gallium/drivers/nouveau/<wbr>nv30/nvfx_fragprog.c | 3 --<br>
> src/gallium/drivers/r300/r300_<wbr>tgsi_to_rc.c | 1 -<br>
> src/gallium/drivers/r600/r600_<wbr>shader.c | 13 +++----<br>
> src/gallium/drivers/radeonsi/<wbr>si_shader_tgsi_alu.c | 32 ++++++-----------<br>
> src/gallium/drivers/svga/svga_<wbr>tgsi_insn.c | 29 +--------------<br>
> src/gallium/drivers/svga/svga_<wbr>tgsi_vgpu10.c | 21 -----------<br>
> src/gallium/include/pipe/p_<wbr>shader_tokens.h | 2 +-<br>
> src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp | 3 +-<br>
> 21 files changed, 22 insertions(+), 200 deletions(-)<br>
><br>
> diff --git a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_action.c b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_action.c<br>
> index ce2b927..edcfc6e 100644<br>
> --- a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_action.c<br>
> +++ b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_action.c<br>
> @@ -355,30 +355,20 @@ kil_fetch_args(<br>
> /* src0.z */<br>
> emit_data->args[2] = lp_build_emit_fetch(bld_base, emit_data->inst,<br>
> 0, TGSI_CHAN_Z);<br>
> /* src0.w */<br>
> emit_data->args[3] = lp_build_emit_fetch(bld_base, emit_data->inst,<br>
> 0, TGSI_CHAN_W);<br>
> emit_data->arg_count = 4;<br>
> emit_data->dst_type = LLVMVoidTypeInContext(bld_<wbr>base->base.gallivm->context);<br>
> }<br>
><br>
> -/* TGSI_OPCODE_KILL */<br>
> -<br>
> -static void<br>
> -kilp_fetch_args(<br>
> - struct lp_build_tgsi_context * bld_base,<br>
> - struct lp_build_emit_data * emit_data)<br>
> -{<br>
> - emit_data->dst_type = LLVMVoidTypeInContext(bld_<wbr>base->base.gallivm->context);<br>
> -}<br>
> -<br>
> /* TGSI_OPCODE_LIT */<br>
><br>
> static void<br>
> lit_fetch_args(<br>
> struct lp_build_tgsi_context * bld_base,<br>
> struct lp_build_emit_data * emit_data)<br>
> {<br>
> /* src0.x */<br>
> emit_data->args[0] = lp_build_emit_fetch(bld_base, emit_data->inst, 0, TGSI_CHAN_X);<br>
> /* src0.y */<br>
> @@ -1172,21 +1162,20 @@ lp_set_default_actions(struct lp_build_tgsi_context * bld_base)<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_POW] = pow_action;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_UP2H] = up2h_action;<br>
><br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_SWITCH].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_CASE].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_COS].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_EX2].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_IF].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_UIF].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_KILL_IF].fetch_args = kil_fetch_args;<br>
> - bld_base->op_actions[TGSI_<wbr>OPCODE_KILL].fetch_args = kilp_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_RCP].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_SIN].fetch_args = scalar_unary_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LG2].fetch_args = scalar_unary_fetch_args;<br>
><br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_ADD].emit = add_emit;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_ARR].emit = arr_emit;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_END].emit = end_emit;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_FRC].emit = frc_emit;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LRP].emit = lrp_emit;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_MAD].emit = mad_emit;<br>
> diff --git a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_aos.c b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_aos.c<br>
> index 2529c6a..675b9a5 100644<br>
> --- a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_aos.c<br>
> +++ b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_aos.c<br>
> @@ -595,23 +595,20 @@ lp_emit_instruction_aos(<br>
> tmp0 = swizzle_scalar_aos(bld, src0, TGSI_SWIZZLE_X);<br>
> dst0 = lp_build_cos(&bld->bld_base.<wbr>base, tmp0);<br>
> break;<br>
><br>
> case TGSI_OPCODE_DDX:<br>
> return FALSE;<br>
><br>
> case TGSI_OPCODE_DDY:<br>
> return FALSE;<br>
><br>
> - case TGSI_OPCODE_KILL:<br>
> - return FALSE;<br>
> -<br>
> case TGSI_OPCODE_KILL_IF:<br>
> return FALSE;<br>
><br>
> case TGSI_OPCODE_PK2H:<br>
> return FALSE;<br>
> break;<br>
><br>
> case TGSI_OPCODE_PK2US:<br>
> return FALSE;<br>
> break;<br>
> diff --git a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_soa.c<br>
> index de18f62..7528b7c 100644<br>
> --- a/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_soa.c<br>
> +++ b/src/gallium/auxiliary/<wbr>gallivm/lp_bld_tgsi_soa.c<br>
> @@ -2705,50 +2705,20 @@ emit_kill_if(<br>
> mask = LLVMBuildOr(builder, mask, invmask, "");<br>
> }<br>
><br>
> lp_build_mask_update(bld-><wbr>mask, mask);<br>
> if (!near_end_of_shader(bld, pc))<br>
> lp_build_mask_check(bld->mask)<wbr>;<br>
> }<br>
><br>
><br>
> /**<br>
> - * Unconditional fragment kill.<br>
> - * The only predication is the execution mask which will apply if<br>
> - * we're inside a loop or conditional.<br>
> - */<br>
> -static void<br>
> -emit_kill(struct lp_build_tgsi_soa_context *bld,<br>
> - int pc)<br>
> -{<br>
> - LLVMBuilderRef builder = bld->bld_base.base.gallivm-><wbr>builder;<br>
> - LLVMValueRef mask;<br>
> -<br>
> - /* For those channels which are "alive", disable fragment shader<br>
> - * execution.<br>
> - */<br>
> - if (bld->exec_mask.has_mask) {<br>
> - mask = LLVMBuildNot(builder, bld->exec_mask.exec_mask, "kilp");<br>
> - }<br>
> - else {<br>
> - LLVMValueRef zero = LLVMConstNull(bld->bld_base.<wbr>base.int_vec_type);<br>
> - mask = zero;<br>
> - }<br>
> -<br>
> - lp_build_mask_update(bld-><wbr>mask, mask);<br>
> -<br>
> - if (!near_end_of_shader(bld, pc))<br>
> - lp_build_mask_check(bld->mask)<wbr>;<br>
> -}<br>
> -<br>
> -<br>
> -/**<br>
> * Emit code which will dump the value of all the temporary registers<br>
> * to stdout.<br>
> */<br>
> static void<br>
> emit_dump_file(struct lp_build_tgsi_soa_context *bld,<br>
> unsigned file)<br>
> {<br>
> const struct tgsi_shader_info *info = bld-><a href="http://bld_base.info" rel="noreferrer" target="_blank">bld_base.info</a>;<br>
> struct gallivm_state *gallivm = bld->bld_base.base.gallivm;<br>
> LLVMBuilderRef builder = gallivm->builder;<br>
> @@ -3008,31 +2978,20 @@ ddy_emit(<br>
> struct lp_build_tgsi_context * bld_base,<br>
> struct lp_build_emit_data * emit_data)<br>
> {<br>
> struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);<br>
><br>
> emit_fetch_deriv(bld, emit_data->args[0], NULL, NULL,<br>
> &emit_data->output[emit_data-><wbr>chan]);<br>
> }<br>
><br>
> static void<br>
> -kill_emit(<br>
> - const struct lp_build_tgsi_action * action,<br>
> - struct lp_build_tgsi_context * bld_base,<br>
> - struct lp_build_emit_data * emit_data)<br>
> -{<br>
> - struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);<br>
> -<br>
> - emit_kill(bld, bld_base->pc - 1);<br>
> -}<br>
> -<br>
> -static void<br>
> kill_if_emit(<br>
> const struct lp_build_tgsi_action * action,<br>
> struct lp_build_tgsi_context * bld_base,<br>
> struct lp_build_emit_data * emit_data)<br>
> {<br>
> struct lp_build_tgsi_soa_context * bld = lp_soa_context(bld_base);<br>
><br>
> emit_kill_if(bld, emit_data->inst, bld_base->pc - 1);<br>
> }<br>
><br>
> @@ -3877,21 +3836,20 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_DDY].emit = ddy_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_DEFAULT].emit = default_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_ELSE].emit = else_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_ENDIF].emit = endif_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_ENDLOOP].emit = endloop_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_ENDSUB].emit = endsub_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_ENDSWITCH].emit = endswitch_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_IF].emit = if_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_UIF].emit = uif_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_KILL_IF].emit = kill_if_emit;<br>
> - bld.bld_base.op_actions[TGSI_<wbr>OPCODE_KILL].emit = kill_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_RET].emit = ret_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_SWITCH].emit = switch_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TEX].emit = tex_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TXB].emit = txb_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TXD].emit = txd_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TXL].emit = txl_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TXP].emit = txp_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TXQ].emit = txq_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TXF].emit = txf_emit;<br>
> bld.bld_base.op_actions[TGSI_<wbr>OPCODE_TEX2].emit = tex2_emit;<br>
> diff --git a/src/gallium/auxiliary/nir/<wbr>tgsi_to_nir.c b/src/gallium/auxiliary/nir/<wbr>tgsi_to_nir.c<br>
> index a317552..04658e3 100644<br>
> --- a/src/gallium/auxiliary/nir/<wbr>tgsi_to_nir.c<br>
> +++ b/src/gallium/auxiliary/nir/<wbr>tgsi_to_nir.c<br>
> @@ -1010,29 +1010,20 @@ ttn_cmp(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)<br>
><br>
> static void<br>
> ttn_ucmp(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)<br>
> {<br>
> ttn_move_dest(b, dest, nir_bcsel(b,<br>
> nir_ine(b, src[0], nir_imm_int(b, 0)),<br>
> src[1], src[2]));<br>
> }<br>
><br>
> static void<br>
> -ttn_kill(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)<br>
> -{<br>
> - nir_intrinsic_instr *discard =<br>
> - nir_intrinsic_instr_create(b-><wbr>shader, nir_intrinsic_discard);<br>
> - nir_builder_instr_insert(b, &discard->instr);<br>
> - b->shader->info.fs.uses_<wbr>discard = true;<br>
> -}<br>
> -<br>
> -static void<br>
> ttn_kill_if(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)<br>
> {<br>
> nir_ssa_def *cmp = nir_bany_inequal4(b, nir_flt(b, src[0],<br>
> nir_imm_float(b, 0.0)),<br>
> nir_imm_int(b, 0));<br>
> nir_intrinsic_instr *discard =<br>
> nir_intrinsic_instr_create(b-><wbr>shader, nir_intrinsic_discard_if);<br>
> discard->src[0] = nir_src_for_ssa(cmp);<br>
> nir_builder_instr_insert(b, &discard->instr);<br>
> b->shader->info.fs.uses_<wbr>discard = true;<br>
> @@ -1492,21 +1483,20 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = {<br>
> [TGSI_OPCODE_SQRT] = nir_op_fsqrt,<br>
> [TGSI_OPCODE_FRC] = nir_op_ffract,<br>
> [TGSI_OPCODE_FLR] = nir_op_ffloor,<br>
> [TGSI_OPCODE_ROUND] = nir_op_fround_even,<br>
> [TGSI_OPCODE_EX2] = nir_op_fexp2,<br>
> [TGSI_OPCODE_LG2] = nir_op_flog2,<br>
> [TGSI_OPCODE_POW] = nir_op_fpow,<br>
> [TGSI_OPCODE_COS] = nir_op_fcos,<br>
> [TGSI_OPCODE_DDX] = nir_op_fddx,<br>
> [TGSI_OPCODE_DDY] = nir_op_fddy,<br>
> - [TGSI_OPCODE_KILL] = 0,<br>
> [TGSI_OPCODE_PK2H] = 0, /* XXX */<br>
> [TGSI_OPCODE_PK2US] = 0, /* XXX */<br>
> [TGSI_OPCODE_PK4B] = 0, /* XXX */<br>
> [TGSI_OPCODE_PK4UB] = 0, /* XXX */<br>
> [TGSI_OPCODE_SEQ] = nir_op_seq,<br>
> [TGSI_OPCODE_SGT] = 0,<br>
> [TGSI_OPCODE_SIN] = nir_op_fsin,<br>
> [TGSI_OPCODE_SNE] = nir_op_sne,<br>
> [TGSI_OPCODE_SLE] = 0,<br>
> [TGSI_OPCODE_TEX] = 0,<br>
> @@ -1717,24 +1707,20 @@ ttn_emit_instruction(struct ttn_compile *c)<br>
> break;<br>
><br>
> case TGSI_OPCODE_UMAD:<br>
> ttn_umad(b, op_trans[tgsi_op], dest, src);<br>
> break;<br>
><br>
> case TGSI_OPCODE_LRP:<br>
> ttn_move_dest(b, dest, nir_flrp(b, src[2], src[1], src[0]));<br>
> break;<br>
><br>
> - case TGSI_OPCODE_KILL:<br>
> - ttn_kill(b, op_trans[tgsi_op], dest, src);<br>
> - break;<br>
> -<br>
> case TGSI_OPCODE_ARR:<br>
> ttn_arr(b, op_trans[tgsi_op], dest, src);<br>
> break;<br>
><br>
> case TGSI_OPCODE_CMP:<br>
> ttn_cmp(b, op_trans[tgsi_op], dest, src);<br>
> break;<br>
><br>
> case TGSI_OPCODE_UCMP:<br>
> ttn_ucmp(b, op_trans[tgsi_op], dest, src);<br>
> diff --git a/src/gallium/auxiliary/tgsi/<wbr>tgsi_exec.c b/src/gallium/auxiliary/tgsi/<wbr>tgsi_exec.c<br>
> index afed96c..87c3146 100644<br>
> --- a/src/gallium/auxiliary/tgsi/<wbr>tgsi_exec.c<br>
> +++ b/src/gallium/auxiliary/tgsi/<wbr>tgsi_exec.c<br>
> @@ -2034,34 +2034,20 @@ exec_kill_if(struct tgsi_exec_machine *mach,<br>
> if (r[0].f[i] < 0.0f)<br>
> kilmask |= 1 << i;<br>
> }<br>
><br>
> /* restrict to fragments currently executing */<br>
> kilmask &= mach->ExecMask;<br>
><br>
> mach->Temps[TEMP_KILMASK_I].<wbr>xyzw[TEMP_KILMASK_C].u[0] |= kilmask;<br>
> }<br>
><br>
> -/**<br>
> - * Unconditional fragment kill/discard.<br>
> - */<br>
> -static void<br>
> -exec_kill(struct tgsi_exec_machine *mach,<br>
> - const struct tgsi_full_instruction *inst)<br>
> -{<br>
> - uint kilmask; /* bit 0 = pixel 0, bit 1 = pixel 1, etc */<br>
> -<br>
> - /* kill fragment for all fragments currently executing */<br>
> - kilmask = mach->ExecMask;<br>
> - mach->Temps[TEMP_KILMASK_I].<wbr>xyzw[TEMP_KILMASK_C].u[0] |= kilmask;<br>
> -}<br>
> -<br>
> static void<br>
> emit_vertex(struct tgsi_exec_machine *mach)<br>
> {<br>
> /* FIXME: check for exec mask correctly<br>
> unsigned i;<br>
> for (i = 0; i < TGSI_QUAD_SIZE; ++i) {<br>
> if ((mach->ExecMask & (1 << i)))<br>
> */<br>
> if (mach->ExecMask) {<br>
> if (mach->Primitives[mach->Temps[<wbr>TEMP_PRIMITIVE_I].xyzw[TEMP_<wbr>PRIMITIVE_C].u[0]] >= mach->MaxOutputVertices)<br>
> @@ -5138,24 +5124,20 @@ exec_instruction(<br>
> break;<br>
><br>
> case TGSI_OPCODE_DDX:<br>
> exec_vector_unary(mach, inst, micro_ddx, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT);<br>
> break;<br>
><br>
> case TGSI_OPCODE_DDY:<br>
> exec_vector_unary(mach, inst, micro_ddy, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT);<br>
> break;<br>
><br>
> - case TGSI_OPCODE_KILL:<br>
> - exec_kill (mach, inst);<br>
> - break;<br>
> -<br>
> case TGSI_OPCODE_KILL_IF:<br>
> exec_kill_if (mach, inst);<br>
> break;<br>
><br>
> case TGSI_OPCODE_PK2H:<br>
> exec_pk2h(mach, inst);<br>
> break;<br>
><br>
> case TGSI_OPCODE_PK2US:<br>
> assert (0);<br>
> diff --git a/src/gallium/auxiliary/tgsi/<wbr>tgsi_info_opcodes.h b/src/gallium/auxiliary/tgsi/<wbr>tgsi_info_opcodes.h<br>
> index 1b2803c..61dfbd5 100644<br>
> --- a/src/gallium/auxiliary/tgsi/<wbr>tgsi_info_opcodes.h<br>
> +++ b/src/gallium/auxiliary/tgsi/<wbr>tgsi_info_opcodes.h<br>
> @@ -30,21 +30,21 @@ OPCODE(1, 1, REPL, EX2)<br>
> OPCODE(1, 1, REPL, LG2)<br>
> OPCODE(1, 2, REPL, POW)<br>
> OPCODE_GAP(31) /* removed */<br>
> OPCODE(1, 1, COMP, U2I64)<br>
> OPCODE(1, 0, OTHR, CLOCK)<br>
> OPCODE(1, 1, COMP, I2I64)<br>
> OPCODE_GAP(35) /* removed */<br>
> OPCODE(1, 1, REPL, COS)<br>
> OPCODE(1, 1, COMP, DDX)<br>
> OPCODE(1, 1, COMP, DDY)<br>
> -OPCODE(0, 0, NONE, KILL)<br>
> +OPCODE_GAP(39) /* removed */<br>
> OPCODE(1, 1, REPL, PK2H)<br>
> OPCODE(1, 1, REPL, PK2US)<br>
> OPCODE(1, 1, REPL, PK4B)<br>
> OPCODE(1, 1, REPL, PK4UB)<br>
> OPCODE(1, 1, COMP, D2U64)<br>
> OPCODE(1, 2, COMP, SEQ)<br>
> OPCODE(1, 1, COMP, D2I64)<br>
> OPCODE(1, 2, COMP, SGT)<br>
> OPCODE(1, 1, REPL, SIN)<br>
> OPCODE(1, 2, COMP, SLE)<br>
> diff --git a/src/gallium/auxiliary/tgsi/<wbr>tgsi_opcode_tmp.h b/src/gallium/auxiliary/tgsi/<wbr>tgsi_opcode_tmp.h<br>
> index 9a13fa6..809ce77 100644<br>
> --- a/src/gallium/auxiliary/tgsi/<wbr>tgsi_opcode_tmp.h<br>
> +++ b/src/gallium/auxiliary/tgsi/<wbr>tgsi_opcode_tmp.h<br>
> @@ -61,21 +61,20 @@ OP12_TEX(TXF_LZ)<br>
> OP11(FLR)<br>
> OP11(ROUND)<br>
> OP11(EX2)<br>
> OP11(LG2)<br>
> OP12(POW)<br>
> OP11(COS)<br>
> OP11(DDX)<br>
> OP11(DDY)<br>
> OP11(DDX_FINE)<br>
> OP11(DDY_FINE)<br>
> -OP00(KILL)<br>
> OP11(PK2H)<br>
> OP11(PK2US)<br>
> OP11(PK4B)<br>
> OP11(PK4UB)<br>
> OP12(SEQ)<br>
> OP12(SGT)<br>
> OP11(SIN)<br>
> OP12(SLE)<br>
> OP12(SNE)<br>
> OP12_TEX(TEX)<br>
> diff --git a/src/gallium/auxiliary/tgsi/<wbr>tgsi_scan.c b/src/gallium/auxiliary/tgsi/<wbr>tgsi_scan.c<br>
> index 989c57e..dceb8e2 100644<br>
> --- a/src/gallium/auxiliary/tgsi/<wbr>tgsi_scan.c<br>
> +++ b/src/gallium/auxiliary/tgsi/<wbr>tgsi_scan.c<br>
> @@ -860,22 +860,21 @@ tgsi_scan_shader(const struct tgsi_token *tokens,<br>
> scan_immediate(info);<br>
> break;<br>
> case TGSI_TOKEN_TYPE_PROPERTY:<br>
> scan_property(info, &parse.FullToken.FullProperty)<wbr>;<br>
> break;<br>
> default:<br>
> assert(!"Unexpected TGSI token type");<br>
> }<br>
> }<br>
><br>
> - info->uses_kill = (info->opcode_count[TGSI_<wbr>OPCODE_KILL_IF] ||<br>
> - info->opcode_count[TGSI_<wbr>OPCODE_KILL]);<br>
> + info->uses_kill = info->opcode_count[TGSI_<wbr>OPCODE_KILL_IF] > 0;<br>
><br>
> /* The dimensions of the IN decleration in geometry shader have<br>
> * to be deduced from the type of the input primitive.<br>
> */<br>
> if (procType == PIPE_SHADER_GEOMETRY) {<br>
> unsigned input_primitive =<br>
> info->properties[TGSI_<wbr>PROPERTY_GS_INPUT_PRIM];<br>
> int num_verts = u_vertices_per_prim(input_<wbr>primitive);<br>
> int j;<br>
> info->file_count[TGSI_FILE_<wbr>INPUT] = num_verts;<br>
> diff --git a/src/gallium/auxiliary/vl/vl_<wbr>mc.c b/src/gallium/auxiliary/vl/vl_<wbr>mc.c<br>
> index a202fac..583539e 100644<br>
> --- a/src/gallium/auxiliary/vl/vl_<wbr>mc.c<br>
> +++ b/src/gallium/auxiliary/vl/vl_<wbr>mc.c<br>
> @@ -337,21 +337,21 @@ create_ycbcr_frag_shader(<wbr>struct vl_mc *r, float scale, bool invert,<br>
> * <a href="http://fragment.xyz" rel="noreferrer" target="_blank">fragment.xyz</a> = tex(tc, sampler) * scale + tc.z<br>
> * fragment.w = 1.0f<br>
> * }<br>
> */<br>
><br>
> ureg_SEQ(shader, ureg_writemask(tmp, TGSI_WRITEMASK_Y),<br>
> ureg_scalar(flags, TGSI_SWIZZLE_W), ureg_src(tmp));<br>
><br>
> ureg_IF(shader, ureg_scalar(ureg_src(tmp), TGSI_SWIZZLE_Y), &label);<br>
><br>
> - ureg_KILL(shader);<br>
> + ureg_KILL_IF(shader, ureg_imm1f(shader, -1.0));<br>
><br>
> ureg_fixup_label(shader, label, ureg_get_instruction_number(<wbr>shader));<br>
> ureg_ELSE(shader, &label);<br>
><br>
> fs_callback(callback_priv, r, shader, VS_O_VTEX, tmp);<br>
><br>
> if (scale != 1.0f)<br>
> ureg_MAD(shader, ureg_writemask(tmp, TGSI_WRITEMASK_XYZ),<br>
> ureg_src(tmp), ureg_imm1f(shader, scale),<br>
> ureg_scalar(flags, TGSI_SWIZZLE_Z));<br>
> diff --git a/src/gallium/docs/source/<wbr>tgsi.rst b/src/gallium/docs/source/<wbr>tgsi.rst<br>
> index 1a51fe9..93cc57c 100644<br>
> --- a/src/gallium/docs/source/<wbr>tgsi.rst<br>
> +++ b/src/gallium/docs/source/<wbr>tgsi.rst<br>
> @@ -669,25 +669,20 @@ This instruction replicates its result.<br>
><br>
> Conditional discard. Allowed in fragment shaders only.<br>
><br>
> .. math::<br>
><br>
> if (src.x < 0 || src.y < 0 || src.z < 0 || src.w < 0)<br>
> discard<br>
> endif<br>
><br>
><br>
> -.. opcode:: KILL - Discard<br>
> -<br>
> - Unconditional discard. Allowed in fragment shaders only.<br>
> -<br>
> -<br>
> .. opcode:: TXB - Texture Lookup With Bias<br>
><br>
> for cube map array textures and shadow cube maps, the bias value<br>
> cannot be passed in src0.w, and TXB2 must be used instead.<br>
><br>
> if the target is a shadow texture, the reference value is always<br>
> in src.z (this prevents shadow 3d and shadow 2d arrays from<br>
> using this instruction, but this is not needed).<br>
><br>
> .. math::<br>
> diff --git a/src/gallium/drivers/i915/<wbr>i915_fpc_optimize.c b/src/gallium/drivers/i915/<wbr>i915_fpc_optimize.c<br>
> index 76ef20d..5b53179 100644<br>
> --- a/src/gallium/drivers/i915/<wbr>i915_fpc_optimize.c<br>
> +++ b/src/gallium/drivers/i915/<wbr>i915_fpc_optimize.c<br>
> @@ -84,21 +84,20 @@ static const struct {<br>
> [ TGSI_OPCODE_DDY ] = { false, false, 0, 1, 0 },<br>
> [ TGSI_OPCODE_DP2 ] = { false, true, TGSI_SWIZZLE_ONE, 1, 2 },<br>
> [ TGSI_OPCODE_DP3 ] = { false, true, TGSI_SWIZZLE_ONE, 1, 2 },<br>
> [ TGSI_OPCODE_DP4 ] = { false, true, TGSI_SWIZZLE_ONE, 1, 2 },<br>
> [ TGSI_OPCODE_DST ] = { false, false, 0, 1, 2 },<br>
> [ TGSI_OPCODE_END ] = { false, false, 0, 0, 0 },<br>
> [ TGSI_OPCODE_EX2 ] = { false, false, 0, 1, 1 },<br>
> [ TGSI_OPCODE_FLR ] = { false, false, 0, 1, 1 },<br>
> [ TGSI_OPCODE_FRC ] = { false, false, 0, 1, 1 },<br>
> [ TGSI_OPCODE_KILL_IF ] = { false, false, 0, 0, 1 },<br>
> - [ TGSI_OPCODE_KILL ] = { false, false, 0, 0, 0 },<br>
> [ TGSI_OPCODE_LG2 ] = { false, false, 0, 1, 1 },<br>
> [ TGSI_OPCODE_LIT ] = { false, false, 0, 1, 1 },<br>
> [ TGSI_OPCODE_LRP ] = { false, false, 0, 1, 3 },<br>
> [ TGSI_OPCODE_MAX ] = { false, false, 0, 1, 2 },<br>
> [ TGSI_OPCODE_MAD ] = { false, false, 0, 1, 3 },<br>
> [ TGSI_OPCODE_MIN ] = { false, false, 0, 1, 2 },<br>
> [ TGSI_OPCODE_MOV ] = { false, false, 0, 1, 1 },<br>
> [ TGSI_OPCODE_MUL ] = { false, true, TGSI_SWIZZLE_ONE, 1, 2 },<br>
> [ TGSI_OPCODE_NOP ] = { false, false, 0, 0, 0 },<br>
> [ TGSI_OPCODE_POW ] = { false, false, 0, 1, 2 },<br>
> diff --git a/src/gallium/drivers/i915/<wbr>i915_fpc_translate.c b/src/gallium/drivers/i915/<wbr>i915_fpc_translate.c<br>
> index 2eaa1e6..054d08d 100644<br>
> --- a/src/gallium/drivers/i915/<wbr>i915_fpc_translate.c<br>
> +++ b/src/gallium/drivers/i915/<wbr>i915_fpc_translate.c<br>
> @@ -634,33 +634,20 @@ i915_translate_instruction(<wbr>struct i915_fp_compile *p,<br>
><br>
> i915_emit_texld(p,<br>
> tmp, /* dest reg: a dummy reg */<br>
> A0_DEST_CHANNEL_ALL, /* dest writemask */<br>
> 0, /* sampler */<br>
> src0, /* coord*/<br>
> T0_TEXKILL, /* opcode */<br>
> 1); /* num_coord */<br>
> break;<br>
><br>
> - case TGSI_OPCODE_KILL:<br>
> - /* unconditional kill */<br>
> - tmp = i915_get_utemp(p);<br>
> -<br>
> - i915_emit_texld(p,<br>
> - tmp, /* dest reg: a dummy reg */<br>
> - A0_DEST_CHANNEL_ALL, /* dest writemask */<br>
> - 0, /* sampler */<br>
> - negate(swizzle(0, ONE, ONE, ONE, ONE), 1, 1, 1, 1), /* coord */<br>
> - T0_TEXKILL, /* opcode */<br>
> - 1); /* num_coord */<br>
> - break;<br>
> -<br>
> case TGSI_OPCODE_LG2:<br>
> src0 = src_vector(p, &inst->Src[0], fs);<br>
><br>
> i915_emit_arith(p,<br>
> A0_LOG,<br>
> get_result_vector(p, &inst->Dst[0]),<br>
> get_result_flags(inst), 0,<br>
> swizzle(src0, X, X, X, X), 0, 0);<br>
> break;<br>
><br>
> diff --git a/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_from_tgsi.cpp<br>
> index 2780605..34c4c3a 100644<br>
> --- a/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_from_tgsi.cpp<br>
> +++ b/src/gallium/drivers/nouveau/<wbr>codegen/nv50_ir_from_tgsi.cpp<br>
> @@ -3439,23 +3439,20 @@ Converter::handleInstruction(<wbr>const struct tgsi_full_instruction *insn)<br>
> mask = 0;<br>
> for (c = 0; c < 4; ++c) {<br>
> const int s = tgsi.getSrc(0).getSwizzle(c);<br>
> if (mask & (1 << s))<br>
> continue;<br>
> mask |= 1 << s;<br>
> mkCmp(OP_SET, CC_LT, TYPE_F32, val0, TYPE_F32, fetchSrc(0, c), zero);<br>
> mkOp(OP_DISCARD, TYPE_NONE, NULL)->setPredicate(CC_P, val0);<br>
> }<br>
> break;<br>
> - case TGSI_OPCODE_KILL:<br>
> - mkOp(OP_DISCARD, TYPE_NONE, NULL);<br>
> - break;<br>
> case TGSI_OPCODE_TEX:<br>
> case TGSI_OPCODE_TEX_LZ:<br>
> case TGSI_OPCODE_TXB:<br>
> case TGSI_OPCODE_TXL:<br>
> case TGSI_OPCODE_TXP:<br>
> case TGSI_OPCODE_LODQ:<br>
> // R S L C Dx Dy<br>
> handleTEX(dst0, 1, 1, 0x03, 0x0f, 0x00, 0x00);<br>
> break;<br>
> case TGSI_OPCODE_TXD:<br>
> diff --git a/src/gallium/drivers/nouveau/<wbr>nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/<wbr>nv30/nvfx_fragprog.c<br>
> index 86e3599..623ceed 100644<br>
> --- a/src/gallium/drivers/nouveau/<wbr>nv30/nvfx_fragprog.c<br>
> +++ b/src/gallium/drivers/nouveau/<wbr>nv30/nvfx_fragprog.c<br>
> @@ -596,23 +596,20 @@ nvfx_fragprog_parse_<wbr>instruction(struct nvfx_fpc *fpc,<br>
> break;<br>
> case TGSI_OPCODE_EX2:<br>
> nvfx_fp_emit(fpc, arith(sat, EX2, dst, mask, src[0], none, none));<br>
> break;<br>
> case TGSI_OPCODE_FLR:<br>
> nvfx_fp_emit(fpc, arith(sat, FLR, dst, mask, src[0], none, none));<br>
> break;<br>
> case TGSI_OPCODE_FRC:<br>
> nvfx_fp_emit(fpc, arith(sat, FRC, dst, mask, src[0], none, none));<br>
> break;<br>
> - case TGSI_OPCODE_KILL:<br>
> - nvfx_fp_emit(fpc, arith(0, KIL, none.reg, 0, none, none, none));<br>
> - break;<br>
> case TGSI_OPCODE_KILL_IF:<br>
> insn = arith(0, MOV, none.reg, NVFX_FP_MASK_ALL, src[0], none, none);<br>
> insn.cc_update = 1;<br>
> nvfx_fp_emit(fpc, insn);<br>
><br>
> insn = arith(0, KIL, none.reg, 0, none, none, none);<br>
> insn.cc_test = NVFX_COND_LT;<br>
> nvfx_fp_emit(fpc, insn);<br>
> break;<br>
> case TGSI_OPCODE_LG2:<br>
> diff --git a/src/gallium/drivers/r300/<wbr>r300_tgsi_to_rc.c b/src/gallium/drivers/r300/<wbr>r300_tgsi_to_rc.c<br>
> index 3030698..a660cec 100644<br>
> --- a/src/gallium/drivers/r300/<wbr>r300_tgsi_to_rc.c<br>
> +++ b/src/gallium/drivers/r300/<wbr>r300_tgsi_to_rc.c<br>
> @@ -53,21 +53,20 @@ static unsigned translate_opcode(unsigned opcode)<br>
> case TGSI_OPCODE_LRP: return RC_OPCODE_LRP;<br>
> case TGSI_OPCODE_FRC: return RC_OPCODE_FRC;<br>
> case TGSI_OPCODE_FLR: return RC_OPCODE_FLR;<br>
> case TGSI_OPCODE_ROUND: return RC_OPCODE_ROUND;<br>
> case TGSI_OPCODE_EX2: return RC_OPCODE_EX2;<br>
> case TGSI_OPCODE_LG2: return RC_OPCODE_LG2;<br>
> case TGSI_OPCODE_POW: return RC_OPCODE_POW;<br>
> case TGSI_OPCODE_COS: return RC_OPCODE_COS;<br>
> case TGSI_OPCODE_DDX: return RC_OPCODE_DDX;<br>
> case TGSI_OPCODE_DDY: return RC_OPCODE_DDY;<br>
> - case TGSI_OPCODE_KILL: return RC_OPCODE_KILP;<br>
> /* case TGSI_OPCODE_PK2H: return RC_OPCODE_PK2H; */<br>
> /* case TGSI_OPCODE_PK2US: return RC_OPCODE_PK2US; */<br>
> /* case TGSI_OPCODE_PK4B: return RC_OPCODE_PK4B; */<br>
> /* case TGSI_OPCODE_PK4UB: return RC_OPCODE_PK4UB; */<br>
> case TGSI_OPCODE_SEQ: return RC_OPCODE_SEQ;<br>
> case TGSI_OPCODE_SGT: return RC_OPCODE_SGT;<br>
> case TGSI_OPCODE_SIN: return RC_OPCODE_SIN;<br>
> case TGSI_OPCODE_SLE: return RC_OPCODE_SLE;<br>
> case TGSI_OPCODE_SNE: return RC_OPCODE_SNE;<br>
> case TGSI_OPCODE_TEX: return RC_OPCODE_TEX;<br>
> diff --git a/src/gallium/drivers/r600/<wbr>r600_shader.c b/src/gallium/drivers/r600/<wbr>r600_shader.c<br>
> index 188fbc9..c879d02 100644<br>
> --- a/src/gallium/drivers/r600/<wbr>r600_shader.c<br>
> +++ b/src/gallium/drivers/r600/<wbr>r600_shader.c<br>
> @@ -4611,26 +4611,21 @@ static int tgsi_kill(struct r600_shader_ctx *ctx)<br>
> int i, r;<br>
><br>
> for (i = 0; i < 4; i++) {<br>
> memset(&alu, 0, sizeof(struct r600_bytecode_alu));<br>
> alu.op = ctx->inst_info->op;<br>
><br>
> alu.dst.chan = i;<br>
><br>
> alu.src[0].sel = V_SQ_ALU_SRC_0;<br>
><br>
> - if (inst->Instruction.Opcode == TGSI_OPCODE_KILL) {<br>
> - alu.src[1].sel = V_SQ_ALU_SRC_1;<br>
> - alu.src[1].neg = 1;<br>
> - } else {<br>
> - r600_bytecode_src(&alu.src[1], &ctx->src[0], i);<br>
> - }<br>
> + r600_bytecode_src(&alu.src[1], &ctx->src[0], i);<br>
> if (i == 3) {<br>
> alu.last = 1;<br>
> }<br>
> r = r600_bytecode_add_alu(ctx->bc, &alu);<br>
> if (r)<br>
> return r;<br>
> }<br>
><br>
> /* kill must be last in ALU */<br>
> ctx->bc->force_add_cf = 1;<br>
> @@ -8863,21 +8858,21 @@ static const struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[]<br>
> [TGSI_OPCODE_LG2] = { ALU_OP1_LOG_IEEE, tgsi_trans_srcx_replicate},<br>
> [TGSI_OPCODE_POW] = { ALU_OP0_NOP, tgsi_pow},<br>
> [31] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [32] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [33] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [34] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [35] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_COS] = { ALU_OP1_COS, tgsi_trig},<br>
> [TGSI_OPCODE_DDX] = { FETCH_OP_GET_GRADIENTS_H, tgsi_tex},<br>
> [TGSI_OPCODE_DDY] = { FETCH_OP_GET_GRADIENTS_V, tgsi_tex},<br>
> - [TGSI_OPCODE_KILL] = { ALU_OP2_KILLGT, tgsi_kill}, /* unconditional kill */<br>
> + [39] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK2H] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK2US] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK4B] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK4UB] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [44] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_SEQ] = { ALU_OP2_SETE, tgsi_op2},<br>
> [46] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_SGT] = { ALU_OP2_SETGT, tgsi_op2},<br>
> [TGSI_OPCODE_SIN] = { ALU_OP1_SIN, tgsi_trig},<br>
> [TGSI_OPCODE_SLE] = { ALU_OP2_SETGE, tgsi_op2_swap},<br>
> @@ -9061,21 +9056,21 @@ static const struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] =<br>
> [TGSI_OPCODE_LG2] = { ALU_OP1_LOG_IEEE, tgsi_trans_srcx_replicate},<br>
> [TGSI_OPCODE_POW] = { ALU_OP0_NOP, tgsi_pow},<br>
> [31] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [32] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [33] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [34] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [35] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_COS] = { ALU_OP1_COS, tgsi_trig},<br>
> [TGSI_OPCODE_DDX] = { FETCH_OP_GET_GRADIENTS_H, tgsi_tex},<br>
> [TGSI_OPCODE_DDY] = { FETCH_OP_GET_GRADIENTS_V, tgsi_tex},<br>
> - [TGSI_OPCODE_KILL] = { ALU_OP2_KILLGT, tgsi_kill}, /* unconditional kill */<br>
> + [39] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK2H] = { ALU_OP0_NOP, tgsi_pk2h},<br>
> [TGSI_OPCODE_PK2US] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK4B] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK4UB] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [44] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_SEQ] = { ALU_OP2_SETE, tgsi_op2},<br>
> [46] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_SGT] = { ALU_OP2_SETGT, tgsi_op2},<br>
> [TGSI_OPCODE_SIN] = { ALU_OP1_SIN, tgsi_trig},<br>
> [TGSI_OPCODE_SLE] = { ALU_OP2_SETGE, tgsi_op2_swap},<br>
> @@ -9284,21 +9279,21 @@ static const struct r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] =<br>
> [TGSI_OPCODE_LG2] = { ALU_OP1_LOG_IEEE, cayman_emit_float_instr},<br>
> [TGSI_OPCODE_POW] = { ALU_OP0_NOP, cayman_pow},<br>
> [31] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [32] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [33] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [34] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [35] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_COS] = { ALU_OP1_COS, cayman_trig},<br>
> [TGSI_OPCODE_DDX] = { FETCH_OP_GET_GRADIENTS_H, tgsi_tex},<br>
> [TGSI_OPCODE_DDY] = { FETCH_OP_GET_GRADIENTS_V, tgsi_tex},<br>
> - [TGSI_OPCODE_KILL] = { ALU_OP2_KILLGT, tgsi_kill}, /* unconditional kill */<br>
> + [39] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK2H] = { ALU_OP0_NOP, tgsi_pk2h},<br>
> [TGSI_OPCODE_PK2US] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK4B] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_PK4UB] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [44] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_SEQ] = { ALU_OP2_SETE, tgsi_op2},<br>
> [46] = { ALU_OP0_NOP, tgsi_unsupported},<br>
> [TGSI_OPCODE_SGT] = { ALU_OP2_SETGT, tgsi_op2},<br>
> [TGSI_OPCODE_SIN] = { ALU_OP1_SIN, cayman_trig},<br>
> [TGSI_OPCODE_SLE] = { ALU_OP2_SETGE, tgsi_op2_swap},<br>
> diff --git a/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_alu.c b/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_alu.c<br>
> index fc705c3..a628837 100644<br>
> --- a/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_alu.c<br>
> +++ b/src/gallium/drivers/<wbr>radeonsi/si_shader_tgsi_alu.c<br>
> @@ -56,43 +56,34 @@ static void kill_if_fetch_args(struct lp_build_tgsi_context *bld_base,<br>
> }<br>
><br>
> static void kil_emit(const struct lp_build_tgsi_action *action,<br>
> struct lp_build_tgsi_context *bld_base,<br>
> struct lp_build_emit_data *emit_data)<br>
> {<br>
> struct si_shader_context *ctx = si_shader_context(bld_base);<br>
> LLVMBuilderRef builder = ctx->ac.builder;<br>
><br>
> if (ctx->postponed_kill) {<br>
> - if (emit_data->inst->Instruction.<wbr>Opcode == TGSI_OPCODE_KILL_IF) {<br>
> - LLVMValueRef val;<br>
> -<br>
> - /* Take the minimum kill value. This is the same as OR<br>
> - * between 2 kill values. If the value is negative,<br>
> - * the pixel will be killed.<br>
> - */<br>
> - val = LLVMBuildLoad(builder, ctx->postponed_kill, "");<br>
> - val = lp_build_emit_llvm_binary(bld_<wbr>base, TGSI_OPCODE_MIN,<br>
> - val, emit_data->args[0]);<br>
> - LLVMBuildStore(builder, val, ctx->postponed_kill);<br>
> - } else {<br>
> - LLVMBuildStore(builder,<br>
> - LLVMConstReal(ctx->f32, -1),<br>
> - ctx->postponed_kill);<br>
> - }<br>
> + LLVMValueRef val;<br>
> +<br>
> + /* Take the minimum kill value. This is the same as OR<br>
> + * between 2 kill values. If the value is negative,<br>
> + * the pixel will be killed.<br>
> + */<br>
> + val = LLVMBuildLoad(builder, ctx->postponed_kill, "");<br>
> + val = lp_build_emit_llvm_binary(bld_<wbr>base, TGSI_OPCODE_MIN,<br>
> + val, emit_data->args[0]);<br>
> + LLVMBuildStore(builder, val, ctx->postponed_kill);<br>
> return;<br>
> }<br>
><br>
> - if (emit_data->inst->Instruction.<wbr>Opcode == TGSI_OPCODE_KILL_IF)<br>
> - ac_build_kill(&ctx->ac, emit_data->args[0]);<br>
> - else<br>
> - ac_build_kill(&ctx->ac, NULL);<br>
> + ac_build_kill(&ctx->ac, emit_data->args[0]);<br>
> }<br>
><br>
> static void emit_icmp(const struct lp_build_tgsi_action *action,<br>
> struct lp_build_tgsi_context *bld_base,<br>
> struct lp_build_emit_data *emit_data)<br>
> {<br>
> unsigned pred;<br>
> struct si_shader_context *ctx = si_shader_context(bld_base);<br>
><br>
> switch (emit_data->inst->Instruction.<wbr>Opcode) {<br>
> @@ -804,21 +795,20 @@ void si_shader_context_init_alu(<wbr>struct lp_build_tgsi_context *bld_base)<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_IMIN].emit = emit_minmax_int;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_IMSB].emit = emit_imsb;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_INEG].emit = emit_ineg;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_ISHR].emit = emit_ishr;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_ISGE].emit = emit_icmp;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_ISLT].emit = emit_icmp;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_ISSG].emit = emit_ssg;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_I2F].emit = emit_i2f;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_KILL_IF].fetch_args = kill_if_fetch_args;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_KILL_IF].emit = kil_emit;<br>
> - bld_base->op_actions[TGSI_<wbr>OPCODE_KILL].emit = kil_emit;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LDEXP].emit = build_tgsi_intrinsic_nomem;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LDEXP].intr_name = "llvm.amdgcn.ldexp.f32";<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LSB].emit = emit_lsb;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LG2].emit = build_tgsi_intrinsic_nomem;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_LG2].intr_name = "llvm.log2.f32";<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_MAX].emit = build_tgsi_intrinsic_nomem;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_MAX].intr_name = "llvm.maxnum.f32";<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_MIN].emit = build_tgsi_intrinsic_nomem;<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_MIN].intr_name = "llvm.minnum.f32";<br>
> bld_base->op_actions[TGSI_<wbr>OPCODE_MOD].emit = emit_mod;<br>
> diff --git a/src/gallium/drivers/svga/<wbr>svga_tgsi_insn.c b/src/gallium/drivers/svga/<wbr>svga_tgsi_insn.c<br>
> index be99ad5..77c45f3 100644<br>
> --- a/src/gallium/drivers/svga/<wbr>svga_tgsi_insn.c<br>
> +++ b/src/gallium/drivers/svga/<wbr>svga_tgsi_insn.c<br>
> @@ -1382,43 +1382,20 @@ emit_kill_if(struct svga_shader_emitter *emit,<br>
> * only used XYZ. The MSDN documentation about this is incorrect.<br>
> */<br>
> if (!submit_op0( emit, inst_token( SVGA3DOP_TEXKILL ), dst(src0) ))<br>
> return FALSE;<br>
><br>
> return TRUE;<br>
> }<br>
><br>
><br>
> /**<br>
> - * Translate/emit unconditional kill instruction (usually found inside<br>
> - * an IF/ELSE/ENDIF block).<br>
> - */<br>
> -static boolean<br>
> -emit_kill(struct svga_shader_emitter *emit,<br>
> - const struct tgsi_full_instruction *insn)<br>
> -{<br>
> - SVGA3dShaderDestToken temp;<br>
> - struct src_register one = get_one_immediate(emit);<br>
> - SVGA3dShaderInstToken inst = inst_token( SVGA3DOP_TEXKILL );<br>
> -<br>
> - /* texkill doesn't allow negation on the operand so lets move<br>
> - * negation of {1} to a temp register */<br>
> - temp = get_temp( emit );<br>
> - if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), temp,<br>
> - negate( one ) ))<br>
> - return FALSE;<br>
> -<br>
> - return submit_op0( emit, inst, temp );<br>
> -}<br>
> -<br>
> -<br>
> -/**<br>
> * Test if r1 and r2 are the same register.<br>
> */<br>
> static boolean<br>
> same_register(struct src_register r1, struct src_register r2)<br>
> {<br>
> return (r1.base.num == r2.base.num &&<br>
> r1.base.type_upper == r2.base.type_upper &&<br>
> r1.base.type_lower == r2.base.type_lower);<br>
> }<br>
><br>
> @@ -2896,23 +2873,20 @@ svga_emit_instruction(struct svga_shader_emitter *emit,<br>
> case TGSI_OPCODE_ENDIF:<br>
> return emit_endif( emit, insn );<br>
><br>
> case TGSI_OPCODE_BGNLOOP:<br>
> return emit_bgnloop( emit, insn );<br>
> case TGSI_OPCODE_ENDLOOP:<br>
> return emit_endloop( emit, insn );<br>
> case TGSI_OPCODE_BRK:<br>
> return emit_brk( emit, insn );<br>
><br>
> - case TGSI_OPCODE_KILL:<br>
> - return emit_kill( emit, insn );<br>
> -<br>
> case TGSI_OPCODE_DST:<br>
> return emit_dst_insn( emit, insn );<br>
><br>
> case TGSI_OPCODE_LIT:<br>
> return emit_lit( emit, insn );<br>
><br>
> case TGSI_OPCODE_LRP:<br>
> return emit_lrp( emit, insn );<br>
><br>
> case TGSI_OPCODE_SSG:<br>
> @@ -3510,22 +3484,21 @@ needs_to_create_common_<wbr>immediate(const struct svga_shader_emitter *emit)<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_DDX] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_DDY] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_ROUND] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_SGE] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_SGT] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_SLE] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_SLT] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_SNE] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_SEQ] >= 1 ||<br>
> emit->info.opcode_count[TGSI_<wbr>OPCODE_EXP] >= 1 ||<br>
> - emit->info.opcode_count[TGSI_<wbr>OPCODE_LOG] >= 1 ||<br>
> - emit->info.opcode_count[TGSI_<wbr>OPCODE_KILL] >= 1)<br>
> + emit->info.opcode_count[TGSI_<wbr>OPCODE_LOG] >= 1)<br>
> return TRUE;<br>
><br>
> return FALSE;<br>
> }<br>
><br>
><br>
> /**<br>
> * Do we need to create a looping constant?<br>
> */<br>
> static boolean<br>
> diff --git a/src/gallium/drivers/svga/<wbr>svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/<wbr>svga_tgsi_vgpu10.c<br>
> index 5fc93e2..84c7d3b 100644<br>
> --- a/src/gallium/drivers/svga/<wbr>svga_tgsi_vgpu10.c<br>
> +++ b/src/gallium/drivers/svga/<wbr>svga_tgsi_vgpu10.c<br>
> @@ -3865,39 +3865,20 @@ emit_kill_if(struct svga_shader_emitter_v10 *emit,<br>
> emit_src_register(emit, &tmp_src_xxxx);<br>
> end_emit_instruction(emit);<br>
><br>
> free_temp_indexes(emit);<br>
><br>
> return TRUE;<br>
> }<br>
><br>
><br>
> /**<br>
> - * Emit code for TGSI_OPCODE_KILL instruction (unconditional discard).<br>
> - */<br>
> -static boolean<br>
> -emit_kill(struct svga_shader_emitter_v10 *emit,<br>
> - const struct tgsi_full_instruction *inst)<br>
> -{<br>
> - struct tgsi_full_src_register zero = make_immediate_reg_float(emit, 0.0f);<br>
> -<br>
> - /* DISCARD if 0.0 is zero */<br>
> - begin_emit_instruction(emit);<br>
> - emit_discard_opcode(emit, FALSE);<br>
> - emit_src_register(emit, &zero);<br>
> - end_emit_instruction(emit);<br>
> -<br>
> - return TRUE;<br>
> -}<br>
> -<br>
> -<br>
> -/**<br>
> * Emit code for TGSI_OPCODE_LG2 instruction.<br>
> */<br>
> static boolean<br>
> emit_lg2(struct svga_shader_emitter_v10 *emit,<br>
> const struct tgsi_full_instruction *inst)<br>
> {<br>
> /* Note that TGSI_OPCODE_LG2 computes only one value from src.x<br>
> * while VGPU10 computes four values.<br>
> *<br>
> * dst = LG2(src):<br>
> @@ -5537,22 +5518,20 @@ emit_vgpu10_instruction(struct svga_shader_emitter_v10 *emit,<br>
> case TGSI_OPCODE_COS:<br>
> return emit_sincos(emit, inst);<br>
> case TGSI_OPCODE_DST:<br>
> return emit_dst(emit, inst);<br>
> case TGSI_OPCODE_EX2:<br>
> return emit_ex2(emit, inst);<br>
> case TGSI_OPCODE_EXP:<br>
> return emit_exp(emit, inst);<br>
> case TGSI_OPCODE_IF:<br>
> return emit_if(emit, inst);<br>
> - case TGSI_OPCODE_KILL:<br>
> - return emit_kill(emit, inst);<br>
> case TGSI_OPCODE_KILL_IF:<br>
> return emit_kill_if(emit, inst);<br>
> case TGSI_OPCODE_LG2:<br>
> return emit_lg2(emit, inst);<br>
> case TGSI_OPCODE_LIT:<br>
> return emit_lit(emit, inst);<br>
> case TGSI_OPCODE_LOG:<br>
> return emit_log(emit, inst);<br>
> case TGSI_OPCODE_LRP:<br>
> return emit_lrp(emit, inst);<br>
> diff --git a/src/gallium/include/pipe/p_<wbr>shader_tokens.h b/src/gallium/include/pipe/p_<wbr>shader_tokens.h<br>
> index 97deef7..722952d 100644<br>
> --- a/src/gallium/include/pipe/p_<wbr>shader_tokens.h<br>
> +++ b/src/gallium/include/pipe/p_<wbr>shader_tokens.h<br>
> @@ -370,21 +370,21 @@ struct tgsi_property_data {<br>
> #define TGSI_OPCODE_LG2 29<br>
> #define TGSI_OPCODE_POW 30<br>
> /* gap */<br>
> #define TGSI_OPCODE_U2I64 32<br>
> #define TGSI_OPCODE_CLOCK 33<br>
> #define TGSI_OPCODE_I2I64 34<br>
> /* gap */<br>
> #define TGSI_OPCODE_COS 36<br>
> #define TGSI_OPCODE_DDX 37<br>
> #define TGSI_OPCODE_DDY 38<br>
> -#define TGSI_OPCODE_KILL 39 /* unconditional */<br>
> +/* gap */<br>
> #define TGSI_OPCODE_PK2H 40<br>
> #define TGSI_OPCODE_PK2US 41<br>
> #define TGSI_OPCODE_PK4B 42<br>
> #define TGSI_OPCODE_PK4UB 43<br>
> #define TGSI_OPCODE_D2U64 44<br>
> #define TGSI_OPCODE_SEQ 45<br>
> #define TGSI_OPCODE_D2I64 46<br>
> #define TGSI_OPCODE_SGT 47<br>
> #define TGSI_OPCODE_SIN 48<br>
> #define TGSI_OPCODE_SLE 49<br>
> diff --git a/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp<br>
> index e01268b..5295fac 100644<br>
> --- a/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp<br>
> +++ b/src/mesa/state_tracker/st_<wbr>glsl_to_tgsi.cpp<br>
> @@ -4335,21 +4335,22 @@ glsl_to_tgsi_visitor::visit(<wbr>ir_discard *ir)<br>
> st_src_reg temp = get_temp(ir->condition->type);<br>
> emit_asm(ir, TGSI_OPCODE_AND, st_dst_reg(temp),<br>
> condition, st_src_reg_for_float(1.0));<br>
> condition = temp;<br>
> }<br>
><br>
> condition.negate = ~condition.negate;<br>
> emit_asm(ir, TGSI_OPCODE_KILL_IF, undef_dst, condition);<br>
> } else {<br>
> /* unconditional kil */<br>
> - emit_asm(ir, TGSI_OPCODE_KILL);<br>
> + emit_asm(ir, TGSI_OPCODE_KILL_IF, undef_dst,<br>
> + st_src_reg_for_float(-1.0));<br>
> }<br>
> }<br>
><br>
> void<br>
> glsl_to_tgsi_visitor::visit(<wbr>ir_if *ir)<br>
> {<br>
> unsigned if_opcode;<br>
> glsl_to_tgsi_instruction *if_inst;<br>
><br>
> ir->condition->accept(this);<br>
><br>
<br>
</div></blockquote></div><br></div></div></div>