[llvm-commits] [llvm] r140697 - in /llvm/trunk: lib/Target/PTX/ lib/Target/PTX/InstPrinter/ lib/Target/PTX/MCTargetDesc/ test/CodeGen/PTX/

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Sep 29 11:00:26 PDT 2011


On Sep 29, 2011, at 10:46 AM, Justin Holewinski wrote:

> > +void PTXInstPrinter::printPredicate(const MCInst *MI, raw_ostream &O) {
> > +  // The last two operands are the predicate operands
> > +  int RegIndex;
> > +  int OpIndex;
> > +
> > +  if (MI->getOpcode() == PTX::CALL) {
> > +    RegIndex = 0;
> > +    OpIndex  = 1;
> > +  } else {
> > +    RegIndex = MI->getNumOperands()-2;
> > +    OpIndex = MI->getNumOperands()-1;
> > +  }
> > +
> 
> Could the predicate be first in the operand list even for call instructions? It would be nice, though not required obviously, to have the access mechanism for the predicate be the same for all instructions.
> 
> Yes, this was more of an intermediate hack until the rest of the changes go in that fix this.

Would MCInstrDesc::findFirstPredOperandIdx() help?

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110929/d6d21f57/attachment.html>


More information about the llvm-commits mailing list