Mesa (master): i915g: 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: 7bf774034a20e6864d63caf8c65cc424454b1bed
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bf774034a20e6864d63caf8c65cc424454b1bed

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

i915g: 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/gallium/drivers/i915/i915_fpc_translate.c |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c
index 4f5fdd8..b74f823 100644
--- a/src/gallium/drivers/i915/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915/i915_fpc_translate.c
@@ -764,21 +764,7 @@ i915_translate_instruction(struct i915_fp_compile *p,
       break;
 
    case TGSI_OPCODE_MIN:
-      src0 = src_vector(p, &inst->Src[0], fs);
-      src1 = src_vector(p, &inst->Src[1], fs);
-      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->Dst[0]),
-                      flags, 0, negate(tmp, 1, 1, 1, 1), 0, 0);
+      emit_simple_arith(p, inst, A0_MIN, 2, fs);
       break;
 
    case TGSI_OPCODE_MOV:




More information about the mesa-commit mailing list