<p dir="ltr">Tim,</p>
<p dir="ltr"> Thanks for the reply. I found the merge values function and am trying that route now. </p>
<p dir="ltr">Thanks.</p>
<div class="gmail_quote">On Feb 24, 2016 10:16 AM, "Tim Northover" <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ryan,<br>
<br>
On 24 February 2016 at 06:42, Ryan Taylor via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Seems that it doesn't like returning one value but how do you return more<br>
> than one value?<br>
<br>
You create the node using a getNode call that takes either an<br>
ArrayRef<EVT> or an SDVTList instead of a single EVT result type. Then<br>
you almost always need to write C++ code in ISelDAGToDAG to select it<br>
properly.<br>
<br>
Alternatively, you could lower it to multiple instructions (e.g.<br>
division, multiplication and subtraction) and then recombine them at<br>
the end with a MERGE_VALUES node as above. Then since each actual<br>
instruction only has one value, normal TableGen could handle selection<br>
and the generic infrastructure will take care of the MERGE_VALUES.<br>
<br>
> I looked at some other cases, such as arm, and it generates a pair and then<br>
> returns the first of the pair, this does not work for me however.<br>
<br>
The pair in the ARM case is unrelated to the pair in the DIVREM<br>
itself. The second SDValue is the chain that any function call will<br>
produce for ordering purposes, which isn't needed because no<br>
load/store/side-effecty things can depend on a DIVREM.<br>
<br>
That first SDValue will be a node with two results as I described above.<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</blockquote></div>