nvc0/ir: be careful about propagating very large offsets into const load
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 11 Jan 2016 21:41:18 +0000 (16:41 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 14 Jan 2016 23:20:27 +0000 (18:20 -0500)
commit37b67db6ae34fb6586d640a7a1b6232f091dd812
tree5c1f64182d04ddaf470ac755f2dd87b7c8d8bd56
parent7a521ddf36b3d1f7b81604341fcda26c60809c9b
nvc0/ir: be careful about propagating very large offsets into const load

Indirect constbuf indexing works by using very large offsets. However if
an indirect constbuf index load is const-propagated, it becomes a very
large const offset. Take that into account when legalizing the SSA by
moving the high parts of that offset into the file index. Also disallow
very large (or small) indices on most other instructions.

This fixes regressions in ubo_array_indexing/*-two-arrays piglit tests.

Fixes: abd326e81b (nv50/ir: propagate indirect loads into instructions)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.h