Mesa (master): i915c: Use the actual MIN instruction.

Kenneth Graunke kwg at kemper.freedesktop.org
Wed Feb 18 00:13:46 UTC 2015


Module: Mesa
Branch: master
Commit: 598d144cef412f114bddccc5d3c428682b41a7c2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=598d144cef412f114bddccc5d3c428682b41a7c2

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Feb 10 03:36:48 2015 -0800

i915c: Use the actual MIN instruction.

Matt Turner noticed that the hardware has always had a MIN
instruction, but the driver always used MAX+MOV for no
apparent reason.

This should cut an instruction, and a temporary, allowing
more programs to run in hardware.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/mesa/drivers/dri/i915/i915_fragprog.c |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 96fdd3c..d42da5a 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -671,21 +671,7 @@ upload_program(struct i915_fragment_program *p)
          break;
 
       case OPCODE_MIN:
-         src0 = src_vector(p, &inst->SrcReg[0], program);
-         src1 = src_vector(p, &inst->SrcReg[1], program);
-         tmp = i915_get_utemp(p);
-         flags = get_result_flags(inst);
-
-         i915_emit_arith(p,
-                         A0_MAX,
-                         tmp, flags & A0_DEST_CHANNEL_ALL, 0,
-                         negate(src0, 1, 1, 1, 1),
-                         negate(src1, 1, 1, 1, 1), 0);
-
-         i915_emit_arith(p,
-                         A0_MOV,
-                         get_result_vector(p, inst),
-                         flags, 0, negate(tmp, 1, 1, 1, 1), 0, 0);
+         EMIT_2ARG_ARITH(A0_MIN);
          break;
 
       case OPCODE_MOV:




More information about the mesa-commit mailing list