<div class="gmail_quote">On Thu, Sep 29, 2011 at 2:00 PM, Jakob Stoklund Olesen <span dir="ltr"><<a href="mailto:stoklund@2pi.dk">stoklund@2pi.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div class="im"><br><div><div>On Sep 29, 2011, at 10:46 AM, Justin Holewinski wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;font-family:Menlo;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<div><div>> +void PTXInstPrinter::printPredicate(const MCInst *MI, raw_ostream &O) {<br>> +  // The last two operands are the predicate operands<br>> +  int RegIndex;<br>> +  int OpIndex;<br>> +<br>> +  if (MI->getOpcode() == PTX::CALL) {<br>
> +    RegIndex = 0;<br>> +    OpIndex  = 1;<br>> +  } else {<br>> +    RegIndex = MI->getNumOperands()-2;<br>> +    OpIndex = MI->getNumOperands()-1;<br>> +  }<br>> +<br><br></div></div>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.<br>
</blockquote><div><br></div><div>Yes, this was more of an intermediate hack until the rest of the changes go in that fix this.</div></span></blockquote><br></div></div><div>Would MCInstrDesc::findFirstPredOperandIdx() help?</div>
</div></blockquote><div><br></div><div>Sure, but how do you get the MCInstrDesc instance from within the InstPrinter?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><br></div><font color="#888888"><div>/jakob</div><div><br></div></font></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
<br>