diff options
author | Marek Olšák <[email protected]> | 2016-12-19 16:11:27 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-05 18:30:00 +0100 |
commit | d995115b1733ec14182e6bb4653b8f8389b87518 (patch) | |
tree | b92a60f2aa8f313af7051d4dffbfedc59a075c59 /src/gallium/drivers | |
parent | a4ace98a9733b3e83d971f4871c2908749c0e5c8 (diff) |
gallium: remove TGSI_OPCODE_SUB
It's redundant with the source modifier.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/i915/i915_fpc_optimize.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_fpc_translate.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_tgsi.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_tgsi_to_rc.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_insn.c | 27 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 25 |
10 files changed, 0 insertions, 93 deletions
diff --git a/src/gallium/drivers/i915/i915_fpc_optimize.c b/src/gallium/drivers/i915/i915_fpc_optimize.c index 7c3b9a9782f..5f2a8760478 100644 --- a/src/gallium/drivers/i915/i915_fpc_optimize.c +++ b/src/gallium/drivers/i915/i915_fpc_optimize.c @@ -115,7 +115,6 @@ static const struct { [ TGSI_OPCODE_SLT ] = { false, false, 0, 1, 2 }, [ TGSI_OPCODE_SNE ] = { false, false, 0, 1, 2 }, [ TGSI_OPCODE_SSG ] = { false, false, 0, 1, 1 }, - [ TGSI_OPCODE_SUB ] = { false, false, 0, 1, 2 }, [ TGSI_OPCODE_TEX ] = { true, false, 0, 1, 2 }, [ TGSI_OPCODE_TRUNC ] = { false, false, 0, 1, 1 }, [ TGSI_OPCODE_TXB ] = { true, false, 0, 1, 2 }, diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c index 80caf31f383..241c92dd28a 100644 --- a/src/gallium/drivers/i915/i915_fpc_translate.c +++ b/src/gallium/drivers/i915/i915_fpc_translate.c @@ -1022,17 +1022,6 @@ i915_translate_instruction(struct i915_fp_compile *p, negate(tmp, 1, 1, 1, 1), 0); break; - case TGSI_OPCODE_SUB: - src0 = src_vector(p, &inst->Src[0], fs); - src1 = src_vector(p, &inst->Src[1], fs); - - i915_emit_arith(p, - A0_ADD, - get_result_vector(p, &inst->Dst[0]), - get_result_flags(inst), 0, - src0, negate(src1, 1, 1, 1, 1), 0); - break; - case TGSI_OPCODE_TEX: emit_tex(p, inst, T0_TEXLD, fs); break; diff --git a/src/gallium/drivers/ilo/shader/toy_tgsi.c b/src/gallium/drivers/ilo/shader/toy_tgsi.c index a88f189ae88..4d813f0cf46 100644 --- a/src/gallium/drivers/ilo/shader/toy_tgsi.c +++ b/src/gallium/drivers/ilo/shader/toy_tgsi.c @@ -50,7 +50,6 @@ static const struct { [TGSI_OPCODE_MAX] = { GEN6_OPCODE_SEL, 1, 2 }, /* a later pass will move src[2] to accumulator */ [TGSI_OPCODE_MAD] = { GEN6_OPCODE_MAC, 1, 3 }, - [TGSI_OPCODE_SUB] = { GEN6_OPCODE_ADD, 1, 2 }, [TGSI_OPCODE_SQRT] = { TOY_OPCODE_SQRT, 1, 1 }, [TGSI_OPCODE_FRC] = { GEN6_OPCODE_FRC, 1, 1 }, [TGSI_OPCODE_FLR] = { GEN6_OPCODE_RNDD, 1, 1 }, @@ -144,9 +143,6 @@ aos_simple(struct toy_compiler *tc, case TGSI_OPCODE_UMAX: cond_modifier = GEN6_COND_GE; break; - case TGSI_OPCODE_SUB: - src[1] = tsrc_negate(src[1]); - break; case TGSI_OPCODE_IABS: src[0] = tsrc_absolute(src[0]); break; @@ -776,7 +772,6 @@ static const toy_tgsi_translate aos_translate_table[TGSI_OPCODE_LAST] = { [TGSI_OPCODE_SLT] = aos_set_on_cond, [TGSI_OPCODE_SGE] = aos_set_on_cond, [TGSI_OPCODE_MAD] = aos_simple, - [TGSI_OPCODE_SUB] = aos_simple, [TGSI_OPCODE_LRP] = aos_LRP, [TGSI_OPCODE_SQRT] = aos_simple, [TGSI_OPCODE_DP2A] = aos_DP2A, @@ -1318,7 +1313,6 @@ static const toy_tgsi_translate soa_translate_table[TGSI_OPCODE_LAST] = { [TGSI_OPCODE_SLT] = soa_per_channel, [TGSI_OPCODE_SGE] = soa_per_channel, [TGSI_OPCODE_MAD] = soa_per_channel, - [TGSI_OPCODE_SUB] = soa_per_channel, [TGSI_OPCODE_LRP] = soa_per_channel, [TGSI_OPCODE_SQRT] = soa_scalar_replicate, [TGSI_OPCODE_DP2A] = soa_dot_product, diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index b9190980455..86348e711b4 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -723,7 +723,6 @@ static nv50_ir::operation translateOpcode(uint opcode) NV50_IR_OPCODE_CASE(SGE, SET); NV50_IR_OPCODE_CASE(MAD, MAD); NV50_IR_OPCODE_CASE(FMA, FMA); - NV50_IR_OPCODE_CASE(SUB, SUB); NV50_IR_OPCODE_CASE(FLR, FLOOR); NV50_IR_OPCODE_CASE(ROUND, CVT); @@ -2988,7 +2987,6 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn) case TGSI_OPCODE_SHL: case TGSI_OPCODE_ISHR: case TGSI_OPCODE_USHR: - case TGSI_OPCODE_SUB: case TGSI_OPCODE_XOR: FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi) { src0 = fetchSrc(0, c); diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c index d031c6846ea..4924d21f4c2 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c @@ -750,9 +750,6 @@ nvfx_fragprog_parse_instruction(struct nvfx_fpc *fpc, } break; } - case TGSI_OPCODE_SUB: - nvfx_fp_emit(fpc, arith(sat, ADD, dst, mask, src[0], neg(src[1]), none)); - break; case TGSI_OPCODE_TEX: nvfx_fp_emit(fpc, tex(sat, TEX, unit, dst, mask, src[0], none, none)); break; diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c index a802c43e22b..baea701a027 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c @@ -672,9 +672,6 @@ nvfx_vertprog_parse_instruction(struct nvfx_vpc *vpc, case TGSI_OPCODE_SSG: nvfx_vp_emit(vpc, arith(sat, VEC, SSG, dst, mask, src[0], none, none)); break; - case TGSI_OPCODE_SUB: - nvfx_vp_emit(vpc, arith(sat, VEC, ADD, dst, mask, src[0], none, neg(src[1]))); - break; case TGSI_OPCODE_TRUNC: tmp = nvfx_src(temp(vpc)); insn = arith(0, VEC, MOV, none.reg, mask, src[0], none, none); diff --git a/src/gallium/drivers/r300/r300_tgsi_to_rc.c b/src/gallium/drivers/r300/r300_tgsi_to_rc.c index 9d1e59f18b6..59dfa05f317 100644 --- a/src/gallium/drivers/r300/r300_tgsi_to_rc.c +++ b/src/gallium/drivers/r300/r300_tgsi_to_rc.c @@ -50,7 +50,6 @@ static unsigned translate_opcode(unsigned opcode) case TGSI_OPCODE_SLT: return RC_OPCODE_SLT; case TGSI_OPCODE_SGE: return RC_OPCODE_SGE; case TGSI_OPCODE_MAD: return RC_OPCODE_MAD; - case TGSI_OPCODE_SUB: return RC_OPCODE_SUB; case TGSI_OPCODE_LRP: return RC_OPCODE_LRP; /* case TGSI_OPCODE_DP2A: return RC_OPCODE_DP2A; */ case TGSI_OPCODE_FRC: return RC_OPCODE_FRC; diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index c2996aa3085..ebe27445486 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -3804,9 +3804,6 @@ static int tgsi_op2_64_params(struct r600_shader_ctx *ctx, bool singledest, bool /* handle some special cases */ if (i == 1 || i == 3) { switch (ctx->parse.FullToken.FullInstruction.Instruction.Opcode) { - case TGSI_OPCODE_SUB: - r600_bytecode_src_toggle_neg(&alu.src[1]); - break; case TGSI_OPCODE_DABS: r600_bytecode_src_set_abs(&alu.src[0]); break; @@ -3931,14 +3928,6 @@ static int tgsi_op2_s(struct r600_shader_ctx *ctx, int swap, int trans_only) r600_bytecode_src(&alu.src[0], &ctx->src[1], i); r600_bytecode_src(&alu.src[1], &ctx->src[0], i); } - /* handle some special cases */ - switch (inst->Instruction.Opcode) { - case TGSI_OPCODE_SUB: - r600_bytecode_src_toggle_neg(&alu.src[1]); - break; - default: - break; - } if (i == lasti || trans_only) { alu.last = 1; } @@ -9006,7 +8995,6 @@ static const struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] [TGSI_OPCODE_SLT] = { ALU_OP2_SETGT, tgsi_op2_swap}, [TGSI_OPCODE_SGE] = { ALU_OP2_SETGE, tgsi_op2}, [TGSI_OPCODE_MAD] = { ALU_OP3_MULADD, tgsi_op3}, - [TGSI_OPCODE_SUB] = { ALU_OP2_ADD, tgsi_op2}, [TGSI_OPCODE_LRP] = { ALU_OP0_NOP, tgsi_lrp}, [TGSI_OPCODE_FMA] = { ALU_OP0_NOP, tgsi_unsupported}, [TGSI_OPCODE_SQRT] = { ALU_OP1_SQRT_IEEE, tgsi_trans_srcx_replicate}, @@ -9205,7 +9193,6 @@ static const struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = [TGSI_OPCODE_SLT] = { ALU_OP2_SETGT, tgsi_op2_swap}, [TGSI_OPCODE_SGE] = { ALU_OP2_SETGE, tgsi_op2}, [TGSI_OPCODE_MAD] = { ALU_OP3_MULADD, tgsi_op3}, - [TGSI_OPCODE_SUB] = { ALU_OP2_ADD, tgsi_op2}, [TGSI_OPCODE_LRP] = { ALU_OP0_NOP, tgsi_lrp}, [TGSI_OPCODE_FMA] = { ALU_OP3_FMA, tgsi_op3}, [TGSI_OPCODE_SQRT] = { ALU_OP1_SQRT_IEEE, tgsi_trans_srcx_replicate}, @@ -9428,7 +9415,6 @@ static const struct r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] = [TGSI_OPCODE_SLT] = { ALU_OP2_SETGT, tgsi_op2_swap}, [TGSI_OPCODE_SGE] = { ALU_OP2_SETGE, tgsi_op2}, [TGSI_OPCODE_MAD] = { ALU_OP3_MULADD, tgsi_op3}, - [TGSI_OPCODE_SUB] = { ALU_OP2_ADD, tgsi_op2}, [TGSI_OPCODE_LRP] = { ALU_OP0_NOP, tgsi_lrp}, [TGSI_OPCODE_FMA] = { ALU_OP3_FMA, tgsi_op3}, [TGSI_OPCODE_SQRT] = { ALU_OP1_SQRT_IEEE, cayman_emit_float_instr}, diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index 47a0afc8ad0..0efd72d7992 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -1403,30 +1403,6 @@ emit_ssg(struct svga_shader_emitter *emit, /** - * Translate/emit TGSI SUB instruction as: - * ADD DST, SRC0, negate(SRC1) - */ -static boolean -emit_sub(struct svga_shader_emitter *emit, - const struct tgsi_full_instruction *insn) -{ - SVGA3dShaderDestToken dst = translate_dst_register( emit, insn, 0 ); - struct src_register src0 = translate_src_register( - emit, &insn->Src[0] ); - struct src_register src1 = translate_src_register( - emit, &insn->Src[1] ); - - src1 = negate(src1); - - if (!submit_op2( emit, inst_token( SVGA3DOP_ADD ), dst, - src0, src1 )) - return FALSE; - - return TRUE; -} - - -/** * Translate/emit KILL_IF instruction (kill if any of X,Y,Z,W are negative). */ static boolean @@ -2989,9 +2965,6 @@ svga_emit_instruction(struct svga_shader_emitter *emit, case TGSI_OPCODE_SLE: return emit_select_op( emit, PIPE_FUNC_LEQUAL, insn ); - case TGSI_OPCODE_SUB: - return emit_sub( emit, insn ); - case TGSI_OPCODE_POW: return emit_pow( emit, insn ); diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index e7cfb404a2e..3131444e495 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -4715,29 +4715,6 @@ emit_issg(struct svga_shader_emitter_v10 *emit, /** - * Emit code for TGSI_OPCODE_SUB instruction. - */ -static boolean -emit_sub(struct svga_shader_emitter_v10 *emit, - const struct tgsi_full_instruction *inst) -{ - /* dst = SUB(s0, s1): - * dst = s0 - s1 - * Translates into: - * ADD dst, s0, neg(s1) - */ - struct tgsi_full_src_register neg_src1 = negate_src(&inst->Src[1]); - - /* ADD dst, s0, neg(s1) */ - emit_instruction_op2(emit, VGPU10_OPCODE_ADD, &inst->Dst[0], - &inst->Src[0], &neg_src1, - inst->Instruction.Saturate); - - return TRUE; -} - - -/** * Emit a comparison instruction. The dest register will get * 0 or ~0 values depending on the outcome of comparing src0 to src1. */ @@ -5801,8 +5778,6 @@ emit_vgpu10_instruction(struct svga_shader_emitter_v10 *emit, return emit_ssg(emit, inst); case TGSI_OPCODE_ISSG: return emit_issg(emit, inst); - case TGSI_OPCODE_SUB: - return emit_sub(emit, inst); case TGSI_OPCODE_TEX: return emit_tex(emit, inst); case TGSI_OPCODE_TXP: |