Mesa (7.9): i915: Calculate partial result to temp register first

Ian Romanick idr at kemper.freedesktop.org
Tue Mar 1 21:26:34 UTC 2011


Module: Mesa
Branch: 7.9
Commit: 24a9d95ec752cb6d8531f612dfbad60fed5a53e8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=24a9d95ec752cb6d8531f612dfbad60fed5a53e8

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Thu Feb 10 11:48:59 2011 -0800

i915: Calculate partial result to temp register first

Previously the SNE and SEQ instructions would calculate the partial
result to the destination register.  This would cause problems if the
destination register was also one of the source registers.

Fixes piglit tests glsl-fs-any, glsl-fs-struct-equal,
glsl-fs-struct-notequal, glsl-fs-vec4-operator-equal,
glsl-fs-vec4-operator-notequal.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 53b8b6884355da3737d1ff714f1fadc69d1745e4)

---

 src/mesa/drivers/dri/i915/i915_fragprog.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 5e21918..a5f488e 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -809,18 +809,18 @@ upload_program(struct i915_fragment_program *p)
 	 flags = get_result_flags(inst);
 	 dst = get_result_vector(p, inst);
 
-	 /* dst = src1 >= src2 */
+	 /* tmp = src1 >= src2 */
 	 i915_emit_arith(p,
 			 A0_SGE,
-			 dst,
+			 tmp,
 			 flags, 0,
 			 src_vector(p, &inst->SrcReg[0], program),
 			 src_vector(p, &inst->SrcReg[1], program),
 			 0);
-	 /* tmp = src1 <= src2 */
+	 /* dst = src1 <= src2 */
 	 i915_emit_arith(p,
 			 A0_SGE,
-			 tmp,
+			 dst,
 			 flags, 0,
 			 negate(src_vector(p, &inst->SrcReg[0], program),
 				1, 1, 1, 1),
@@ -958,18 +958,18 @@ upload_program(struct i915_fragment_program *p)
 	 flags = get_result_flags(inst);
 	 dst = get_result_vector(p, inst);
 
-	 /* dst = src1 < src2 */
+	 /* tmp = src1 < src2 */
 	 i915_emit_arith(p,
 			 A0_SLT,
-			 dst,
+			 tmp,
 			 flags, 0,
 			 src_vector(p, &inst->SrcReg[0], program),
 			 src_vector(p, &inst->SrcReg[1], program),
 			 0);
-	 /* tmp = src1 > src2 */
+	 /* dst = src1 > src2 */
 	 i915_emit_arith(p,
 			 A0_SLT,
-			 tmp,
+			 dst,
 			 flags, 0,
 			 negate(src_vector(p, &inst->SrcReg[0], program),
 				1, 1, 1, 1),




More information about the mesa-commit mailing list