Mesa (master): nv50: cannot kill branch if immediate is used

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Thu Dec 31 05:38:08 PST 2009


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Wed Dec 30 21:25:13 2009 +0100

nv50: cannot kill branch if immediate is used

The immediate's bits eat the condition bits.

---

 src/gallium/drivers/nv50/nv50_program.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 7d1b5fd..cc15f45 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -453,6 +453,7 @@ static INLINE void
 set_pred(struct nv50_pc *pc, unsigned pred, unsigned idx,
 	 struct nv50_program_exec *e)
 {
+	assert(!is_immd(e));
 	set_long(pc, e);
 	e->inst[1] &= ~((0x1f << 7) | (0x3 << 12));
 	e->inst[1] |= (pred << 7) | (idx << 12);
@@ -2118,6 +2119,8 @@ nv50_kill_branch(struct nv50_pc *pc)
 
 	if (pc->if_insn[lvl]->next != pc->p->exec_tail)
 		return FALSE;
+	if (is_immd(pc->p->exec_tail))
+		return FALSE;
 
 	/* if ccode == 'true', the BRA is from an ELSE and the predicate
 	 * reg may no longer be valid, since we currently always use $p0



More information about the mesa-commit mailing list