setSrcFileBits(i, NV50_OP_ENC_LONG_ALT);
setSrc(i, 0, 0);
- setSrc(i, 1, 2);
+ if (i->predSrc != 1)
+ setSrc(i, 1, 2);
if (i->getIndirect(0, 0)) {
assert(!i->getIndirect(1, 0));
emitForm_ADD(i);
- if (!i->srcExists(1))
+ if (!i->srcExists(1) || i->predSrc == 1)
srcId(i->src(0), 32 + 14);
}
}
static void
-interpApply(const InterpEntry *entry, uint32_t *code,
- bool force_persample_interp, bool flatshade)
+interpApply(const FixupEntry *entry, uint32_t *code, const FixupData& data)
{
int ipa = entry->ipa;
int encSize = entry->reg;
if ((ipa & NV50_IR_INTERP_SAMPLE_MASK) == NV50_IR_INTERP_DEFAULT &&
(ipa & NV50_IR_INTERP_MODE_MASK) != NV50_IR_INTERP_FLAT) {
- if (force_persample_interp) {
+ if (data.force_persample_interp) {
if (encSize == 8)
code[loc + 1] |= 1 << 16;
else
code[1] |= (i->tex.mask & 0xc) << 12;
if (i->tex.liveOnly)
- code[1] |= 4;
+ code[1] |= 1 << 2;
+ if (i->tex.derivAll)
+ code[1] |= 1 << 3;
defId(i->def(0), 2);
insn->encSize = 8;
for (int i = fn->bbCount - 1; i >= 0 && fn->bbArray[i] != insn->bb; --i) {
- fn->bbArray[i]->binPos += 4;
+ fn->bbArray[i]->binPos += adj;
}
fn->binSize += adj;
insn->bb->binSize += adj;
return;
}
}
- epilogue->binSize -= 8;
- func->binSize -= 8;
+
+ int adj = epilogue->getExit()->encSize;
+ epilogue->binSize -= adj;
+ func->binSize -= adj;
delete_Instruction(func->getProgram(), epilogue->getExit());
+
+ // There may be BB's that are laid out after the exit block
+ for (int i = func->bbCount - 1; i >= 0 && func->bbArray[i] != epilogue; --i) {
+ func->bbArray[i]->binPos -= adj;
+ }
}
void