prog_to_nir: Use nir_op_dph
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 Sep 2015 23:57:03 +0000 (16:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 23 Sep 2015 03:37:35 +0000 (20:37 -0700)
Shader-db results on HSW:

   instructions in affected programs:     72 -> 56 (-22.22%)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/program/prog_to_nir.c

index ec61100356a51531495575602a4916db1ff40975..1bd735a47bb3fcf848e8c4ebc5b3e43ddea9c10b 100644 (file)
@@ -527,8 +527,7 @@ ptn_dp4(nir_builder *b, nir_alu_dest dest, nir_ssa_def **src)
 static void
 ptn_dph(nir_builder *b, nir_alu_dest dest, nir_ssa_def **src)
 {
-   nir_ssa_def *dp3 = nir_fdot3(b, src[0], src[1]);
-   ptn_move_dest(b, dest, nir_fadd(b, dp3, ptn_channel(b, src[1], W)));
+   ptn_move_dest(b, dest, nir_fdph(b, src[0], src[1]));
 }
 
 static void