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

Justin Holewinski justin.holewinski at gmail.com
Thu Sep 29 11:09:10 PDT 2011


On Thu, Sep 29, 2011 at 2:00 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

>
> 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?
>

Sure, but how do you get the MCInstrDesc instance from within the
InstPrinter?


>
> /jakob
>
>


-- 

Thanks,

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


More information about the llvm-commits mailing list