summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_pc.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-08-16 15:21:23 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-08-17 00:47:46 +0200
commite7a0bfa69a6ce45bb53baa8220eae418225c5649 (patch)
tree599ff01869b30151d57cee914549eff988798918 /src/gallium/drivers/nv50/nv50_pc.c
parent4de293bb9acd1ecda683f735af32f7485a0f213e (diff)
nv50: flatten simple IF/ELSE/ENDIF constructs
Less branching means less instructions and less thread divergence.
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc.c b/src/gallium/drivers/nv50/nv50_pc.c
index 7601049126..5041fc7505 100644
--- a/src/gallium/drivers/nv50/nv50_pc.c
+++ b/src/gallium/drivers/nv50/nv50_pc.c
@@ -125,6 +125,20 @@ nv50_nvi_can_load(struct nv_instruction *nvi, int s, struct nv_value *value)
}
}
+/* Return whether this instruction can be executed conditionally. */
+boolean
+nv50_nvi_can_predicate(struct nv_instruction *nvi)
+{
+ int i;
+
+ if (nvi->flags_src)
+ return FALSE;
+ for (i = 0; i < 4 && nvi->src[i]; ++i)
+ if (nvi->src[i]->value->reg.file == NV_FILE_IMM)
+ return FALSE;
+ return TRUE;
+}
+
ubyte
nv50_supported_src_mods(uint opcode, int s)
{