inst = vp->insns[reloc->location].data;
target = vp->data->start + reloc->target;
- inst[1] &= ~0x0003fc000;
- inst[1] |= target << 14;
+ inst[1] &= ~0x0007fc000;
+ inst[1] |= (target & 0x1ff) << 14;
reloc++;
}
} else {
target = vp->data->start + reloc->target;
inst[1] &= ~0x0001ff000;
- inst[1] |= target << 12;
+ inst[1] |= (target & 0x1ff) << 12;
reloc++;
}
}
case NVFXSR_CONST:
sr |= (NVFX_VP(SRC_REG_TYPE_CONST) <<
NVFX_VP(SRC_REG_TYPE_SHIFT));
- if (src.reg.index < 512) {
+ if (src.reg.index < 256 && src.reg.index >= -256) {
reloc.location = vp->nr_insns - 1;
reloc.target = src.reg.index;
util_dynarray_append(&vp->const_relocs, struct nvfx_relocation, reloc);
} else {
- hw[1] |= (src.reg.index - 512) << NVFX_VP(INST_CONST_SRC_SHIFT);
+ hw[1] |= (src.reg.index << NVFX_VP(INST_CONST_SRC_SHIFT)) &
+ NVFX_VP(INST_CONST_SRC_MASK);
}
break;
case NVFXSR_NONE:
hw[0] |= NVFX_VP(INST_INDEX_INPUT);
else
assert(0);
+
if(src.indirect_reg)
hw[0] |= NVFX_VP(INST_ADDR_REG_SELECT_1);
hw[0] |= src.indirect_swz << NVFX_VP(INST_ADDR_SWZ_SHIFT);
src.reg = nvfx_reg(NVFXSR_INPUT, fsrc->Register.Index);
break;
case TGSI_FILE_CONSTANT:
- src.reg = vpc->r_const[fsrc->Register.Index];
+ if(fsrc->Register.Indirect) {
+ src.reg = vpc->r_const[0];
+ src.reg.index = fsrc->Register.Index;
+ } else {
+ src.reg = vpc->r_const[fsrc->Register.Index];
+ }
break;
case TGSI_FILE_IMMEDIATE:
src.reg = vpc->imm[fsrc->Register.Index];