diff options
author | Christoph Bumiller <[email protected]> | 2010-08-16 15:21:23 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2010-08-17 00:47:46 +0200 |
commit | e7a0bfa69a6ce45bb53baa8220eae418225c5649 (patch) | |
tree | 599ff01869b30151d57cee914549eff988798918 /src/gallium/drivers/nv50/nv50_pc.c | |
parent | 4de293bb9acd1ecda683f735af32f7485a0f213e (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.c | 14 |
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 7601049126f..5041fc75059 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) { |