Mesa (master): r300/compiler: Handle SGT and SLE at the beginning of loops.

Marek Olšák mareko at kemper.freedesktop.org
Fri Jun 11 13:24:02 PDT 2010


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

Author: Tom Stellard <tstellar at gmail.com>
Date:   Tue Jun  8 00:16:38 2010 -0700

r300/compiler: Handle SGT and SLE at the beginning of loops.

---

 .../dri/r300/compiler/radeon_emulate_loops.c       |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c
index 28b9684..7e1ab5e 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c
@@ -297,10 +297,12 @@ static int transform_const_loop(struct emulate_loop_state * s,
 	/* Remove the first 4 instructions inside the loop, which are part
 	 * of the conditional and no longer needed.
 	 */
-	/* SLT/SGE */
+	/* SLT/SGE/SGT/SLE */
 	if(loop->BeginLoop->Next->U.I.Opcode != RC_OPCODE_SLT &&
-	   loop->BeginLoop->Next->U.I.Opcode != RC_OPCODE_SGE){
-		rc_error(s->C,"Unexpected instruction, expected SLT/SGE\n");
+	   loop->BeginLoop->Next->U.I.Opcode != RC_OPCODE_SGE &&
+	   loop->BeginLoop->Next->U.I.Opcode != RC_OPCODE_SGT &&
+	   loop->BeginLoop->Next->U.I.Opcode != RC_OPCODE_SLE){
+		rc_error(s->C,"Unexpected instruction, expected LT,GT,LE,GE\n");
 		return 0;
 	}
 	/* IF */
@@ -364,6 +366,12 @@ static struct rc_instruction * transform_loop(struct emulate_loop_state * s,
 	case RC_OPCODE_SLT:
 		ptr->U.I.Opcode = RC_OPCODE_SGE;
 		break;
+	case RC_OPCODE_SLE:
+		ptr->U.I.Opcode = RC_OPCODE_SGT;
+		break;
+	case RC_OPCODE_SGT:
+		ptr->U.I.Opcode = RC_OPCODE_SLE;
+		break;
 	default:
 		rc_error(s->C,
 			"Loop does not start with a conditional instruction.");



More information about the mesa-commit mailing list