<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi Guys,</div><div><br></div>In  LLVM codegen, <div>a typical binary operation instruction is defined something like below:</div><div><br><div>"<span style="font-family: Menlo; font-size: 11px;">  </span><span style="font-family: Menlo; font-size: 11px;">def _rr: NVPTXInst<(outs Int1Regs:$dst), (ins Int1Regs:$a, Int1Regs:$b),</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #000000">          </span>"xor.pred \t$dst, $a, $b;"<span style="color: #000000">,</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      [(set Int1Regs:$dst, (OpNode Int1Regs:$a, Int1Regs:$b))]>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">“</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">which takes two inputs and write the result to the $dst register.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Then how to define a binary instruction which returns two results, one is written to the $dst register, and the other one is written to one of the inputs? I mean, to implement something like:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">”</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Type sincos( Type input,  Type * cosVal)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">“  </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">the instruction will compute sin and cos value of input, return the sin result and write the cos result to cosVal.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Is there anything special constraints or something I should put onto the cos register?</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Best</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Kevin</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div></div></body></html>