diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-01-11 16:41:18 -0500 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-01-14 18:20:27 -0500 |
commit | 37b67db6ae34fb6586d640a7a1b6232f091dd812 (patch) | |
tree | 5c1f64182d04ddaf470ac755f2dd87b7c8d8bd56 /src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp | |
parent | 7a521ddf36b3d1f7b81604341fcda26c60809c9b (diff) | |
download | external_mesa3d-37b67db6ae34fb6586d640a7a1b6232f091dd812.zip external_mesa3d-37b67db6ae34fb6586d640a7a1b6232f091dd812.tar.gz external_mesa3d-37b67db6ae34fb6586d640a7a1b6232f091dd812.tar.bz2 |
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>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp index 014c652..a03afa8 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp @@ -384,6 +384,16 @@ TargetNVC0::insnCanLoad(const Instruction *i, int s, } bool +TargetNVC0::insnCanLoadOffset(const Instruction *insn, int s, int offset) const +{ + const ValueRef& ref = insn->src(s); + if (ref.getFile() == FILE_MEMORY_CONST && + (insn->op != OP_LOAD || insn->subOp != NV50_IR_SUBOP_LDC_IS)) + return offset >= -0x8000 && offset < 0x8000; + return true; +} + +bool TargetNVC0::isAccessSupported(DataFile file, DataType ty) const { if (ty == TYPE_NONE) |