nv50/ir: fix SUSTx constraints on Kepler

To prevent out-of-bounds access and format mismatch we add a predicate
on sustp, but we have to account for it when the sources are condensed
because a predicate is a source. Using the range 3:6 will only condense
the input data and it's always the case. This also fixes constraints
when an indirect access is used.

This ensures that sources are correctly aligned.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Samuel Pitoiset 2016-05-20 00:52:26 +02:00
parent 9c0d16adc1
commit 70834d05cd
1 changed files with 1 additions and 3 deletions

View File

@ -2131,9 +2131,7 @@ RegAlloc::InsertConstraintsPass::texConstraintNVE0(TexInstruction *tex)
condenseDefs(tex);
if (tex->op == OP_SUSTB || tex->op == OP_SUSTP) {
int n = tex->srcCount(0xff);
if (n > 4)
condenseSrcs(tex, 3, n - 1);
condenseSrcs(tex, 3, 6);
} else
if (isTextureOp(tex->op)) {
int n = tex->srcCount(0xff, true);