<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 29, 2011, at 10:46 AM, Justin Holewinski wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 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; position: static; z-index: auto; "><div><div class="h5">> +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>Would MCInstrDesc::findFirstPredOperandIdx() help?</div><div><br></div><div>/jakob</div><div><br></div></body></html>