void emitSET(const CmpInstruction *);
void emitSLCT(const CmpInstruction *);
- void emitSELP(const CmpInstruction *);
+ void emitSELP(const Instruction *);
void emitTEXBAR(const Instruction *);
void emitTEX(const TexInstruction *);
}
}
-void CodeEmitterGK110::emitSELP(const CmpInstruction *i)
+void CodeEmitterGK110::emitSELP(const Instruction *i)
{
emitForm_21(i, 0x250, 0x050);
- if ((i->setCond == CC_NOT_P) ^ (bool)(i->src(2).mod & Modifier(NV50_IR_MOD_NOT)))
+ if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT))
code[1] |= 1 << 13;
}
emitSET(insn->asCmp());
break;
case OP_SELP:
- emitSELP(insn->asCmp());
+ emitSELP(insn);
break;
case OP_SLCT:
emitSLCT(insn->asCmp());
void emitSET(const CmpInstruction *);
void emitSLCT(const CmpInstruction *);
- void emitSELP(const CmpInstruction *);
+ void emitSELP(const Instruction *);
void emitTEXBAR(const Instruction *);
void emitTEX(const TexInstruction *);
code[0] |= 1 << 5;
}
-void CodeEmitterNVC0::emitSELP(const CmpInstruction *i)
+void CodeEmitterNVC0::emitSELP(const Instruction *i)
{
emitForm_A(i, HEX64(20000000, 00000004));
- if (i->setCond == CC_NOT_P || i->src(2).mod & Modifier(NV50_IR_MOD_NOT))
+ if (i->src(2).mod & Modifier(NV50_IR_MOD_NOT))
code[1] |= 1 << 20;
}
emitSET(insn->asCmp());
break;
case OP_SELP:
- emitSELP(insn->asCmp());
+ emitSELP(insn);
break;
case OP_SLCT:
emitSLCT(insn->asCmp());
CmpInstruction *Instruction::asCmp()
{
- if (op >= OP_SET_AND && op <= OP_SLCT)
+ if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP)
return static_cast<CmpInstruction *>(this);
return NULL;
}
const CmpInstruction *Instruction::asCmp() const
{
- if (op >= OP_SET_AND && op <= OP_SLCT)
+ if (op >= OP_SET_AND && op <= OP_SLCT && op != OP_SELP)
return static_cast<const CmpInstruction *>(this);
return NULL;
}
TYPE_U32, ld->getDef(0), atom->getSrc(1));
set->setPredicate(CC_P, ld->getDef(1));
- CmpInstruction *selp =
- bld.mkCmp(OP_SELP, CC_NOT_P, TYPE_U32, bld.getSSA(4, FILE_ADDRESS),
- TYPE_U32, ld->getDef(0), atom->getSrc(2),
- set->getDef(0));
+ Instruction *selp =
+ bld.mkOp3(OP_SELP, TYPE_U32, bld.getSSA(), ld->getDef(0),
+ atom->getSrc(2), set->getDef(0));
+ selp->src(2).mod = Modifier(NV50_IR_MOD_NOT);
selp->setPredicate(CC_P, ld->getDef(1));
stVal = selp->getDef(0);