From 3e2ff8fade879cedfdff0e180a6996df1223a823 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 19 Aug 2017 22:00:02 +0200 Subject: gallium: remove TGSI opcode DPH use DP4 or DP3 + ADD. Reviewed-by: Roland Scheidegger --- src/gallium/drivers/svga/svga_tgsi_insn.c | 36 ----------------------------- src/gallium/drivers/svga/svga_tgsi_vgpu10.c | 36 ----------------------------- 2 files changed, 72 deletions(-) (limited to 'src/gallium/drivers/svga') diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index dd29f74a2a7..928330ce147 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -1236,39 +1236,6 @@ emit_dp2(struct svga_shader_emitter *emit, } -/** - * Translate the following TGSI DPH instruction. - * DPH DST, SRC1, SRC2 - * To the following SVGA3D instruction sequence. - * DP3 TMP, SRC1, SRC2 - * ADD DST, TMP, SRC2.wwww - */ -static boolean -emit_dph(struct svga_shader_emitter *emit, - const struct tgsi_full_instruction *insn ) -{ - SVGA3dShaderDestToken dst = translate_dst_register( emit, insn, 0 ); - const struct src_register src0 = translate_src_register( - emit, &insn->Src[0] ); - struct src_register src1 = - translate_src_register(emit, &insn->Src[1]); - SVGA3dShaderDestToken temp = get_temp( emit ); - - /* DP3 TMP, SRC1, SRC2 */ - if (!submit_op2( emit, inst_token( SVGA3DOP_DP3 ), temp, src0, src1 )) - return FALSE; - - src1 = scalar(src1, TGSI_SWIZZLE_W); - - /* ADD DST, TMP, SRC2.wwww */ - if (!submit_op2( emit, inst_token( SVGA3DOP_ADD ), dst, - src( temp ), src1 )) - return FALSE; - - return TRUE; -} - - /** * Sine / Cosine helper function. */ @@ -2924,9 +2891,6 @@ svga_emit_instruction(struct svga_shader_emitter *emit, case TGSI_OPCODE_DP2: return emit_dp2( emit, insn ); - case TGSI_OPCODE_DPH: - return emit_dph( emit, insn ); - case TGSI_OPCODE_COS: return emit_cos( emit, insn ); diff --git a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c index 56afd497d74..e57e78d11a5 100644 --- a/src/gallium/drivers/svga/svga_tgsi_vgpu10.c +++ b/src/gallium/drivers/svga/svga_tgsi_vgpu10.c @@ -3577,40 +3577,6 @@ emit_cmp(struct svga_shader_emitter_v10 *emit, } -/** - * Emit code for TGSI_OPCODE_DPH instruction. - */ -static boolean -emit_dph(struct svga_shader_emitter_v10 *emit, - const struct tgsi_full_instruction *inst) -{ - /* - * DP3 tmp, s0, s1 - * ADD dst, tmp, s1.wwww - */ - - struct tgsi_full_src_register s1_wwww = - swizzle_src(&inst->Src[1], TGSI_SWIZZLE_W, TGSI_SWIZZLE_W, - TGSI_SWIZZLE_W, TGSI_SWIZZLE_W); - - unsigned tmp = get_temp_index(emit); - struct tgsi_full_src_register tmp_src = make_src_temp_reg(tmp); - struct tgsi_full_dst_register tmp_dst = make_dst_temp_reg(tmp); - - /* DP3 tmp, s0, s1 */ - emit_instruction_op2(emit, VGPU10_OPCODE_DP3, &tmp_dst, &inst->Src[0], - &inst->Src[1], FALSE); - - /* ADD dst, tmp, s1.wwww */ - emit_instruction_op2(emit, VGPU10_OPCODE_ADD, &inst->Dst[0], &tmp_src, - &s1_wwww, inst->Instruction.Saturate); - - free_temp_indexes(emit); - - return TRUE; -} - - /** * Emit code for TGSI_OPCODE_DST instruction. */ @@ -5712,8 +5678,6 @@ emit_vgpu10_instruction(struct svga_shader_emitter_v10 *emit, return emit_cmp(emit, inst); case TGSI_OPCODE_COS: return emit_sincos(emit, inst); - case TGSI_OPCODE_DPH: - return emit_dph(emit, inst); case TGSI_OPCODE_DST: return emit_dst(emit, inst); case TGSI_OPCODE_EX2: -- cgit v1.2.3